All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus-list@drzeus.cx>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: How to cleanly shut down a block device
Date: Tue, 14 Nov 2006 12:52:14 +0100	[thread overview]
Message-ID: <4559ADEE.90209@drzeus.cx> (raw)
In-Reply-To: <20061114114120.GC22178@kernel.dk>

Jens Axboe wrote:
> I think you are making this way too complicated, it's actually pretty
> simple: you call blk_put_queue() or blk_cleanup_queue() (same thing)
> when _you_ drop your reference to the queue. That's just normal cleanup.
> When a device goes away, you make sure that you know about this. I said
> that SCSI clears q->queuedata, so it knows that when ->request_fn is
> invoked with a NULL q->queuedata (where it stores the device pointer),
> the device is not there and the request should just be flushed to
> heaven.
>   

What about the gendisk object? Since I assigned the queue pointer to it,
it didn't naturally get a chance to increase the reference count. When
can I safely drop my reference without the gendisk getting upset?

> Don't make any assumptions about when request_fn will be called or not.
> That's bound to be racy anyway.
>
>   

Things get a bit muddy by the fact that the mmc layer has a thread that
handles the queue. So I guess we need to have a way to shut down that
thread, but still be able to throw away any stray requests from the
block layer?

Rgds

-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org


  reply	other threads:[~2006-11-14 11:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14  7:02 How to cleanly shut down a block device Pierre Ossman
2006-11-14  7:56 ` Jens Axboe
2006-11-14  8:15   ` Pierre Ossman
2006-11-14  8:45     ` Jens Axboe
2006-11-14  8:54       ` Pierre Ossman
2006-11-14 10:24         ` Jens Axboe
2006-11-14 10:48         ` Russell King
2006-11-14 11:33           ` Pierre Ossman
2006-11-14 11:41             ` Jens Axboe
2006-11-14 11:52               ` Pierre Ossman [this message]
2006-11-14 14:34               ` Pierre Ossman
2006-11-14 20:48                 ` Pierre Ossman
2006-11-23 21:03                 ` Russell King
2006-11-23 21:19                   ` Pierre Ossman
2006-11-14 11:48             ` Russell King

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=4559ADEE.90209@drzeus.cx \
    --to=drzeus-list@drzeus.cx \
    --cc=jens.axboe@oracle.com \
    --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 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.