From: Andrew Morton <akpm@osdl.org>
To: Sonny Rao <sonny@burdell.org>
Cc: linux-kernel@vger.kernel.org, anton@samba.org,
Ingo Molnar <mingo@elte.hu>,
Christoph Lameter <clameter@engr.sgi.com>
Subject: Re: BUG: spinlock lockup/wrong CPU/recursion -- when reading numa_maps on 2.6.17-rc1
Date: Mon, 17 Apr 2006 21:16:33 -0700 [thread overview]
Message-ID: <20060417211633.5ddfa0df.akpm@osdl.org> (raw)
In-Reply-To: <20060418000042.GA7376@kevlar.burdell.org>
Sonny Rao <sonny@burdell.org> wrote:
>
> Hi, I ran into a deadlock on 2.6.16-mm2 when I was running a
> multi-threaded application and was reading /proc/<pid>/numa_maps for
> the app.
>
> I recompiled with DEBUG_SPINLOCK and I can get various error messages
> on kernels ranging from 2.6.17-rc1 to serveral mm kernels including
> 2.6.16-mm[12] and 2.6.16-rc5-mm[23] (mm kernels before this seem to break
> a lot on my box)
>
> My current guess, based on my rudimentary understanding of the code, is
> that we are rescheduling while holding a spinlock in
> check_pte_range() which is called from show_numa_map() in mempolicy.c.
>
> Specifically, the gather_stats() function which is called inside
> check_pte_range() has a cond_resched() at the end. Maybe that line
> should be changed to cond_resched_lock() or should simply be removed.
>
> I'll try removing it and see what happens.
Yes, that's a bug and that cond_resched() needs to go.
We would have found this quite quickly if cond_resched() had a
might_sleep() in it. It really should have such a check, but we cannot do
this because in some configurations, might_sleep() calls cond_resched().
That was rather nasty or us. Ingo, can you think of a fix please?
This bug would also have been exposed as a scheduling-while-atomic warning
on those rare occasions when the cond_resched() actually calls schedule().
But that won't be enabled unless the NUMA guys actually test with all debug
options, as I repeatedly and apparently ineffectively have suggested.
next prev parent reply other threads:[~2006-04-18 4:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-18 0:00 Sonny Rao
2006-04-18 4:16 ` Andrew Morton [this message]
2006-04-18 18:07 ` Christoph Lameter
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=20060417211633.5ddfa0df.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=anton@samba.org \
--cc=clameter@engr.sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sonny@burdell.org \
/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®