Re: [PATCH 08/14] scsi: sd: Optimal I/O size should be a multiple of reported granularity

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

 



On 3/3/22 19:45, Martin K. Petersen wrote:
On 3/1/22 21:35, Martin K. Petersen wrote:
+	if (min_xfer_bytes && opt_xfer_bytes & (min_xfer_bytes - 1)) {
+		sd_first_printk(KERN_WARNING, sdkp,
+				"Optimal transfer size %u bytes not a " \
+				"multiple of preferred minimum block " \
+				"size (%u bytes)\n",
+				opt_xfer_bytes, min_xfer_bytes);
+		return false;
+	}

Hmm ... what guarantees that min_xfer_bytes is a power of two? Did I
perhaps overlook something?

Nothing in the spec, obviously, but I think we'd have a lot of headaches
further up the stack if that wasn't the case.

Do you know of any devices that report something unusual here?

Hi Martin,

I'm not aware of any devices that report an unusual OPTIMAL TRANSFER LENGTH GRANULARITY value.

Since this code is not in the hot path, how about using the modulo operator instead of binary and?

Thanks,

Bart.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux