diff mbox

[1/2] mm: revert mem_cgroup_put() introduction

Message ID 20180623000600.5818-1-guro@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roman Gushchin June 23, 2018, 12:05 a.m. UTC
This patch should be folded into "mm, oom: cgroup-aware OOM killer".

Signed-off-by: Roman Gushchin <guro@fb.com>
---
 include/linux/memcontrol.h | 9 ---------
 1 file changed, 9 deletions(-)

Comments

kernel test robot June 23, 2018, 12:47 a.m. UTC | #1
Hi Roman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20180622]
[cannot apply to linus/master v4.18-rc1 v4.17 v4.17-rc7 v4.18-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Roman-Gushchin/mm-revert-mem_cgroup_put-introduction/20180623-080942
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: the linux-review/Roman-Gushchin/mm-revert-mem_cgroup_put-introduction/20180623-080942 HEAD 76214420a3e55c42797f5f22cb04d1a3331c1ece builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   mm/oom_kill.c: In function 'oom_kill_memcg_victim':
>> mm/oom_kill.c:1026:2: error: implicit declaration of function 'mem_cgroup_put'; did you mean 'mem_cgroup_id'? [-Werror=implicit-function-declaration]
     mem_cgroup_put(oc->chosen_memcg);
     ^~~~~~~~~~~~~~
     mem_cgroup_id
   cc1: some warnings being treated as errors

vim +1026 mm/oom_kill.c

4ac2c83a Roman Gushchin 2018-06-15   997  
7388c5c4 Roman Gushchin 2018-06-15   998  static bool oom_kill_memcg_victim(struct oom_control *oc)
7388c5c4 Roman Gushchin 2018-06-15   999  {
4ac2c83a Roman Gushchin 2018-06-15  1000  	if (oc->chosen_memcg == NULL || oc->chosen_memcg == INFLIGHT_VICTIM)
4ac2c83a Roman Gushchin 2018-06-15  1001  		return oc->chosen_memcg;
4ac2c83a Roman Gushchin 2018-06-15  1002  
7388c5c4 Roman Gushchin 2018-06-15  1003  	/*
7388c5c4 Roman Gushchin 2018-06-15  1004  	 * If memory.oom_group is set, kill all tasks belonging to the sub-tree
7388c5c4 Roman Gushchin 2018-06-15  1005  	 * of the chosen memory cgroup, otherwise kill the task with the biggest
7388c5c4 Roman Gushchin 2018-06-15  1006  	 * memory footprint.
7388c5c4 Roman Gushchin 2018-06-15  1007  	 */
7388c5c4 Roman Gushchin 2018-06-15  1008  	if (mem_cgroup_oom_group(oc->chosen_memcg)) {
7388c5c4 Roman Gushchin 2018-06-15  1009  		mem_cgroup_scan_tasks(oc->chosen_memcg, oom_kill_memcg_member,
7388c5c4 Roman Gushchin 2018-06-15  1010  				      NULL);
7388c5c4 Roman Gushchin 2018-06-15  1011  		/* We have one or more terminating processes at this point. */
7388c5c4 Roman Gushchin 2018-06-15  1012  		oc->chosen_task = INFLIGHT_VICTIM;
7388c5c4 Roman Gushchin 2018-06-15  1013  	} else {
4ac2c83a Roman Gushchin 2018-06-15  1014  		oc->chosen_points = 0;
4ac2c83a Roman Gushchin 2018-06-15  1015  		oc->chosen_task = NULL;
4ac2c83a Roman Gushchin 2018-06-15  1016  		mem_cgroup_scan_tasks(oc->chosen_memcg, oom_evaluate_task, oc);
4ac2c83a Roman Gushchin 2018-06-15  1017  
7388c5c4 Roman Gushchin 2018-06-15  1018  		if (oc->chosen_task == NULL ||
7388c5c4 Roman Gushchin 2018-06-15  1019  		    oc->chosen_task == INFLIGHT_VICTIM)
4ac2c83a Roman Gushchin 2018-06-15  1020  			goto out;
4ac2c83a Roman Gushchin 2018-06-15  1021  
4ac2c83a Roman Gushchin 2018-06-15  1022  		__oom_kill_process(oc->chosen_task);
7388c5c4 Roman Gushchin 2018-06-15  1023  	}
4ac2c83a Roman Gushchin 2018-06-15  1024  
4ac2c83a Roman Gushchin 2018-06-15  1025  out:
4ac2c83a Roman Gushchin 2018-06-15 @1026  	mem_cgroup_put(oc->chosen_memcg);
4ac2c83a Roman Gushchin 2018-06-15  1027  	return oc->chosen_task;
4ac2c83a Roman Gushchin 2018-06-15  1028  }
4ac2c83a Roman Gushchin 2018-06-15  1029  

:::::: The code at line 1026 was first introduced by commit
:::::: 4ac2c83a8e8a0708278b6f2bb44dc4c880fdcaf6 mm, oom: cgroup-aware OOM killer

:::::: TO: Roman Gushchin <guro@fb.com>
:::::: CC: Stephen Rothwell <sfr@canb.auug.org.au>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 3607913032be..cf1c3555328f 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -383,11 +383,6 @@  struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css){
 	return css ? container_of(css, struct mem_cgroup, css) : NULL;
 }
 
-static inline void mem_cgroup_put(struct mem_cgroup *memcg)
-{
-	css_put(&memcg->css);
-}
-
 #define mem_cgroup_from_counter(counter, member)	\
 	container_of(counter, struct mem_cgroup, member)
 
@@ -857,10 +852,6 @@  static inline bool task_in_mem_cgroup(struct task_struct *task,
 	return true;
 }
 
-static inline void mem_cgroup_put(struct mem_cgroup *memcg)
-{
-}
-
 static inline struct mem_cgroup *
 mem_cgroup_iter(struct mem_cgroup *root,
 		struct mem_cgroup *prev,