linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Oleg Nesterov <oleg@redhat.com>, Rik van Riel <riel@redhat.com>,
	linux-mm@kvack.org
Subject: Re: [patch v2 2/2] oom: kill all threads sharing oom killed task's mm
Date: Fri, 20 Aug 2010 02:05:01 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1008200159530.24154@chino.kir.corp.google.com> (raw)
In-Reply-To: <20100820091004.5FE4.A69D9226@jp.fujitsu.com>

On Fri, 20 Aug 2010, KOSAKI Motohiro wrote:

> > > Why don't you use pthread library? Is there any good reason? That said,
> > > If you are trying to optimize neither thread nor vfork case, I'm not charmed
> > > this because 99.99% user don't use it. but even though every user will get 
> > > performance degression. Can you please consider typical use case optimization?
> > > 
> > 
> > Non-NPTL threaded applications exist in the wild, and I can't change that.  
> 
> Which application? If it is major opensource application, I think this one
> makes end user happy.
> 

Being a "major opensource application" is not the requirement to prevent a 
livelock in the kernel.  The livelock exists, we hit it all the time, and 
your change to remove this code from the oom killer caused a regression.

Unless you can guarantee that a thread holding mm->mmap_sem cannot loop in 
the page allocator, then we need a way for that allocation to succeed.

> > This mm->mmap_sem livelock is a problem for them, we've hit it internally 
> > (we're forced to carry this patch internally), and we aren't the only ones 
> > running at least some non-NPTL apps.  That's why this code existed in the 
> > oom killer for over eight years since the 2.4 kernel before you removed it 
> > based on the mempolicy policy of killing current, which has since been 
> > obsoleted.  Until CLONE_VM without CLONE_THREAD is prohibited entirely on 
> > Linux, this livelock can exist.
> 
> Or, can you eliminate O(n^2) thing? The cost is enough low, I don't oppose 
> this.
> 

Suggestions on improvements are welcome in the form of a patch.

> > Users who do not want the tasklist scan here, which only iterates over 
> > thread group leaders and not threads, can enable 
> > /proc/sys/vm/oom_kill_allocating_task.  That's its whole purpose.  Other 
> > than that, the oom killer will never be the most efficient part of the 
> > kernel and doing for_each_process() is much less expensive than all the 
> > task_lock()s we take already.
> 
> No.
> Please don't forget typical end user don't use any kernel knob. kernel knob
> is not a way for developer excuse.
> 

Users who find tasklist scans with for_each_process() in the oom killer 
are a very, very special case and is typically only SGI.  They requested 
that the sysctl be added years ago to prevent the lengthy scan, so they 
are already protected.

Unless you can propose a different fix for the regression that you 
introduced with 8c5cd6f3 and fix the livelock, this type of check is 
mandatory.

--
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:[~2010-08-20  9:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17  1:15 [patch v2 1/2] oom: avoid killing a task if a thread sharing its mm cannot be killed David Rientjes
2010-08-17  1:16 ` [patch v2 2/2] oom: kill all threads sharing oom killed task's mm David Rientjes
2010-08-18  2:08   ` KAMEZAWA Hiroyuki
2010-08-19  5:31   ` KOSAKI Motohiro
2010-08-19  8:03     ` David Rientjes
2010-08-19  8:10       ` KOSAKI Motohiro
2010-08-19 11:17         ` KOSAKI Motohiro
2010-08-19 20:48         ` David Rientjes
2010-08-20  0:31           ` KOSAKI Motohiro
2010-08-20  9:05             ` David Rientjes [this message]
2010-08-18  2:07 ` [patch v2 1/2] oom: avoid killing a task if a thread sharing its mm cannot be killed KAMEZAWA Hiroyuki
2010-08-18  2:36   ` David Rientjes
2010-08-18  3:11     ` KAMEZAWA Hiroyuki
2010-08-18  3:43       ` David Rientjes
2010-08-18  3:55         ` KAMEZAWA Hiroyuki
2010-08-18  8:11           ` David Rientjes

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=alpine.DEB.2.00.1008200159530.24154@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=oleg@redhat.com \
    --cc=riel@redhat.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