Re: about TRIM/DISCARD support and barriers



On Mon, 2008-11-24 at 09:03 +0000, David Woodhouse wrote:
On Mon, 2008-11-24 at 07:52 +0900, James Bottomley wrote:
On Sun, 2008-11-23 at 13:39 +0000, David Woodhouse wrote:
We don't attempt to put non-contiguous ranges into a single TRIM yet.

We don't even merge contiguous ranges -- I still need to fix the
elevators to stop writes crossing writes,

I don't think we want to do that ... it's legal if the write isn't a
barrier and it will inhibit merging. That may be just fine for a SSD,
but it's not for spinning media since they get better performance out of
merged writes.

No, I just mean writes _to the same sector_. At the moment, we happily
let those cross each other in the queue.

That's legal ... if you want the ordering to matter, you either wait or
insert a barrier.

We do notice this situation and preserve the ordering if the two
requests cover _precisely_ the same range, but _overlapping_ writes may
happen in any order.

We should fix that, and it's only for _that_ purpose that I'm saying we
treat writes and discards as identical. And then we can drop the barrier
flag on discards.

It's not a bug ... but changing it might be feasible ... as long as it
doesn't affect write performance too much (which I don't think it will),
since it is in the critical path.

And _then_ we can think about special cases which let us merge
non-contiguous discards.

I still think that treating discards as a special command from the
outset is the better way forwards.

James


--
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/



Relevant Pages

  • Re: about TRIM/DISCARD support and barriers
    ... elevators to stop writes crossing writes, ... barrier and it will inhibit merging. ... We should fix that, and it's only for _that_ purpose that I'm saying we ... treat writes and discards as identical. ...
    (Linux-Kernel)
  • Re: Re: both accessing now, Stephanie and Joaquim constituted the renewed swamps as opposed to unple
    ... I am wearily natural, so I tuck you. ... then fix outside the barrier due to the bedroom. ...
    (sci.crypt)
  • Re: 2.6.7-mm5
    ... > - last call for reviewers of the perfctr patches. ... > Fix pcmcia netdev takedown ordering ... > ext3 reservation max window size check patch ... > reiserfs v3 barrier support ...
    (Linux-Kernel)
  • Re: 2.6.7-mm6
    ... > ia64 test box to lock up on boot. ... > Fix the ia32 VM layout patch ... > Networking fixes arising from the Stanford locking checker. ... > reiserfs v3 barrier support ...
    (Linux-Kernel)