mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter T. Breuer" <ptb@it.uc3m.es>
To: "linux kernel" <linux-kernel@vger.kernel.org>
Cc: axboe@suse.de
Subject: Re: what's the semaphore in requests for?
Date: Sat, 4 Aug 2001 01:37:16 +0200 (MET DST)	[thread overview]
Message-ID: <200108032337.f73NbHO02352@oboe.it.uc3m.es> (raw)
In-Reply-To: From (env: ptb) at "Jul 31, 2001 08:45:53 pm"

OK, It begins to look to me as though something takes the io_request
spinlock and then sleeps. I thought it was me, but now I'm not so sure.

New readers, set scene here:

"ptb wrote:"
> > > > 2 processors + 2 userspace helper daemon on device = bug  (lockup)
> > > > 1 processors + 1 userspace helper daemon on device = no bug 


And I now believe the explanation is as follows:

   cpu1                             cpu2

   ioctl takes private spinlock     something takes io_request spinlock
   IDE interrupt takes io spinlock  schedule
   deadlock                         dev req fn tries for private spinlock
				    deadlock

This deadlock relies on 

 1) me not protecting against interrupts in my spinlocks (reasonable,
 since my spinlock is not taken from an interrupt).
 2) something taking the io spinlock and sleeping while it's held.

I thought at first that (2) was me, but it may not be so.

I surmised that when I held the io_request spinlock that the
end_that_request_first function may have been sleeping occasionally ..
but I moved the spinlock to cover only end_that_request_last and I still
see deadlocks when (1) is true.  When (1) is not true, no deadlock,
wherever I put the spinlock in end_request. So the indication is that
it's not (only) me who's taking the io_request spinlock and then
sleeping.

Does anyone have any comment? I am running  2.4.6 with the latest
aic7xxx patches.

My grounds for believing in the scenario above are that when a
lockup occurs, in the kernel debugger I see both my helper daemon
threads scheduled, and a userspace function deadlocked in IDE_do_irq in
a spinlock, and one cpu not responding to NMI. Since I don't schedule
or sleep when holding my spinlock, my spinlock cannot be held at this
point, and the deadlock must be against another spinlock. That must be
the io_request spinlock (it's the only other spinlock in my code too).
And the deadlock only happens when I don't mask interrupts when taking
my spinlock, so it must happen in an interrupt manager .. and it's
clearly in the IDE manager, and I believe it's against the io_request
spinlock. Also the deadlock must be a cross-cpu deadlock, as it only
happened when I ran two helper client daemons, not one.

The lockup happens about 1 in every 250000 requests.

My SMP machine is already slightly unstable under 2.4 kernels, about
one spontaneous reboot per four to seven days.

Peter

             reply	other threads:[~2001-08-03 23:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-03 23:37 Peter T. Breuer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-31 18:45 Peter T. Breuer
2001-07-28 22:34 Peter T. Breuer
2001-07-30  8:24 ` Jens Axboe
2001-07-30 14:14   ` Peter T. Breuer
2001-07-23 23:39 Peter T. Breuer
2001-07-24  7:44 ` Jens Axboe

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=200108032337.f73NbHO02352@oboe.it.uc3m.es \
    --to=ptb@it.uc3m.es \
    --cc=axboe@suse.de \
    --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

all inboxes | Powered by JetHome®