From: Oleg Nesterov <oleg@tv-sign.ru>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
richard kennedy <richard@rsk.demon.co.uk>,
linux-kernel@vger.kernel.org
Subject: Re: Processes spinning forever, apparently in lock_timer_base()?
Date: Sat, 4 Aug 2007 00:14:58 +0400 [thread overview]
Message-ID: <20070803201458.GA181@tv-sign.ru> (raw)
Chuck Ebbert wrote:
>
> Looks like the same problem with spinlock unfairness we've seen
> elsewhere: it seems to be looping here? Or is everyone stuck
> just waiting for writeout?
>
> lock_timer_base():
> for (;;) {
> tvec_base_t *prelock_base = timer->base;
> base = tbase_get_base(prelock_base);
> if (likely(base != NULL)) {
> spin_lock_irqsave(&base->lock, *flags);
> if (likely(prelock_base == timer->base))
> return base;
> /* The timer has migrated to another CPU */
> spin_unlock_irqrestore(&base->lock, *flags);
> }
> cpu_relax();
> }
I don't think there is an unfairness problem. We are looping only
if timer->base changes in between. IOW, there is no "lock + unlock
+ lock(same_lock)" here, we take another lock on each iteration.
And:
> [<c0407208>] do_IRQ+0xbd/0xd1
> [<c042ffcb>] lock_timer_base+0x19/0x35
> [<c04300df>] __mod_timer+0x9a/0xa4
> [<c060bb55>] schedule_timeout+0x70/0x8f
>
> ...
>
> [<c0407208>] do_IRQ+0xbd/0xd1
> [<c042ffcb>] lock_timer_base+0x19/0x35
> [<c04300df>] __mod_timer+0x9a/0xa4
> [<c060bb55>] schedule_timeout+0x70/0x8f
>
> ...
>
> [<c042ffcb>] lock_timer_base+0x19/0x35
> [<c04300df>] __mod_timer+0x9a/0xa4
> [<c060bb55>] schedule_timeout+0x70/0x8f
All traces start from schedule_timeout()->mod_timer(). This timer
is local, nobody can see it, its ->base can't be NULL or changed.
This means that lock_timer_base() can't loop, but can't take the
tvec_t_base_s.lock. But in that case the trace should different,
strange.
Oleg.
next reply other threads:[~2007-08-03 20:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-03 20:14 Oleg Nesterov [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-08-01 22:39 Processes spinning forever, apparently in lock_timer_base()? Chuck Ebbert
2007-08-02 10:37 ` richard kennedy
2007-08-03 18:34 ` Andrew Morton
2007-08-04 8:44 ` Matthias Hensler
2007-08-09 9:59 ` Matthias Hensler
2007-08-09 16:55 ` Andrew Morton
2007-08-09 17:37 ` Matthias Hensler
2007-09-20 21:07 ` Chuck Ebbert
2007-09-20 21:29 ` Andrew Morton
2007-09-20 22:04 ` Chuck Ebbert
2007-09-20 22:36 ` Andrew Morton
2007-09-20 22:44 ` Chuck Ebbert
2007-09-21 8:08 ` Matthias Hensler
2007-09-21 8:22 ` Andrew Morton
2007-09-21 10:25 ` richard kennedy
2007-09-21 10:33 ` Andrew Morton
2007-09-21 10:47 ` richard kennedy
2007-09-22 12:08 ` richard kennedy
2007-09-21 9:39 ` Andy Whitcroft
2007-09-21 15:43 ` Chuck Ebbert
2007-09-21 15:58 ` Hugh Dickins
2007-09-21 16:16 ` Chuck Ebbert
2007-09-21 18:54 ` Peter Zijlstra
2007-10-29 18:55 ` Bruno Wolff III
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=20070803201458.GA181@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@linux-foundation.org \
--cc=cebbert@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@rsk.demon.co.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.