linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <guro@fb.com>,
	David Rientjes <rientjes@google.com>,
	Shakeel Butt <shakeelb@google.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm, oom: simplify task's refcount handling
Date: Fri, 26 Jul 2019 12:17:26 +0900	[thread overview]
Message-ID: <542908c5-56a0-2fbc-355d-d41c2653c06d@i-love.sakura.ne.jp> (raw)
In-Reply-To: <20190724080726.GA5584@dhcp22.suse.cz>

On 2019/07/24 17:07, Michal Hocko wrote:
> On Wed 24-07-19 16:37:35, Tetsuo Handa wrote:
>> On 2019/07/24 15:41, Michal Hocko wrote:
> [...]
>>> That being said, I do not think this patch gives any improvement.
>>>
>>
>> This patch avoids RCU during select_bad_process().
> 
> It just shifts where the RCU is taken. Do you have any numbers to show
> that this is an improvement? Basically the only potentially expensive
> thing down the oom_evaluate_task that I can see is the task_lock but I
> am not aware of a single report that this would be a contributor for RCU
> stalls. I can be proven wrong but 
> 

I don't have numbers (nor intent to show numbers). What I said is "we can
do reschedulable things from select_bad_process() if future development
found that it is nice to do, for oom_evaluate_task() is called without RCU".
For now just cond_resched() would be added into select_bad_process() iteration.

>> This patch allows
>> possibility of doing reschedulable things there; e.g. directly reaping
>> only a portion of OOM victim's memory rather than wasting CPU resource
>> by spinning until MMF_OOM_SKIP is set by the OOM reaper.
> 
> We have been through direct oom reaping before and I haven't changed my
> possition there. It is just too tricky to be worth it.
> 

Not limited to direct OOM reaping. Anything that future development would
find.

Anyway, traversing only once (by this patch) allows showing consistent snapshot
of OOM victim candidates. In other words, this patch makes sure that OOM victim
candidates shown by dump_tasks() are what select_bad_process() has evaluated, for
you said that the main purpose of the listing is to double check the list to
understand the OOM victim selection. This patch removes race window of adding
or removing OOM victim candidates.


      reply	other threads:[~2019-07-26  3:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24  3:54 Tetsuo Handa
2019-07-24  6:41 ` Michal Hocko
2019-07-24  7:37   ` Tetsuo Handa
2019-07-24  8:07     ` Michal Hocko
2019-07-26  3:17       ` Tetsuo Handa [this message]

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=542908c5-56a0-2fbc-355d-d41c2653c06d@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=shakeelb@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