All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Clements <paul.clements@steeleye.com>,
	randy.dunlap@oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] NBD: make nbd default to deadline I/O scheduler
Date: Tue, 19 Feb 2008 10:19:43 +0100	[thread overview]
Message-ID: <20080219091943.GS23197@kernel.dk> (raw)
In-Reply-To: <20080218155001.97bf5976.akpm@linux-foundation.org>

On Mon, Feb 18 2008, Andrew Morton wrote:
> On Mon, 18 Feb 2008 19:16:30 +0100 Jens Axboe <jens.axboe@oracle.com> wrote:
> 
> > On Tue, Feb 12 2008, Andrew Morton wrote:
> > > On Sat, 09 Feb 2008 08:30:40 -0500
> > > Paul Clements <paul.clements@steeleye.com> wrote:
> > > 
> > > > +		old_e = disk->queue->elevator;
> > > > +		if (elevator_init(disk->queue, "deadline") == 0 ||
> > > > +			elevator_init(disk->queue, "noop") == 0) {
> > > > +				elevator_exit(old_e);
> > > > +		}
> > > >  	}
> > > 
> > > afacit elevator_init() will not trigger a request_module().  And you really
> > > do want to trigger the request_module() here.  Perhaps the block layer
> > > should provide a means of doing so?
> > 
> > Good point, I think elevator_get() should do that automatically. Does
> > this look sane?
> > 
> > diff --git a/block/elevator.c b/block/elevator.c
> > index bafbae0..88318c3 100644
> > --- a/block/elevator.c
> > +++ b/block/elevator.c
> > @@ -134,6 +134,21 @@ static struct elevator_type *elevator_get(const char *name)
> >  	spin_lock(&elv_list_lock);
> >  
> >  	e = elevator_find(name);
> > +	if (!e) {
> > +		char elv[ELV_NAME_MAX + strlen("-iosched")];
> > +
> > +		spin_unlock(&elv_list_lock);
> > +
> > +		if (!strcmp(name, "anticipatory"))
> > +			sprintf(elv, "as-iosched");
> > +		else
> > +			sprintf(elv, "%s-iosched", name);
> > +
> > +		request_module(elv);
> > +		spin_lock(&elv_list_lock);
> > +		e = elevator_find(name);
> > +	}
> > +
> >  	if (e && !try_module_get(e->elevator_owner))
> >  		e = NULL;
> 
> Looks nice and simple.  There might be some of the usual ordering problems
> when this is called during boot, maybe is-initramfs-available-yet problems,
> etc.  But it's unlikely to make things regress from where they are now.

Isn't request_module() and below robust enough to handle that?

> Should we emit a warning if the desired elevator wasn't available?

Hmm, not sure. Either the request came from a driver, in which case
it'll be notified that we could not load that elevator. Or it'll come
through sysfs online switching, in which case we already print a
warning.

-- 
Jens Axboe


  reply	other threads:[~2008-02-19  9:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 16:47 [PATCH 1/1] NBD: make nbd default to deadline I/O scheduler Paul Clements
2008-02-08 17:33 ` Randy Dunlap
2008-02-08 18:11   ` Andrew Morton
2008-02-08 18:41     ` Paul Clements
2008-02-08 20:45       ` Jens Axboe
2008-02-08 20:47         ` Jens Axboe
2008-02-08 21:23           ` Paul Clements
2008-02-08 22:02             ` Andrew Morton
2008-02-09 13:30               ` Paul Clements
2008-02-12 23:16                 ` Andrew Morton
2008-02-18 18:16                   ` Jens Axboe
2008-02-18 23:50                     ` Andrew Morton
2008-02-19  9:19                       ` Jens Axboe [this message]
2008-02-19  9:24                         ` Jens Axboe
2008-02-19 10:02                           ` Andrew Morton
2008-02-19 10:05                             ` Jens Axboe
2008-02-08 22:45       ` [Nbd] " Mike Snitzer

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=20080219091943.GS23197@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.clements@steeleye.com \
    --cc=randy.dunlap@oracle.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 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.