Re: [PATCH] block: Force sector and nr_sects to device alignment and granularity.

From: Martin K. Petersen
Date: Wed Mar 12 2014 - 21:48:20 EST


>>>>> "Jeff" == Jeff Moyer <jmoyer@xxxxxxxxxx> writes:

>> The case that we were seeing was with an SSD that required TRIM on 8k
>> boundaries and with an 8k granularity. Since the file system was
>> trying to do discards based on 4k alignment the driver complained
>> mightily.

Jeff> but you managed to read my mind well enough. The question is how
Jeff> high up the stack do you put the logic for this? Is it worth it
Jeff> to duplicate the checks in the OS that are already done on the
Jeff> device? I don't know. Martin, do you have an opinion on this?

I'm no big fan of dropping information.

My original intent with the discard granularity and alignment was to
allow filesystems to use them to influence block allocation and layout.
Not to affect how we issue commands at runtime.

Since a storage device is free to ignore all or parts of any discard
request I'd consider it somewhat broken if it actually complained.
Especially so since the relevant knobs in the standard that we key off
of are performance recommendations and not requirements that commands
must adhere to.

--
Martin K. Petersen Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/