On Mon, 2 May 2011, Martin K. Petersen wrote: > >>>>> "Lukas" == Lukas Czerner <lczerner@xxxxxxxxxx> writes: > > Lukas, > > Lukas> So is that documented somewhere ? Because to me it is really not > Lukas> obvious whether 0 means that the device does not support discard, > Lukas> or the device just does not report discard_max_bytes at all. > > discard_max_bytes does not necessarily correspond to a single value > reported by the device. Not all device types have the notion of such a > setting. > > discard_max_bytes is calculated at the bottom of the stack depending on > a combination of heuristics and metrics reported by the device. The same > goes for granularity and alignment. > > So I guess the important thing here is that these values may or may not > correspond directly to the underlying device (hopefully they will > :). But the topology information *itself* is the interface. That's the > whole point. To detach the top of the stack from the intricacies of the > hardware. > > You should never have to ask yourself whether a device supports > reporting discard_max_bytes. If a device supports discard then > discard_max_bytes will be set. Always. Same goes for granularity and > alignment. Regardless of whether the device reports these values or > not. We'll fill out the blanks. > > This is true for the rest of the topology information as well. If the > device does not report a physical block size (most don't) we'll set it > to match the logical block size. Etc. > Hi Martin, Thanks for explanation, now I know that I can rely on discard_max_bytes to be set correctly and that this has "discard supported" information in it intentionally. Would you mind documenting the whole sysfs discard_* stuff in Documentation/ABI as you seem to very well understand how those information are being created ? I agree that the discard_support entry is not needed. Thanks! -Lukas -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html