From: Linus Torvalds <torvalds@linux-foundation.org>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: "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>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: [BUG] kernel BUG at mm/vmacache.c:85!
Date: Mon, 28 Apr 2014 15:58:02 -0700 [thread overview]
Message-ID: <CA+55aFz0jrk-O9gq9VQrFBeWTpLt_5zPt9RsJO9htrqh+nKTfA@mail.gmail.com> (raw)
In-Reply-To: <1398724754.25549.35.camel@buesod1.americas.hpqcorp.net>
On Mon, Apr 28, 2014 at 3:39 PM, Davidlohr Bueso <davidlohr@hp.com> wrote:
>
> Is this perhaps a KVM guest? fwiw I see CONFIG_KVM_ASYNC_PF=y which is a
> user of use_mm().
So I tried to look through these guys, and that was one of the ones I looked at.
It's using use_mm(), but it's only called through schedule_work().
Which *should* mean that it's in a kernel thread and
vmacache_valid_mm() will not be true.
HOWEVER.
The whole "we don't use the vma cache on kernel threads" does seem to
be a pretty fragile approach to the whole workqueue etc issue. I think
we always use a kernel thread for workqueue entries, but at the same
time I'm not 100% convinced that we should *rely* on that kind of
behavior. I don't think that it's necessarily fundamentally guaranteed
conceptually - I could see, for example, some user of "flush_work()"
deciding to run the work *synchronously* within the context of the
process that does the flushing.
Now, I don't think we actually do that, but my point is that I think
it's a bit dangerous to just say "only kernel threads do use_mm(), and
work entries are always done by kernel threads, so let's disable vma
caching for kernel threads". It may be *true*, but it's a very
indirect kind of true.
That's why I think we might be better off saying "let's just
invalidate the vmacache in use_mm(), and not care about who does it".
No subtle indirect logic about why the caching is safe in one context
but not another.
But quite frankly, I grepped for things that set "tsk->mm", and apart
from clearing it on exit, the only uses I found was copy_mm() (which
does that vmacache_flush()) and use_mm(). And all the use_mm() cases
_seem_ to be in kernel threads, and that first BUG_ON() didn't have a
very complex call chain at all, just a regular page fault from udevd.
So it might just be some really nasty corruption totally unrelated to
the vmacache, and those preceding odd udevd-work and kdump faults
could be related.
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>
next prev parent reply other threads:[~2014-04-28 22:58 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 [this message]
2014-04-28 23:11 ` Andrew Morton
2014-04-28 23:57 ` Linus Torvalds
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+55aFz0jrk-O9gq9VQrFBeWTpLt_5zPt9RsJO9htrqh+nKTfA@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