Re: Supporting segment sizes smaller than the page size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 21, 2022 at 04:28:32PM -0700, Bart Van Assche wrote:
> Hi Jens, Christoph and Ming,
> 
> As we know the Linux kernel block layer does not support DMA segment sizes
> that are smaller than the page size. From block/blk-settings.c:
> 
> void blk_queue_max_segment_size(struct request_queue *q,
>                                 unsigned int max_size)
> {
> 	if (max_size < PAGE_SIZE) {
> 		max_size = PAGE_SIZE;
> 		printk(KERN_INFO "%s: set to minimum %d\n",
> 		       __func__, max_size);
> 	}
> 
> 	/* see blk_queue_virt_boundary() for the explanation */
> 	WARN_ON_ONCE(q->limits.virt_boundary_mask);
> 
> 	q->limits.max_segment_size = max_size;
> }
> 
> I have been asked to add support for DMA segment sizes that are smaller than
> the page size to support a UFS controller with a maximum DMA segment size of
> 4 KiB and a page size > 4 KiB (my understanding of the JEDEC UFS host
> controller specification is that UFS host controllers should support a
> maximum DMA segment size of 256 KiB). Does anyone want to comment on this
> before I start working on a patch series?

If the hardware's DMA segment is smaller than a page, why doesn't the driver
just split a kernel's larger segment into whatever representation the hardware
wants? We do that in nvme, at least.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux