All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	linux-block@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 2/3] blk-mq: avoid to touch q->elevator without any protection
Date: Wed, 15 Jun 2022 08:04:42 +0200	[thread overview]
Message-ID: <20220615060442.GD22115@lst.de> (raw)
In-Reply-To: <20220615023712.750122-3-ming.lei@redhat.com>

> +++ b/block/elevator.c
> @@ -612,6 +612,16 @@ int elevator_switch_mq(struct request_queue *q,
>  		}
>  	}
>  
> +	/*
> +	 * Is the request queue handled by an IO scheduler that does not
> +	 * respect hardware queues when dispatching?
> +	 */
> +	if (new_e && new_e->ops.dispatch_request &&
> +	    !(new_e->elevator_features & ELEVATOR_F_MQ_AWARE))
> +		blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);
> +	else
> +		blk_queue_flag_clear(QUEUE_FLAG_SQ_SCHED, q);

Please just set the QUEUE_FLAG_SQ_SCHED flag directly from the
mq-deadline and bfq scheduler ans drop the ELEVATOR_F_MQ_AWARE
flag.

Otherwise this approach looks good.


  reply	other threads:[~2022-06-15  6:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15  2:37 [PATCH 0/3] blk-mq: three misc patches Ming Lei
2022-06-15  2:37 ` [PATCH 1/3] blk-mq: protect q->elevator by ->sysfs_lock Ming Lei
2022-06-15  6:01   ` Christoph Hellwig
2022-06-15  2:37 ` [PATCH 2/3] blk-mq: avoid to touch q->elevator without any protection Ming Lei
2022-06-15  6:04   ` Christoph Hellwig [this message]
2022-06-15  2:37 ` [PATCH 3/3] blk-mq: don't clear flush_rq from tags->rqs[] Ming Lei
2022-06-15  6:22   ` Christoph Hellwig

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=20220615060442.GD22115@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.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.