public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: "Van Maren, Kevin" <kevin.vanmaren@unisys.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'linux-ia64@linuxia64.org'" <linux-ia64@linuxia64.org>,
	"'hpl@cs.utk.edu'" <hpl@cs.utk.edu>
Subject: Re: [Linux-ia64] Linux kernel deadlock caused by spinlock bug
Date: Mon, 29 Jul 2002 21:46:56 +0100	[thread overview]
Message-ID: <20020729214656.B3317@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <3FAD1088D4556046AEC48D80B47B478C0101F3AD@usslc-exch-4.slc.unisys.com>; from kevin.vanmaren@unisys.com on Mon, Jul 29, 2002 at 03:37:17PM -0500

On Mon, Jul 29, 2002 at 03:37:17PM -0500, Van Maren, Kevin wrote:
> I changed the code to allow the writer bit to remain set even if
> there is a reader.  By only allowing a single processor to set
> the writer bit, I don't have to worry about pending writers starving
> out readers.  The potential writer that was able to set the writer bit
> gains ownership of the lock when the current readers finish.  Since
> the retry for read_lock does not keep trying to increment the reader
> count, there are no other required changes.

however, this is broken.  linux relies on being able to do

read_lock(x);
func()
  -> func()
       -> func()
            -> read_lock(x);

if a writer comes between those two read locks, you're toast.

i suspect the right answer for the contention you're seeing is an improved
get_timeofday which is lockless.

-- 
Revolutions do not require corporate support.

  reply	other threads:[~2002-07-29 20:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-29 20:37 Linux kernel deadlock caused by spinlock bug Van Maren, Kevin
2002-07-29 20:46 ` Matthew Wilcox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-07-29 21:05 [Linux-ia64] " Van Maren, Kevin
2002-07-29 21:18 ` Matthew Wilcox
2002-07-30 15:58 ` Russell Lewis
2002-07-30 16:56   ` Richard B. Johnson
2002-07-30 17:02     ` Russell Lewis
2002-07-30 17:14       ` Richard B. Johnson
2002-07-30 22:48     ` Sean Griffin
2002-07-31 17:37       ` Russell Lewis
2002-07-29 21:29 Van Maren, Kevin
2002-07-29 21:48 ` David Mosberger
     [not found] <3FAD1088D4556046AEC48D80B47B478C0101F3AE@usslc-exch-4.slc.unisys.com.suse.lists.linux.kernel>
2002-07-30 13:32 ` Andi Kleen
2002-07-30 16:27   ` William Lee Irwin III
2002-07-30 17:06 Van Maren, Kevin
2002-07-30 17:44 ` William Lee Irwin III
2002-07-30 21:15 Van Maren, Kevin

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=20020729214656.B3317@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --cc=hpl@cs.utk.edu \
    --cc=kevin.vanmaren@unisys.com \
    --cc=linux-ia64@linuxia64.org \
    --cc=linux-kernel@vger.kernel.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