mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: scameron@beardog.cca.cpqcorp.net
Cc: linux-kernel@vger.kernel.org, mike.miller@hp.com,
	mikem@beardog.cca.cpqcorp.net
Subject: Re: [patch] cciss: Fix race between disk-adding code and interrupt handler
Date: Mon, 14 Apr 2008 19:37:20 +0200	[thread overview]
Message-ID: <20080414173720.GQ12774@kernel.dk> (raw)
In-Reply-To: <20080414172716.GM16584@beardog.cca.cpqcorp.net>

On Mon, Apr 14 2008, scameron@beardog.cca.cpqcorp.net wrote:
> 
> 
> > On Mon, Apr 14 2008, scameron@beardog.cca.cpqcorp.net wrote:
> > > 
> > > 
> > > Fix race condition between cciss_init_one(), cciss_update_drive_info(),
> > > and cciss_check_queues().  cciss_softirq_done would try to start
> > > queues which were not quite ready to be started, as its checks for
> > > readiness were not sufficiently synchronized with the queue initializing
> > > code in cciss_init_one and cciss_update_drive_info.  Slow cpu and
> > > large numbers of logical drives seem to make the race more likely 
> > > to cause a problem.
> > 
> > Hmm, this seems backwards to me.  cciss_softirq_done() isn't going to
> > start the queues, until an irq has triggered for instance. Why isn't the
> > init properly ordered instead of band-aiding around this with a
> > 'queue_ready' variable?
> >
> 
> Each call to add_disk() will trigger some interrupts, 
> and earlier added disks may cause the queues of later,
> not-yet-completely added disks to be started.
> 
> I suppose the init routine might be reorganized to initialize all
> the queues, then have second loop call add_disk() for all
> of them.  Is that what you had in mind by "properly ordered?"

Yep precisely, don't call add_disk() until everything is set up.

> Disks may be added at run time though, and I think this tears
> down all but the first disk, and re-adds them all, if I remember
> right, so there is some complication there to think about.

Well, other drivers manage quite fine without resorting to work-arounds
:-)

-- 
Jens Axboe


  reply	other threads:[~2008-04-14 17:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14 14:20 scameron
2008-04-14 17:05 ` Jens Axboe
2008-04-14 17:27   ` scameron
2008-04-14 17:37     ` Jens Axboe [this message]
2008-04-14 17:45       ` scameron
2008-04-14 17:52         ` Jens Axboe
2008-04-16 18:59           ` scameron
2008-04-16 19:03             ` Miller, Mike (OS Dev)
2008-04-17 11:16             ` Jens Axboe
2008-04-16 19:00           ` [patch] cciss: fix warning oops on rmmod of driver scameron
2008-04-16 19:18             ` Miller, Mike (OS Dev)
2008-04-17 11:15             ` 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=20080414173720.GQ12774@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.miller@hp.com \
    --cc=mikem@beardog.cca.cpqcorp.net \
    --cc=scameron@beardog.cca.cpqcorp.net \
    /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

Powered by JetHome