Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1286393

Re: [RFC PATCH -v2] mm, oom: introduce oom reaper

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH -v2] mm, oom: introduce oom reaper
Date 2015-12-08 12:10 +0100
Message-ID <qDojE-1AO-11@gated-at.bofh.it> (permalink)
References (1 earlier) <qzQo9-2Ef-3@gated-at.bofh.it> <qATjY-1Oq-25@gated-at.bofh.it> <qCki5-12G-1@gated-at.bofh.it> <qD6ws-6Nn-63@gated-at.bofh.it> <qDciu-2cp-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-01 14:40 +0100
  Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-12-05 13:40 +0100
    Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-07 17:10 +0100
      Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-12-07 23:20 +0100
        Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-08 12:10 +0100

csiph-web