All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Michel Lespinasse <walken@google.com>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Divyesh Shah <dpshah@google.com>
Subject: Re: FYI: mmap_sem OOM patch
Date: Thu, 08 Jul 2010 11:35:17 +0200	[thread overview]
Message-ID: <1278581717.1900.20.camel@laptop> (raw)
In-Reply-To: <20100708182134.CD3F.A69D9226@jp.fujitsu.com>

On Thu, 2010-07-08 at 18:24 +0900, KOSAKI Motohiro wrote:
> > On Wed, 2010-07-07 at 16:11 -0700, Michel Lespinasse wrote:
> > 
> > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> > > index f627779..4b3a1c7 100644
> > > --- a/arch/x86/mm/fault.c
> > > +++ b/arch/x86/mm/fault.c
> > > @@ -1062,7 +1062,10 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
> > >  			bad_area_nosemaphore(regs, error_code, address);
> > >  			return;
> > >  		}
> > > -		down_read(&mm->mmap_sem);
> > > +		if (test_thread_flag(TIF_MEMDIE))
> > > +			down_read_unfair(&mm->mmap_sem);
> > > +		else
> > > +			down_read(&mm->mmap_sem);
> > >  	} else {
> > >  		/*
> > >  		 * The above down_read_trylock() might have succeeded in
> > 
> > I still think adding that _unfair interface is asking for trouble.
> 
> Can you please explain trouble that you worry? Why do we need to keep
> thread fairness when OOM case?

Just the whole concept of the unfair thing offends me ;-) I didn't
really look at the particular application in this case.



WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Michel Lespinasse <walken@google.com>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Divyesh Shah <dpshah@google.com>
Subject: Re: FYI: mmap_sem OOM patch
Date: Thu, 08 Jul 2010 11:35:17 +0200	[thread overview]
Message-ID: <1278581717.1900.20.camel@laptop> (raw)
In-Reply-To: <20100708182134.CD3F.A69D9226@jp.fujitsu.com>

On Thu, 2010-07-08 at 18:24 +0900, KOSAKI Motohiro wrote:
> > On Wed, 2010-07-07 at 16:11 -0700, Michel Lespinasse wrote:
> > 
> > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> > > index f627779..4b3a1c7 100644
> > > --- a/arch/x86/mm/fault.c
> > > +++ b/arch/x86/mm/fault.c
> > > @@ -1062,7 +1062,10 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
> > >  			bad_area_nosemaphore(regs, error_code, address);
> > >  			return;
> > >  		}
> > > -		down_read(&mm->mmap_sem);
> > > +		if (test_thread_flag(TIF_MEMDIE))
> > > +			down_read_unfair(&mm->mmap_sem);
> > > +		else
> > > +			down_read(&mm->mmap_sem);
> > >  	} else {
> > >  		/*
> > >  		 * The above down_read_trylock() might have succeeded in
> > 
> > I still think adding that _unfair interface is asking for trouble.
> 
> Can you please explain trouble that you worry? Why do we need to keep
> thread fairness when OOM case?

Just the whole concept of the unfair thing offends me ;-) I didn't
really look at the particular application in this case.


--
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-07-08  9:35 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 23:11 FYI: mmap_sem OOM patch Michel Lespinasse
2010-07-07 23:11 ` Michel Lespinasse
2010-07-08  0:16 ` KOSAKI Motohiro
2010-07-08  0:16   ` KOSAKI Motohiro
2010-07-08  1:11   ` KOSAKI Motohiro
2010-07-08  1:11     ` KOSAKI Motohiro
2010-07-08  9:02 ` Peter Zijlstra
2010-07-08  9:02   ` Peter Zijlstra
2010-07-08  9:24   ` KOSAKI Motohiro
2010-07-08  9:24     ` KOSAKI Motohiro
2010-07-08  9:35     ` Peter Zijlstra [this message]
2010-07-08  9:35       ` Peter Zijlstra
2010-07-08  9:51       ` KOSAKI Motohiro
2010-07-08  9:51         ` KOSAKI Motohiro
2010-07-08 10:30 ` Peter Zijlstra
2010-07-08 10:30   ` Peter Zijlstra
     [not found]   ` <AANLkTimLSnNot2byTWYuIHE8rhGLXbl1zKsQQhmci1Do@mail.gmail.com>
2010-07-08 10:49     ` Peter Zijlstra
2010-07-08 10:49       ` Peter Zijlstra
2010-07-08 10:57       ` KOSAKI Motohiro
2010-07-08 10:57         ` KOSAKI Motohiro
2010-07-08 11:02         ` Peter Zijlstra
2010-07-08 11:02           ` Peter Zijlstra
2010-07-08 11:06           ` KOSAKI Motohiro
2010-07-08 11:06             ` KOSAKI Motohiro
2010-07-08 11:23             ` Peter Zijlstra
2010-07-08 11:23               ` Peter Zijlstra
2010-07-09  1:31               ` KOSAKI Motohiro
2010-07-09  1:31                 ` KOSAKI Motohiro
2010-07-12 21:47             ` David Rientjes
2010-07-12 21:47               ` David Rientjes
2010-07-13  0:14               ` KOSAKI Motohiro
2010-07-13  0:14                 ` KOSAKI Motohiro
2010-07-13 21:08                 ` David Rientjes
2010-07-13 21:08                   ` David Rientjes
     [not found]         ` <AANLkTimArLPHrxHNEejiXKNYk9To6qsjglbgzyypXP-c@mail.gmail.com>
2010-07-08 12:43           ` Peter Zijlstra
2010-07-08 12:43             ` Peter Zijlstra

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=1278581717.1900.20.camel@laptop \
    --to=peterz@infradead.org \
    --cc=dpshah@google.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=walken@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.