Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* GNU General Public License for more details.
*/
+#include <linux/sched.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
read_lock(&tasklist_lock);
for_each_process(p) {
struct mm_struct *mm;
+ struct signal_struct *sig;
int oom_adj;
task_lock(p);
mm = p->mm;
- if (!mm) {
+ sig = p->signal;
+ if (!mm || !sig) {
task_unlock(p);
continue;
}
- oom_adj = mm->oom_adj;
+ oom_adj = sig->oom_adj;
if (oom_adj < min_adj) {
task_unlock(p);
continue;