public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ganesh Mahendran <opensource.ganesh@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, arve@android.com,
	riandrews@android.com
Subject: Re: [PATCH 3/3] staging: lowmemorykiller: select the task with maximum rss to kill
Date: Wed, 22 Jun 2016 12:44:48 +0800	[thread overview]
Message-ID: <20160622044448.GC5683@leo-test> (raw)
In-Reply-To: <alpine.DEB.2.10.1606211313210.28466@chino.kir.corp.google.com>

Hi, David:

On Tue, Jun 21, 2016 at 01:14:36PM -0700, David Rientjes wrote:
> On Tue, 21 Jun 2016, Ganesh Mahendran wrote:
> 
> > Current task selecting logic in LMK does not fully aware of the memory
> > pressure. It may select the task with maximum score adj, but with
> > least tasksize.
> > 
> > For example, if min_score_adj is 200, and there are 2 tasks in system:
> >    task a: score adj 500, tasksize 200M
> >    task b: score adj 1000, tasksize 1M
> > Current LMK logic will select *task b*. But now the system already have
> > much memory pressure.
> > 
> > We should select the task with maximum task from all the tasks which
> > score adj >= min_score_adj.
> > 
> 
> Unfortunately, I'm not sure that we can get away with this although I 
> agree that it is a better result (kill a large process, avoid lowmem or 
> oom for longer).

Yes, from our testing with this patch applied, system works more smoothly,
and user have better experience.

> 
> It changes the kill order for systems that have already fine-tuned their 
> oom_score_adj settings and can regress because of this change.  If systems 
> really want task b to be killed above, this breaks and they have no 
> immediate way of fixing it.

I think the processes with score_adj >= min_score_adj are all acceptable
if we kill them. In android products, LMK does the main job to free memory
when system is hard to shrink file/anon pages. If LMK does not free enough memory,
the system will be very slow before OOM is triggered. During this period, user will
have bad experience.

So LMK need to work effectivly to let system running smoothly, as user experience
is very important for android system.

Thanks.

  reply	other threads:[~2016-06-22  4:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  5:30 [PATCH 1/3] staging: lowmemorykiller: change lowmem_adj to lowmem_score_adj Ganesh Mahendran
2016-06-21  5:30 ` [PATCH 2/3] staging: lowmemorykiller: count anon pages only when we have swap devices Ganesh Mahendran
2016-06-21 20:22   ` David Rientjes
2016-06-22  3:27     ` Ganesh Mahendran
2016-06-23  8:42       ` Sergey Senozhatsky
2016-07-01  2:02         ` Ganesh Mahendran
2016-06-21  5:30 ` [PATCH 3/3] staging: lowmemorykiller: select the task with maximum rss to kill Ganesh Mahendran
2016-06-21 20:14   ` David Rientjes
2016-06-22  4:44     ` Ganesh Mahendran [this message]
2016-06-21 20:27 ` [PATCH 1/3] staging: lowmemorykiller: change lowmem_adj to lowmem_score_adj David Rientjes
2016-06-22  3:10   ` Ganesh Mahendran

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=20160622044448.GC5683@leo-test \
    --to=opensource.ganesh@gmail.com \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riandrews@android.com \
    --cc=rientjes@google.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