I'm trying to find how the Linux obtains the max_hw_sectors_kb value. I know that it comes from the HW itself but how?
Asked
Active
Viewed 406 times
0
-
Would depend on the type of storage and type of controller. NVMe, SCSI and SATA would all be different. – stark Sep 19 '21 at 20:30
-
It's a SCSI Device – mms Sep 20 '21 at 07:48
-
Does this answer your question? [Linux: writes are split into 512K chunks](https://stackoverflow.com/questions/10494593/linux-writes-are-split-into-512k-chunks) – stark Sep 20 '21 at 10:27
-
No, it doesn't. How does the SCSI tell the max_hw_sectors_kb value? is it calculated based on some device params or directly obtained using some commands? – mms Sep 20 '21 at 11:04
-
1See https://sg.danny.cz/sg/sg_io.html for some (old but nevertheless still valid) notes "how this works" on SCSI; the margin of an imprecise SO question is too small to hold a full explanation how device capability discovery and/or device attribute setting work in the implementation of the Linux SCSI subsystem (docs with impl reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/driver-api/scsi.rst). Let's just say here "one can query the SCSI device itself for this information". – FrankH. Sep 30 '21 at 16:47