linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Davidlohr Bueso <davidlohr@hp.com>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	Linux MM <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rik van Riel <riel@redhat.com>,
	Michel Lespinasse <walken@google.com>,
	Hugh Dickins <hughd@google.com>, Oleg Nesterov <oleg@redhat.com>
Subject: Re: [BUG] kernel BUG at mm/vmacache.c:85!
Date: Mon, 28 Apr 2014 16:57:04 -0700	[thread overview]
Message-ID: <CA+55aFwLSW3V76Y_O37Y8r_yaKQ+y0VMk=6SEEBpeFfGzsJUKA@mail.gmail.com> (raw)
In-Reply-To: <20140428161120.4cad719dc321e3c837db3fd6@linux-foundation.org>

On Mon, Apr 28, 2014 at 4:11 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> unuse_mm() leaves current->mm at NULL so we'd hear about it pretty
> quickly if a user task was running use_mm/unuse_mm.

Yes.

> I think so.  Maybe it's time to cook up a debug patch for Srivatsa to
> use?  Dump the vma cache when the bug hits, or wire up some trace
> points.  Or perhaps plain old printks - it seems to be happening pretty
> early in boot.

Well, I think Srivatsa has only seen it once, and wasn't able to
reproduce it, so we'd have to make it happen more first.

> Are there additional sanity checks we can perform at cache addition
> time?

I wouldn't really expect it to happen at cache addition time, since
that's really quite simple. There's only one caller of
vmacache_update(), namely find_vma(). And vmacache_update() does the
same sanity check that vmacache lookup does (ie check that the
passed-on mm is the current thread mm, and that we're not a kernel
thread).

I'd be more inclined to think it's a missing invalidate, but I can
only think of two reasons to invalidate:

 - the vma itself went away from the mm, got free'd/reused, and so
vm_mm changes..

   But then we'd have to remove it from the rb-tree, and both callers
of vma_rb_erase() do a vmacache_invalidate()

 - the mm of a thread changed

   This is exec, use_mm(), and fork() (and fork really only just
because we copy the vmacache).

   exec and fork do that "vmacache_flush(tsk)", which is why I was
looking at use_mm().

So it all looks sane. Which only means that I must obviously be
missing some case. Which case am I missing?

                  Linus

--
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:[~2014-04-28 23:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28 19:18 Srivatsa S. Bhat
2014-04-28 19:20 ` Srivatsa S. Bhat
2014-04-28 21:20 ` Linus Torvalds
2014-04-28 21:55   ` Linus Torvalds
2014-04-28 22:05     ` Hugh Dickins
2014-04-28 22:14       ` Davidlohr Bueso
2014-04-28 22:25         ` Linus Torvalds
2014-04-29  9:59           ` Srivatsa S. Bhat
2014-04-30 19:16             ` Srivatsa S. Bhat
2014-04-30 19:18               ` Srivatsa S. Bhat
2014-04-30 19:20                 ` Srivatsa S. Bhat
2014-04-30 20:26               ` Linus Torvalds
2014-05-01  3:56               ` Hugh Dickins
2014-04-28 22:39     ` Davidlohr Bueso
2014-04-28 22:58       ` Linus Torvalds
2014-04-28 23:11         ` Andrew Morton
2014-04-28 23:57           ` Linus Torvalds [this message]
2014-04-29  0:11             ` Davidlohr Bueso
2014-04-29 10:02               ` Srivatsa S. Bhat
2014-04-29 12:52                 ` [PATCH] vmacache: change vmacache_find() to always check ->vm_mm Oleg Nesterov
2014-04-29 13:09                   ` Srivatsa S. Bhat
2014-04-29 14:02                     ` Oleg Nesterov
2014-04-29 12:40               ` [BUG] kernel BUG at mm/vmacache.c:85! Oleg Nesterov
2014-04-29  8:02       ` Srivatsa S. Bhat
2014-04-29  7:59     ` Srivatsa S. Bhat
2014-04-29  0:00 ` Dave Jones
2014-04-29  8:21   ` Srivatsa S. Bhat

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='CA+55aFwLSW3V76Y_O37Y8r_yaKQ+y0VMk=6SEEBpeFfGzsJUKA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=davidlohr@hp.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oleg@redhat.com \
    --cc=riel@redhat.com \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox