linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Michal Hocko <mhocko@suse.com>,
	Roman Gushchin <guro@fb.com>, Shakeel Butt <shakeelb@google.com>
Subject: Re: [PATCH] mm, oom: avoid printk() iteration under RCU
Date: Wed, 24 Jul 2019 10:47:26 +0900	[thread overview]
Message-ID: <f4b00a4d-3f0d-fc3a-cef8-62a20ec39ea3@i-love.sakura.ne.jp> (raw)
In-Reply-To: <20190723161412.df47e0c9ecd8bc28d3183604@linux-foundation.org>

On 2019/07/24 8:14, Andrew Morton wrote:
> On Wed, 17 Jul 2019 19:55:01 +0900 Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:
> 
>> Currently dump_tasks() might call printk() for many thousands times under
>> RCU, which might take many minutes for slow consoles. Therefore, split
>> dump_tasks() into three stages; take a snapshot of possible OOM victim
>> candidates under RCU, dump the snapshot from reschedulable context, and
>> destroy the snapshot.
>>
>> In a future patch, the first stage would be moved to select_bad_process()
>> and the third stage would be moved to after oom_kill_process(), and will
>> simplify refcount handling.
> 
> Look straightforward enough.

Thanks.

> 
>>
>> ...
>>
>>  static void dump_tasks(struct oom_control *oc)
>>  {
>> -	pr_info("Tasks state (memory values in pages):\n");
>> -	pr_info("[  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name\n");
>> +	static LIST_HEAD(list);
> 
> I don't think this needs to be static?

Well, the OOM killer is serialized by oom_lock mutex.
Thus, I guess we should reduce stack usage where reasonable.
For now you can drop this "static" if you want. But this
variable will be after all moved to outside of this function
by a future patch...

> 
>> +	struct task_struct *p;
>> +	struct task_struct *t;
>>  


      reply	other threads:[~2019-07-24  2:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 10:55 Tetsuo Handa
2019-07-18  0:31 ` Shakeel Butt
2019-07-18 10:22   ` Tetsuo Handa
2019-07-18  8:30 ` Michal Hocko
2019-07-18 13:50   ` Tetsuo Handa
2019-07-18 14:02     ` Michal Hocko
2019-07-20 11:29       ` Tetsuo Handa
     [not found]         ` <20190920171042.8d970f9fc6f360de9b20ebbe@linux-foundation.org>
2019-09-21 20:30           ` Michal Hocko
     [not found]             ` <11c42f07-74d1-d4be-99bc-ca50d7c0ec71@i-love.sakura.ne.jp>
2019-09-22  6:20               ` Michal Hocko
     [not found]                 ` <e4fac741-7dbc-41a1-7b9e-249415fba612@i-love.sakura.ne.jp>
2019-09-23  8:23                   ` Michal Hocko
2019-07-23 23:14 ` Andrew Morton
2019-07-24  1:47   ` 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=f4b00a4d-3f0d-fc3a-cef8-62a20ec39ea3@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=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