From: Andrew Morton <akpm@osdl.org>
To: Hugh Dickins <hugh@veritas.com>
Cc: mingo@elte.hu, nickpiggin@yahoo.com.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] break_lock forever broken
Date: Fri, 11 Mar 2005 20:34:27 -0800 [thread overview]
Message-ID: <20050311203427.052f2b1b.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0503111847450.9320@goblin.wat.veritas.com>
Hugh Dickins <hugh@veritas.com> wrote:
>
> lock->break_lock is set when a lock is contended, but cleared only in
> cond_resched_lock. Users of need_lockbreak (journal_commit_transaction,
> copy_pte_range, unmap_vmas) don't necessarily use cond_resched_lock on it.
>
> So, if the lock has been contended at some time in the past, break_lock
> remains set thereafter, and the fastpath keeps dropping lock unnecessarily.
> Hanging the system if you make a change like I did, forever restarting a
> loop before making any progress.
>
> Should it be cleared when contending to lock, just the other side of the
> cpu_relax loop? No, that loop is preemptible, we don't want break_lock
> set all the while the contender has been preempted. It should be cleared
> when we unlock - any remaining contenders will quickly set it again.
>
> So cond_resched_lock's spin_unlock will clear it, no need for it to do
> that; and use need_lockbreak there too, preferring optimizer to #ifdefs.
>
> Or would you prefer the few need_lockbreak users to clear it in advance?
> Less overhead, more errorprone.
This patch causes a CONFIG_PREEMPT=y, CONFIG_PREEMPT_BKL=y,
CONFIG_DEBUG_PREEMPT=y kernel on a ppc64 G5 to hang immediately after
displaying the penguins, but apparently not before having set the hardware
clock backwards 101 years.
After having carefully reviewed the above description and having decided
that these effects were not a part of the patch's design intent I have
temporarily set it aside, thanks.
next prev parent reply other threads:[~2005-03-12 4:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-11 18:51 Hugh Dickins
2005-03-12 4:34 ` Andrew Morton [this message]
2005-03-12 23:20 ` Hugh Dickins
2005-03-13 8:23 ` Arjan van de Ven
2005-03-13 9:35 ` Hugh Dickins
2005-03-13 13:52 ` Arjan van de Ven
2005-03-14 5:01 ` Nick Piggin
2005-03-14 7:02 ` Ingo Molnar
2005-03-14 8:03 ` Nick Piggin
2005-03-14 8:14 ` Ingo Molnar
2005-03-14 8:24 ` Nick Piggin
2005-03-14 8:34 ` Arjan van de Ven
2005-03-14 8:43 ` Nick Piggin
2005-03-14 10:46 ` Ingo Molnar
2005-03-14 11:01 ` Nick Piggin
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=20050311203427.052f2b1b.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
/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®