DM-Devel Archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Mike Snitzer <snitzer@redhat.com>,
	dm-devel@lists.linux.dev,  Eric Biggers <ebiggers@kernel.org>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	 Daniel Lee <chullee@google.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] dm: Change the default value of rq_affinity from 0 into 1
Date: Tue, 16 Apr 2024 15:30:40 +0200 (CEST)	[thread overview]
Message-ID: <1494d512-9eb0-2091-8e9f-fbb28d2441d1@redhat.com> (raw)
In-Reply-To: <c107bba4-03a1-4121-af9e-7c93f40c24a0@acm.org>



On Mon, 15 Apr 2024, Bart Van Assche wrote:

> On 4/15/24 12:56, Mikulas Patocka wrote:
> > I am wondering how should QUEUE_FLAG_SAME_COMP work for bio-based
> > devices.
> > 
> > I grepped the kernel for QUEUE_FLAG_SAME_COMP and it is tested in
> > block/blk-mq.c in blk_mq_complete_need_ipi (this code path is taken only
> > for request-based devices) and in block/blk-sysfs.c in
> > queue_rq_affinity_show (this just displays the value in sysfs). There are
> > no other places where QUEUE_FLAG_SAME_COMP is tested, so I don't see what
> > effect is it supposed to have.
> 
> I think the answer depends on whether or not the underlying device
> defines the .submit_bio() callback. From block/blk-core.c:
> 
> static void __submit_bio(struct bio *bio)
> {
> 	if (unlikely(!blk_crypto_bio_prep(&bio)))
> 		return;
> 
> 	if (!bio->bi_bdev->bd_has_submit_bio) {
> 		blk_mq_submit_bio(bio);
> 	} else if (likely(bio_queue_enter(bio) == 0)) {
> 		struct gendisk *disk = bio->bi_bdev->bd_disk;
> 
> 		disk->fops->submit_bio(bio);
> 		blk_queue_exit(disk->queue);
> 	}
> }
> 
> In other words, if the .submit_bio() callback is defined, that function
> is called. If it is not defined, blk_mq_submit_bio() converts the bio
> into a request. QUEUE_FLAG_SAME_COMP affects the request completion
> path. On my test setup there are multiple dm instances defined on top of
> SCSI devices. The SCSI core does not implement the .submit_bio()
> callback.
> 
> Thanks,
> 
> Bart.

Yes, setting the flag QUEUE_FLAG_SAME_COMP for bio-based drivers (those 
that define .submit_bio) has no effect. So, I think that you patch doesn't 
have any effect too.

Mikulas


      reply	other threads:[~2024-04-16 13:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 19:49 [PATCH] dm: Change the default value of rq_affinity from 0 into 1 Bart Van Assche
2024-04-15 19:56 ` Mikulas Patocka
2024-04-15 20:54   ` Bart Van Assche
2024-04-16 13:30     ` Mikulas Patocka [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=1494d512-9eb0-2091-8e9f-fbb28d2441d1@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=bvanassche@acm.org \
    --cc=chullee@google.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=ebiggers@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=snitzer@redhat.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).