All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Omar Sandoval <osandov@osandov.com>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH 1/3] elevator: lookup mq vs non-mq elevators
Date: Wed, 25 Oct 2017 11:31:59 -0700	[thread overview]
Message-ID: <48fd922c-d675-cd6f-bcec-c2e83879f130@kernel.dk> (raw)
In-Reply-To: <20171025182708.GA9160@vader>

On 10/25/2017 11:27 AM, Omar Sandoval wrote:
> On Wed, Oct 25, 2017 at 12:04:45PM -0600, Jens Axboe wrote:
>> If an IO scheduler is selected via elevator= and it doesn't match
>> the driver in question wrt blk-mq support, then we fail to boot.
>>
>> The elevator= parameter is deprecated and only supported for
>> non-mq devices. Augment the elevator lookup API so that we
>> pass in if we're looking for an mq capable scheduler or not,
>> so that we only ever return a valid type for the queue in
>> question.
>>
>> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196695
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>> ---
>>  block/elevator.c | 44 +++++++++++++++++++++-----------------------
>>  1 file changed, 21 insertions(+), 23 deletions(-)
>>
>> diff --git a/block/elevator.c b/block/elevator.c
>> index 7ae50eb2732b..b70e69f795db 100644
>> --- a/block/elevator.c
>> +++ b/block/elevator.c
>> @@ -83,12 +83,15 @@ bool elv_bio_merge_ok(struct request *rq, struct bio *bio)
>>  }
>>  EXPORT_SYMBOL(elv_bio_merge_ok);
>>  
>> -static struct elevator_type *elevator_find(const char *name)
>> +/*
>> + * Return scheduler with name 'name' and with matching 'mq capability
>> + */
>> +static struct elevator_type *elevator_find(const char *name, bool mq)
>>  {
>>  	struct elevator_type *e;
>>  
>>  	list_for_each_entry(e, &elv_list, list) {
>> -		if (!strcmp(e->elevator_name, name))
>> +		if (!strcmp(e->elevator_name, name) && !(mq ^ e->uses_mq))
> 
> 
> How about just (mq == e->uses_mq)?

That is simpler/cleaner, I'll make that adjustment. Not sure where the XOR
temptation came from.

-- 
Jens Axboe

  reply	other threads:[~2017-10-25 18:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 18:04 [PATCH 0/3] mq vs non-mq scheduler tweaks Jens Axboe
2017-10-25 18:04 ` [PATCH 1/3] elevator: lookup mq vs non-mq elevators Jens Axboe
2017-10-25 18:27   ` Omar Sandoval
2017-10-25 18:31     ` Jens Axboe [this message]
2017-10-25 18:04 ` [PATCH 2/3] elevator: allow name aliases Jens Axboe
2017-10-25 18:32   ` Omar Sandoval
2017-10-25 18:32     ` Jens Axboe
2017-10-25 18:04 ` [PATCH 3/3] mq-deadline: add 'deadline' as a name alias Jens Axboe
2017-10-25 18:34   ` Omar Sandoval
2017-10-25 18:36     ` 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=48fd922c-d675-cd6f-bcec-c2e83879f130@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@osandov.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.