Re: [PATCH V3] block: make segment size limit workable for > 4K PAGE_SIZE

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

 



On 2/13/25 4:00 AM, Ming Lei wrote:
PAGE_SIZE is applied in validating block device queue limits, this way is
               ^^^^^^^
               used?
very fragile and is wrong:

- queue limits are read from hardware, which is often one readonly hardware
                                                            ^^^^^^^^
                                                            read-only?
@@ -1163,6 +1163,8 @@ static inline bool bdev_is_partition(struct block_device *bdev)
  enum blk_default_limits {
  	BLK_MAX_SEGMENTS	= 128,
  	BLK_SAFE_MAX_SECTORS	= 255,
+	/* use minimized PAGE_SIZE as min segment size hint */
+	BLK_MIN_SEGMENT_SIZE	= 4096,
  	BLK_MAX_SEGMENT_SIZE	= 65536,
  	BLK_SEG_BOUNDARY_MASK	= 0xFFFFFFFFUL,
  };

The above comment could be made more clear, e.g. "Use 4 KiB as the
smallest supported DMA segment size limit instead of PAGE_SIZE. This is
important if the page size is larger than 4 KiB since the maximum DMA
segment size for some storage controllers (e.g. eMMC) is 4 KiB."

Anyway:

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>




[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