On 6/14/23 19:22, Jens Axboe wrote:
On 6/12/23 2:33?PM, Bart Van Assche wrote:
We want to improve Android performance by increasing the page size
from 4 KiB to 16 KiB. However, some of the storage controllers we care
about do not support DMA segments larger than 4 KiB. Hence the need
support for DMA segments that are smaller than the size of one virtual
memory page. This patch series implements that support. Please
consider this patch series for the next merge window.
I'm usually a fan of putting code in the core so we don't have to in
drivers, that's how most of the block layer is designed. But this seems
niche enough that perhaps it's worth considering just remapping these in
the driver? It's peppering changes all over delicate parts of the core
for cases that 99.9% don't need to worry about or should worry about.
I will say that I do think the patches do look better than they did in
earlier versions, however.
Maybe we've already discussed this before, but let's please have the
discussion again. Because I'd really love to avoid this code, if at all
possible.
Hi Jens,
These are my arguments in favor of having this functionality in the
block layer core instead of in the UFS driver:
* This functionality is useful for multiple block drivers. It is also
useful for block drivers with a max_segment_size limit less than 64
KiB on systems with a 64 KiB page size. E.g. the sbp2 driver and
several ATA and MMC drivers set the max_segment_size limit to a value
less than 64 KiB.
* The UFS 3.1 devices in my test setup support read bandwidths up to 2
GiB/s and more than 100K IOPS. UFSHCI 4.0 controllers support a link
bandwidth that is the double of UFSHCI 3.x controllers and also
support higher queue depths (up to 512 instead of 32). In other words,
performance matters for UFS devices. Having the SCSI core build an SG
list and making the UFS driver rework that SG list probably would
affect performance negatively.
* The MMC driver is more complicated than needed because the block layer
core does not yet support the limits of MMC devices. I think that this
patch series will allow to simplify the MMC driver. From
drivers/mmc/block.c:
/*
* The block layer doesn't support all sector count
* restrictions, so we need to be prepared for too big
* requests.
*/
* Care has been taken not to affect performance or maintainability
of the block layer core in a negative way.
Thanks,
Bart.