History

mm, oom: remove redundant task_in_mem_cgroup() check

oom_unkillable_task() can be called from three different contexts i.e. global OOM, memcg OOM and oom_score procfs interface. At the moment oom_unkillable_task() does a task_in_mem_cgroup() check on the given process. Since there is no reason to perform task_in_mem_cgroup() check for global OOM and oom_score procfs interface, those contexts provide NULL memcg and skips the task_in_mem_cgroup() check. However for memcg OOM context, the oom_unkillable_task() is always called from mem_cgroup_scan_tasks() and thus task_in_mem_cgroup() check becomes redundant and effectively dead code. So, just remove the task_in_mem_cgroup() check altogether.

Shakeel Butt committed 7 years ago

Commit 6ba749e1 parent 5eee7e15 files · +9 −47Browse files

Showing the changes to include/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/linux/memcontrol.h +0 −7
  2. include/linux/oom.h +1 −1
include/linux/memcontrol.h+0−7
@@ -394,7 +394,6 @@ out: · 393 unmodified lines
394394
395395 struct lruvec *mem_cgroup_page_lruvec(struct page *, struct pglist_data *);
396396
397−bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg);
398397 struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
399398
400399 struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm);
@@ -875,12 +874,6 @@ static inline bool mm_match_cgroup(struct mm_struct *mm, · 474 unmodified lines
875874 return true;
876875 }
877876
878−static inline bool task_in_mem_cgroup(struct task_struct *task,
879− const struct mem_cgroup *memcg)
880−{
881− return true;
882−}
883−
884877 static inline struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm)
885878 {
886879 return NULL;
include/linux/oom.h+1−1
@@ -108,7 +108,7 @@ static inline vm_fault_t check_stable_address_space(struct mm_struct *mm) · 107 unmodified lines
108108 bool __oom_reap_task_mm(struct mm_struct *mm);
109109
110110 extern unsigned long oom_badness(struct task_struct *p,
111− struct mem_cgroup *memcg, const nodemask_t *nodemask,
111+ const nodemask_t *nodemask,
112112 unsigned long totalpages);
113113
114114 extern bool out_of_memory(struct oom_control *oc);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t