Christoph Hellwig wrote: > On Mon, Nov 23, 2009 at 12:02:48PM -0500, Ric Wheeler wrote: >> I agree - the discard of the whole device is a good idea. >> >> I just want to make clear that "discard block X; write block X with >> zeroed data" undoes the discard in general :-) > > We can skip the writing of zeroes if we know the device returns zeroed > blocks after a trim. Martin's patch exports that information to > userspace, and once we have a nice enough interface (e.g. blkid or an > ioctl) we can actually use it in mkfs to optimize the writing of zeroes > away. Raw growling in sysfs is a bit too nasty to add it to mkfs for > those few blocks IMHO. > well, in testing, I've found that not all devices which claim to return 0s post-trim, do. For example one ssd I have, if I pattern 1M of 0xaf, then trim from 512k to 1M, and read it back (all IO done direct) I get: 00000000 af af af af af af af af af af af af af af af af * 00080000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 000a9000 af af af af af af af af af af af af af af af af * 00100000 with scraps of data left over at 0xA9000. So for the very few blocks that we zero at mkfs (thinking xfs here, anyway) I'd really rather just zero them post-trim to be safe, at least for now. -Eric -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html