linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Dyasly <dserrg@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Sha Zhengju <handai.szj@taobao.com>
Subject: Re: [PATCH] oom: add pending SIGKILL check for chosen victim
Date: Mon, 27 May 2013 19:49:15 +0400	[thread overview]
Message-ID: <20130527194915.493c1bed1de8f62e7e382164@gmail.com> (raw)
In-Reply-To: <20130502172022.GA8557@redhat.com>

Hi, Oleg

Adding thread_head into task_struct->signal would be the best solution imho.
This way list will be properly protected by rcu_read_lock(). But you called it
"really painful". I guess that's because all users of while_each_thread(g, t)
must be modified with 'g' pointing to the new thread_head. And I've counted
50 usages of while_each_thread() across the kernel.

Is this really that bad?

Regards.


On Thu, 2 May 2013 19:20:22 +0200
Oleg Nesterov <oleg@redhat.com> wrote:

> Just to let you know that this time I didn't forget about this problem ;)
> 
> On 04/25, Oleg Nesterov wrote:
> >
> > On 04/25, Sergey Dyasly wrote:
> > >
> > > But in general case there is still a race,
> >
> > Yes. Every while_each_thread() in oom-kill is wrong, and I am still not
> > sure what should/can we do. Will try to think more.
> 
> And I still can't find a simple/clean solution.
> 
> OK. I am starting to think we should probably switch to Plan B. We can add
> thread_head into task_struct->signal and convert while_each_thread() into
> list_for_each_rcu(). This should work, but this is really painful and I was
> going to avoid this as much as possible...
> 
> I'll try to do something once I return from vacation (May 9). Heh, See also
> http://marc.info/?l=linux-kernel&m=127688978121665 and the whole thread.
> 
> Oleg.
> 


-- 
Sergey Dyasly <dserrg@gmail.com>

--
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:[~2013-05-27 15:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 15:06 [PATCH] oom: add pending SIGKILL check for chosen victim Sergey Dyasly
2013-04-22 19:51 ` Michal Hocko
2013-04-23 15:26   ` dserrg
2013-04-23 15:56     ` Michal Hocko
2013-04-24 14:55       ` Oleg Nesterov
2013-04-24 15:22         ` Michal Hocko
2013-04-24 15:42           ` Oleg Nesterov
2013-04-24 19:33             ` Andrew Morton
2013-04-25 14:49               ` Oleg Nesterov
2013-04-25 15:41                 ` Sergey Dyasly
2013-04-25 16:22                   ` Oleg Nesterov
2013-05-02 17:20                     ` Oleg Nesterov
2013-05-27 15:49                       ` Sergey Dyasly [this message]
2013-05-27 16:16                         ` Oleg Nesterov

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=20130527194915.493c1bed1de8f62e7e382164@gmail.com \
    --to=dserrg@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=handai.szj@taobao.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=oleg@redhat.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;
as well as URLs for NNTP newsgroup(s).