lkml.org 
[lkml]   [2015]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH -v2] mm, oom: introduce oom reaper
On Tue 08-12-15 07:19:42, Tetsuo Handa wrote:
> Michal Hocko wrote:
> > Yes you are right! The reference count should be incremented before
> > publishing the new mm_to_reap. I thought that an elevated ref. count by
> > the caller would be enough but this was clearly wrong. Does the update
> > below looks better?
>
> I think that moving mmdrop() from oom_kill_process() to
> oom_reap_vmas() xor wake_oom_reaper() makes the patch simpler.

It surely is less lines of code but I am not sure it is simpler. I do
not think we should drop the reference in a different path than it is
taken. Maybe we will grow more users of wake_oom_reaper in the future
and this is quite subtle behavior.

>
> rcu_read_unlock();
>
> + if (can_oom_reap)
> + wake_oom_reaper(mm); /* will call mmdrop() */
> + else
> + mmdrop(mm);
> - mmdrop(mm);
> put_task_struct(victim);
> }

Thanks!
--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2015-12-08 12:21    [W:0.728 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site