mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Christophe Saout <christophe@saout.de>
Cc: kosaki.motohiro@jp.fujitsu.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Nick Piggin <npiggin@suse.de>,
	linux-kernel@vger.kernel.org,
	Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Subject: Re: [patch 36/51] revert "mm: vmalloc use mutex for purge"
Date: Mon, 26 Jan 2009 22:57:22 +0900 (JST)	[thread overview]
Message-ID: <20090127163443.1BEC.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <1232123976.4946.18.camel@leto.intern.saout.de>

(cc to Lee Schermerhorn)

sorry for late reply.
I returned from lca yesterday.

> > > From: Dean Roe <roe@sgi.com>
> > > Subject: Prevent NULL pointer deref in grab_swap_token
> > > References: 159260
> > > 
> > > grab_swap_token() assumes that the current process has an mm struct,
> > > which is not true for kernel threads invoking get_user_pages().  Since
> > > this should be extremely rare, just return from grab_swap_token()
> > > without doing anything.
> > > 
> > > Signed-off-by: Dean Roe <roe@sgi.com>
> > > Acked-by: mason@suse.de
> > > Acked-by: okir@suse.de
> > > 
> > > 
> > >  mm/thrash.c |    3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > --- a/mm/thrash.c
> > > +++ b/mm/thrash.c
> > > @@ -31,6 +31,9 @@ void grab_swap_token(void)
> > >  	int current_interval;
> > >  
> > >  	global_faults++;
> > > +	if (current->mm == NULL)
> > > +		return;
> > > +
> > >  
> > >  	current_interval = global_faults - current->mm->faultstamp;
> > >  
> > 
> > Confused.  Why was there a random, seemingly-unrelated patch at the end
> > of this email?
> 
> This is a patch I also saw while trying to understand the problem with
> Xen and UNEVICTABLE_LRU.  This patch is actually in the SuSE kernel and
> claims to have something to do with kernel threads.
> 
> However for Xen, the problem is not a kernel threads, it's a regular
> process thread (reiserfsck in to be specific, which mlockall's itself
> into memory) and using this patch makes the null pointer deref Oops go
> away, but still leaves scary messages in the log (a bunch of WARN_ON's).

hm, I guess you test both UNEVICTABLE_LRU on/off and this problem 
happend only if CONFIG_UNEVICTABLE_LRU=y, right?

if so, I really wonder this result.
above mean the page have both following two condition.

 - vma of the page have VM_LOCKED flag.
 - pte of the page is NOT present

I can't imazine how to reproduce it.
Could you please tell me how to reproduce? (sorry, I don't know xen at all)

and, Can you post your bunch of WARN_ON list and .config?



> I fail to understand why __get_user_pages of mlock'ed pages wants to go
> into swap code, but then I'm not an expert in Linux mm.  Maybe this
> happens because current->mm is already down and some code gets confused.
> While googling around I found a comment that during mm teardown, the
> kernel shall better not try to access user pages, I can't remember what
> exactly it was about.






  reply	other threads:[~2009-01-26 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200901152151.n0FLpFvI009218@imap1.linux-foundation.org>
     [not found] ` <20090116025531.GI17810@wotan.suse.de>
     [not found]   ` <1232098736.4808.17.camel@leto.intern.saout.de>
2009-01-16  9:43     ` Nick Piggin
2009-01-16 16:13       ` Andrew Morton
2009-01-16 16:39         ` Christophe Saout
2009-01-26 13:57           ` KOSAKI Motohiro [this message]
2009-01-26 15:07             ` Lee Schermerhorn
2009-01-27 11:27               ` KOSAKI Motohiro

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=20090127163443.1BEC.KOSAKI.MOTOHIRO@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=christophe@saout.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    /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

all inboxes | Powered by JetHome®