linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	devel@driverdev.osuosl.org, linux-mm@kvack.org,
	Arve Hjonnevag <arve@android.com>,
	Riley Andrews <riandrews@android.com>
Subject: Re: [PATCH] android,lowmemorykiller: Don't abuse TIF_MEMDIE.
Date: Fri, 11 Mar 2016 14:01:09 -0800	[thread overview]
Message-ID: <20160311220109.GD11274@kroah.com> (raw)
In-Reply-To: <20160308141858.GJ13542@dhcp22.suse.cz>

On Tue, Mar 08, 2016 at 03:18:59PM +0100, Michal Hocko wrote:
> On Tue 08-03-16 20:01:32, Tetsuo Handa wrote:
> > Currently, lowmemorykiller (LMK) is using TIF_MEMDIE for two purposes.
> > One is to remember processes killed by LMK, and the other is to
> > accelerate termination of processes killed by LMK.
> > 
> > But since LMK is invoked as a memory shrinker function, there still
> > should be some memory available. It is very likely that memory
> > allocations by processes killed by LMK will succeed without using
> > ALLOC_NO_WATERMARKS via TIF_MEMDIE. Even if their allocations cannot
> > escape from memory allocation loop unless they use ALLOC_NO_WATERMARKS,
> > lowmem_deathpending_timeout can guarantee forward progress by choosing
> > next victim process.
> > 
> > On the other hand, mark_oom_victim() assumes that it must be called with
> > oom_lock held and it must not be called after oom_killer_disable() was
> > called. But LMK is calling it without holding oom_lock and checking
> > oom_killer_disabled. It is possible that LMK calls mark_oom_victim()
> > due to allocation requests by kernel threads after current thread
> > returned from oom_killer_disabled(). This will break synchronization
> > for PM/suspend.
> > 
> > This patch introduces per a task_struct flag for remembering processes
> > killed by LMK, and replaces TIF_MEMDIE with that flag. By applying this
> > patch, assumption by mark_oom_victim() becomes true.
> 
> Thanks for looking into this. A separate flag sounds like a better way
> to go (assuming that the flags are not scarce which doesn't seem to be
> the case here).
>  
> The LMK cannot kill the frozen tasks now but this shouldn't be a big deal
> because this is not strictly necessary for the system to move on. We are
> not OOM.
> 
> > Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> > Cc: Michal Hocko <mhocko@suse.cz>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Arve Hjonnevag <arve@android.com>
> > Cc: Riley Andrews <riandrews@android.com>
> 
> Acked-by: Michal Hocko <mhocko@suse.com>

So, any objection for me taking this through the staging tree?

thanks,

greg k-h

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-03-11 22:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 11:01 [PATCH] android,lowmemorykiller: Don't abuse TIF_MEMDIE Tetsuo Handa
2016-03-08 14:18 ` Michal Hocko
2016-03-11 22:01   ` Greg Kroah-Hartman [this message]
2016-03-21 11:00     ` Tetsuo Handa
2016-03-21 11:10       ` Greg KH
2016-04-04 10:48         ` Tetsuo Handa
2016-04-04 13:20           ` Greg KH

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=20160311220109.GD11274@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=riandrews@android.com \
    /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;
as well as URLs for NNTP newsgroup(s).