Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1409940
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/6] mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj |
| Date | 2016-05-31 09:50 +0200 |
| Message-ID | <rEMB3-89y-7@gated-at.bofh.it> (permalink) |
| References | <rEv7b-4Dp-11@gated-at.bofh.it> <rEv7c-4Dp-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This got lost during the rebase.
---
From cb16205a71c29d80425922cfc584373eb14b018e Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@suse.com>
Date: Tue, 31 May 2016 07:16:12 +0200
Subject: [PATCH] fold me "mm, oom_adj: make sure processes sharing mm have
same view of oom_score_adj"
- skip over same thread group
- skip over kernel threads and global init
Signed-off-by: Michal Hocko <mhocko@suse.com>
---
fs/proc/base.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index f4fcd2954f42..164fe38022d2 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1104,8 +1104,11 @@ static int __set_oom_adj(struct file *file, int oom_adj, bool legacy)
rcu_read_lock();
for_each_process(p) {
- /* do not touch kernel threads */
- if (p->flags & PF_KTHREAD)
+ if (same_thread_group(task,p))
+ continue;
+
+ /* do not touch kernel threads or the global init */
+ if (p->flags & PF_KTHREAD || is_global_init(p))
continue;
task_lock(p);
--
2.8.1
--
Michal Hocko
SUSE Labs
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 3/6] mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj Michal Hocko <mhocko@kernel.org> - 2016-05-30 15:10 +0200 Re: [PATCH 3/6] mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj Michal Hocko <mhocko@kernel.org> - 2016-05-31 09:50 +0200
csiph-web