FWIW the most recent discard performance issue I looked at was an early SSD that only supported a small max discard size. Doing a discard of the whole device (mkfs) took several minutes with lots of little discards. So it isn't always just an issue of the max size. -Ewan On Mon, Jun 12, 2023 at 10:00 PM Martin K. Petersen <martin.petersen@xxxxxxxxxx> wrote: > > > John, > > > Thanks alot for responding Martin. Forgive my ignorance; just trying > > to gain understanding. For example, if we find a device with a 2TiB > > max discard (way too high for any device to handle reasonably from > > what I've seen), > > That really depends. On some devices performing a 2TB discard may just > involve updating a few entries in a block translation table. It could be > close to constant time regardless of the number of terabytes unmapped. > > > and we make a quirk for it that brings the max discard down, how do we > > decide what value to bring that down to? Would we ask the hardware > > vendor for an optimal value? Is there some way we could decide the > > value? > > The best thing would be to ask the vendor. Or maybe if you provide the > output of > > # sg_vpd -p bl /dev/sdN > > and we can try to see if we can come up with a suitable heuristic for a > quirk. > > -- > Martin K. Petersen Oracle Linux Engineering >