public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	torvalds@linux-foundation.org, mgorman@suse.de,
	rientjes@google.com, riel@redhat.com, hughd@google.com,
	oleg@redhat.com, andrea@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH -v2] mm, oom: introduce oom reaper
Date: Tue, 8 Dec 2015 12:06:53 +0100	[thread overview]
Message-ID: <20151208110653.GA25800@dhcp22.suse.cz> (raw)
In-Reply-To: <201512080719.EHD73429.JQHFtMOFLOFSVO@I-love.SAKURA.ne.jp>

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

  reply	other threads:[~2015-12-08 11:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 15:56 [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko
2015-11-25 20:08 ` Johannes Weiner
2015-11-26 11:08   ` Michal Hocko
2015-11-26 15:24     ` Tetsuo Handa
2015-11-26 16:34       ` Michal Hocko
2015-11-26 17:31         ` Michal Hocko
2015-11-27 11:29         ` Tetsuo Handa
2015-11-27 12:35           ` Michal Hocko
2015-11-27 16:12 ` [RFC PATCH -v2] " Michal Hocko
2015-11-27 16:39   ` Mel Gorman
2015-12-01 13:07     ` Michal Hocko
2015-11-28  4:39   ` Tetsuo Handa
2015-11-28 16:10     ` Tetsuo Handa
2015-12-01 13:29       ` Michal Hocko
2015-12-05 12:33         ` Tetsuo Handa
2015-12-07 16:07           ` Michal Hocko
2015-12-07 22:19             ` Tetsuo Handa
2015-12-08 11:06               ` Michal Hocko [this message]
2015-12-01 13:22     ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151208110653.GA25800@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=oleg@redhat.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox