Re: [PATCH] mm,oom: Do not unfreeze OOM victim thread.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tetsuo,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.16-rc7 next-20180329]
[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/Tetsuo-Handa/mm-oom-Do-not-unfreeze-OOM-victim-thread/20180330-215548
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> kernel/power/process.c:154:42: sparse: too many arguments for function oom_killer_disable
   kernel/power/process.c: In function 'freeze_processes':
   kernel/power/process.c:154:17: error: too many arguments to function 'oom_killer_disable'
     if (!error && !oom_killer_disable(msecs_to_jiffies(freeze_timeout_msecs)))
                    ^~~~~~~~~~~~~~~~~~
   In file included from kernel/power/process.c:13:0:
   include/linux/oom.h:109:13: note: declared here
    extern bool oom_killer_disable(void);
                ^~~~~~~~~~~~~~~~~~

vim +154 kernel/power/process.c

6161b2ce8 Pavel Machek      2005-09-03  115  
11b2ce2ba Rafael J. Wysocki 2006-12-06  116  /**
2aede851d Rafael J. Wysocki 2011-09-26  117   * freeze_processes - Signal user space processes to enter the refrigerator.
2b44c4db2 Colin Cross       2013-07-24  118   * The current thread will not be frozen.  The same process that calls
2b44c4db2 Colin Cross       2013-07-24  119   * freeze_processes must later call thaw_processes.
03afed8bc Tejun Heo         2011-11-21  120   *
03afed8bc Tejun Heo         2011-11-21  121   * On success, returns 0.  On failure, -errno and system is fully thawed.
11b2ce2ba Rafael J. Wysocki 2006-12-06  122   */
11b2ce2ba Rafael J. Wysocki 2006-12-06  123  int freeze_processes(void)
11b2ce2ba Rafael J. Wysocki 2006-12-06  124  {
e7cd8a722 Rafael J. Wysocki 2007-07-19  125  	int error;
11b2ce2ba Rafael J. Wysocki 2006-12-06  126  
247bc0374 Rafael J. Wysocki 2012-03-28  127  	error = __usermodehelper_disable(UMH_FREEZING);
1e73203cd Rafael J. Wysocki 2012-03-28  128  	if (error)
1e73203cd Rafael J. Wysocki 2012-03-28  129  		return error;
1e73203cd Rafael J. Wysocki 2012-03-28  130  
2b44c4db2 Colin Cross       2013-07-24  131  	/* Make sure this task doesn't get frozen */
2b44c4db2 Colin Cross       2013-07-24  132  	current->flags |= PF_SUSPEND_TASK;
2b44c4db2 Colin Cross       2013-07-24  133  
a3201227f Tejun Heo         2011-11-21  134  	if (!pm_freezing)
a3201227f Tejun Heo         2011-11-21  135  		atomic_inc(&system_freezing_cnt);
a3201227f Tejun Heo         2011-11-21  136  
33e4f80ee Rafael J. Wysocki 2017-06-12  137  	pm_wakeup_clear(true);
35536ae17 Michal Hocko      2015-02-11  138  	pr_info("Freezing user space processes ... ");
a3201227f Tejun Heo         2011-11-21  139  	pm_freezing = true;
ebb12db51 Rafael J. Wysocki 2008-06-11  140  	error = try_to_freeze_tasks(true);
2aede851d Rafael J. Wysocki 2011-09-26  141  	if (!error) {
247bc0374 Rafael J. Wysocki 2012-03-28  142  		__usermodehelper_set_disable_depth(UMH_DISABLED);
35536ae17 Michal Hocko      2015-02-11  143  		pr_cont("done.");
2aede851d Rafael J. Wysocki 2011-09-26  144  	}
35536ae17 Michal Hocko      2015-02-11  145  	pr_cont("\n");
2aede851d Rafael J. Wysocki 2011-09-26  146  	BUG_ON(in_atomic());
2aede851d Rafael J. Wysocki 2011-09-26  147  
c32b3cbe0 Michal Hocko      2015-02-11  148  	/*
c32b3cbe0 Michal Hocko      2015-02-11  149  	 * Now that the whole userspace is frozen we need to disbale
c32b3cbe0 Michal Hocko      2015-02-11  150  	 * the OOM killer to disallow any further interference with
7d2e7a22c Michal Hocko      2016-10-07  151  	 * killable tasks. There is no guarantee oom victims will
7d2e7a22c Michal Hocko      2016-10-07  152  	 * ever reach a point they go away we have to wait with a timeout.
c32b3cbe0 Michal Hocko      2015-02-11  153  	 */
7d2e7a22c Michal Hocko      2016-10-07 @154  	if (!error && !oom_killer_disable(msecs_to_jiffies(freeze_timeout_msecs)))
c32b3cbe0 Michal Hocko      2015-02-11  155  		error = -EBUSY;
c32b3cbe0 Michal Hocko      2015-02-11  156  
03afed8bc Tejun Heo         2011-11-21  157  	if (error)
03afed8bc Tejun Heo         2011-11-21  158  		thaw_processes();
2aede851d Rafael J. Wysocki 2011-09-26  159  	return error;
2aede851d Rafael J. Wysocki 2011-09-26  160  }
2aede851d Rafael J. Wysocki 2011-09-26  161  

:::::: The code at line 154 was first introduced by commit
:::::: 7d2e7a22cf27e7569e6816ccc05dd74248048b30 oom, suspend: fix oom_killer_disable vs. pm suspend properly

:::::: TO: Michal Hocko <mhocko@xxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux