From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
Jaegeuk Kim <jaegeuk@kernel.org>,
Avri Altman <avri.altman@wdc.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Christoph Hellwig <hch@lst.de>, Ming Lei <ming.lei@redhat.com>,
Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH v3 1/9] block: Introduce QUEUE_FLAG_SUB_PAGE_SEGMENTS and CONFIG_BLK_SUB_PAGE_SEGMENTS
Date: Mon, 23 Jan 2023 11:58:28 -0800 [thread overview]
Message-ID: <31b21272-a17b-0dc6-756c-c990ff2c7ea7@acm.org> (raw)
In-Reply-To: <6b1fa9a4-a06b-4b47-023d-b52f4efae6e5@kernel.dk>
On 1/20/23 18:43, Jens Axboe wrote:
> On 1/20/23 5:11?PM, Bart Van Assche wrote:
>> If CONFIG_BLK_SUB_PAGE_SEGMENTS is made invisible, how should this
>> option be enabled for the scsi_debug and null_blk drivers? Adding
>> "select BLK_SUB_PAGE_SEGMENTS" to the Kconfig section of these drivers
>> would have the unfortunate side effect that enabling either driver
>> would make all block drivers slower. How about making sub-page segment
>> support configurable for the scsi_debug and null_blk drivers only?
>> That would allow kernel developers who want to test the sub-page
>> segment support to enable this functionality without making e.g.
>> distro kernels slower.
>
> You'd need to have a separate sub-option for each of them, Kconfig
> style. But this also highlights the usual issue with pretending that
> Kconfig options means that this doesn't matter, because inevitably they
> end up getting enabled by default in distros anyway. And then you may as
> well not even have them...
Hi Jens,
How about the following approach?
* Remove CONFIG_BLK_SUB_PAGE_SEGMENTS.
* Use the static key mechanism instead of #ifdef
CONFIG_BLK_SUB_PAGE_SEGMENTS to prevent that this patch series makes
the hot path in the block layer slower.
* Count the number of request queues that need support for segments
smaller than a page or max_hw_sector values smaller than
PAGE_SIZE >> SECTOR_SHIFT. If that number changes from zero to one,
enable the code introduced by this patch series. If that number drops
to zero, toggle the static key such that the overhead of the code that
supports small segments is eliminated.
> Why can't we just handle this in the driver? The segment path is hard
> enough to grok in the first place, and this just makes it worse.
> Generally not a huge fan of punting this to the driver, but just maybe
> it'd make sense in this case since it's just the one. At least that
> seems a lot more palatable than the alternative.
One of the functions modified by this patch series is
blk_rq_append_bio(). That function is called by code that builds a bio
(e.g. filesystems). Code that builds a bio does not call any block
driver code. This is why I think it would be hard to move the
functionality introduced by this patch series into block drivers.
Thanks,
Bart.
next prev parent reply other threads:[~2023-01-23 19:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 22:54 [PATCH v3 0/9] Add support for segments smaller than one page Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 1/9] block: Introduce QUEUE_FLAG_SUB_PAGE_SEGMENTS and CONFIG_BLK_SUB_PAGE_SEGMENTS Bart Van Assche
2023-01-18 23:02 ` Jens Axboe
2023-01-18 23:40 ` Bart Van Assche
2023-01-21 0:11 ` Bart Van Assche
2023-01-21 2:43 ` Jens Axboe
2023-01-23 19:58 ` Bart Van Assche [this message]
2023-01-18 22:54 ` [PATCH v3 2/9] block: Support configuring limits below the page size Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 3/9] block: Support submitting passthrough requests with small segments Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 4/9] block: Add support for filesystem requests and " Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 5/9] block: Add support for small segments in blk_rq_map_user_iov() Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 6/9] scsi_debug: Support configuring the maximum segment size Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 7/9] null_blk: " Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 8/9] scsi: core: Set BLK_SUB_PAGE_SEGMENTS for small max_segment_size values Bart Van Assche
2023-01-19 5:38 ` Christoph Hellwig
2023-01-19 17:27 ` Bart Van Assche
2023-01-18 22:54 ` [PATCH v3 9/9] scsi: ufs: exynos: Select CONFIG_BLK_SUB_PAGE_SEGMENTS for lage page sizes Bart Van Assche
2023-01-28 3:55 ` Ming Lei
2023-01-29 1:09 ` Bart Van Assche
2023-01-19 1:18 ` [PATCH v3 0/9] Add support for segments smaller than one page Jens Axboe
2023-01-19 4:43 ` Bart Van Assche
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=31b21272-a17b-0dc6-756c-c990ff2c7ea7@acm.org \
--to=bvanassche@acm.org \
--cc=adrian.hunter@intel.com \
--cc=avri.altman@wdc.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=jaegeuk@kernel.org \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox