From: Mike Snitzer <snitzer@redhat.com>
To: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Jens Axboe <jaxboe@fusionio.com>, unsik Kim <donari75@gmail.com>,
Martin Schwidefsky <mschwid2@linux.vnet.ibm.com>,
Heiko Carstens <heicars2@linux.vnet.ibm.com>
Subject: Re: Switching block device elevators
Date: Mon, 16 Aug 2010 11:44:43 -0400 [thread overview]
Message-ID: <20100816154443.GA9860@redhat.com> (raw)
In-Reply-To: <4C6950B3.8020702@linux.vnet.ibm.com>
On Mon, Aug 16 2010 at 10:52am -0400,
Peter Oberparleiter <oberpar@linux.vnet.ibm.com> wrote:
> After commit 1abec4fdbb142e3ccb6ce99832fae42129134a96, "block: make
> blk_init_free_list and elevator_init idempotent", we're seeing
> kernel panics in our s390 tape block device driver. The panic is
> triggered because our driver tries to replace the default elevator
> with a noop elevator by calling elevator_exit() directly followed by
> elevator_init().
Maybe we should look to export elevator_switch() -- rather than
confining its use to the sysfs interface.
> Since the commit, elevator_init() returns 0 if
> request_queue->elevator is non-null, even though it does not install
> a new elevator. As a result, the next access to the elevator finds a
> pointer to the old one which was already freed and a panic is
> triggered. Our current fix consists of setting the elevator pointer
> to NULL after elevator_exit().
elevator_exit() triggers a call, via kobj, to elevator_release() which
doesn't have access to the request_queue to reset it.
Unfortunately, commit 1abec4fdbb imposes that the elevator_exit() caller
must take care to reset q->elevator to NULL -- like dasd_alloc_queue()
does.
Though I suppose we _could_ pass request_queue to elevator_exit.
> There is at least one other driver where the problem currently
> exists (drivers/block/mg_disk.c, author on cc) and another s390
> driver where the problem was only accidentally fixed before 2.6.35.
> I'm wondering if there's a better solution (apart from not forcing
> an elevator) and would like to hear everyone's opinion on this
> matter. How about declaring elevator_switch() non-static, for
> example?
Right, updating drivers/block/mg_disk.c and drivers/s390/block/dasd.c to
use elevator_switch would work.
Mike
prev parent reply other threads:[~2010-08-16 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 14:52 [RFC] " Peter Oberparleiter
2010-08-16 15:44 ` Mike Snitzer [this message]
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=20100816154443.GA9860@redhat.com \
--to=snitzer@redhat.com \
--cc=donari75@gmail.com \
--cc=heicars2@linux.vnet.ibm.com \
--cc=jaxboe@fusionio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mschwid2@linux.vnet.ibm.com \
--cc=oberpar@linux.vnet.ibm.com \
/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