From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
linux-mm <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Nick Piggin <npiggin@suse.de>
Subject: Re: kernel BUG at mm/slqb.c:1411!
Date: Thu, 14 May 2009 11:30:30 +0300 [thread overview]
Message-ID: <1242289830.21646.5.camel@penberg-laptop> (raw)
In-Reply-To: <20090513173758.2f3d2a50.minchan.kim@barrios-desktop>
On Wed, 2009-05-13 at 17:37 +0900, Minchan Kim wrote:
> On Wed, 13 May 2009 16:42:37 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
>
> Hmm. I don't know slqb well.
> So, It's just my guess.
>
> We surely increase l->nr_partial in __slab_alloc_page.
> In between l->nr_partial++ and call __cache_list_get_page, Who is decrease l->nr_partial again.
> After all, __cache_list_get_page return NULL and hit the VM_BUG_ON.
>
> Comment said :
>
> /* Protects nr_partial, nr_slabs, and partial */
> spinlock_t page_lock;
>
> As comment is right, We have to hold the l->page_lock ?
Makes sense. Nick? Motohiro-san, can you try this patch please?
Pekka
diff --git a/mm/slqb.c b/mm/slqb.c
index 5d0642f..29bb005 100644
--- a/mm/slqb.c
+++ b/mm/slqb.c
@@ -1399,12 +1399,14 @@ static noinline void *__slab_alloc_page(struct kmem_cache *s,
page->list = l;
spin_lock(&n->list_lock);
+ spin_lock(&l->page_lock);
l->nr_slabs++;
l->nr_partial++;
list_add(&page->lru, &l->partial);
slqb_stat_inc(l, ALLOC);
slqb_stat_inc(l, ALLOC_SLAB_NEW);
object = __cache_list_get_page(s, l);
+ spin_unlock(&l->page_lock);
spin_unlock(&n->list_lock);
#endif
}
--
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:[~2009-05-14 8:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 7:42 KOSAKI Motohiro
2009-05-13 8:37 ` Minchan Kim
2009-05-14 8:30 ` Pekka Enberg [this message]
2009-05-14 8:54 ` KOSAKI Motohiro
2009-05-14 23:38 ` KOSAKI Motohiro
2009-05-15 8:08 ` Pekka Enberg
2009-05-15 15:21 ` KOSAKI Motohiro
2009-05-25 11:12 ` Nick Piggin
2009-05-14 8:23 ` Pekka Enberg
2009-05-14 8: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=1242289830.21646.5.camel@penberg-laptop \
--to=penberg@cs.helsinki.fi \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--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