* + proc_oom_score-remove-tasklist_lock-and-pid_alive.patch added to -mm tree
@ 2016-06-08 21:33 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2016-06-08 21:33 UTC (permalink / raw)
To: oleg, mhocko, penguin-kernel, rientjes, mm-commits
The patch titled
Subject: proc_oom_score: remove tasklist_lock and pid_alive()
has been added to the -mm tree. Its filename is
proc_oom_score-remove-tasklist_lock-and-pid_alive.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/proc_oom_score-remove-tasklist_lock-and-pid_alive.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/proc_oom_score-remove-tasklist_lock-and-pid_alive.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Oleg Nesterov <oleg@redhat.com>
Subject: proc_oom_score: remove tasklist_lock and pid_alive()
This was needed before to ensure that ->signal != 0 and do_each_thread()
is safe, see b95c35e76b29b ("oom: fix the unsafe usage of badness() in
proc_oom_score()") for details.
Today tsk->signal can't go away and for_each_thread(tsk) is always safe.
Link: http://lkml.kernel.org/r/20160608211921.GA15508@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/proc/base.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff -puN fs/proc/base.c~proc_oom_score-remove-tasklist_lock-and-pid_alive fs/proc/base.c
--- a/fs/proc/base.c~proc_oom_score-remove-tasklist_lock-and-pid_alive
+++ a/fs/proc/base.c
@@ -579,11 +579,8 @@ static int proc_oom_score(struct seq_fil
unsigned long totalpages = totalram_pages + total_swap_pages;
unsigned long points = 0;
- read_lock(&tasklist_lock);
- if (pid_alive(task))
- points = oom_badness(task, NULL, NULL, totalpages) *
- 1000 / totalpages;
- read_unlock(&tasklist_lock);
+ points = oom_badness(task, NULL, NULL, totalpages) *
+ 1000 / totalpages;
seq_printf(m, "%lu\n", points);
return 0;
_
Patches currently in -mm which might be from oleg@redhat.com are
proc_oom_score-remove-tasklist_lock-and-pid_alive.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-06-08 21:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 21:33 + proc_oom_score-remove-tasklist_lock-and-pid_alive.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.