On Fri, Aug 06, 2010 at 03:07:25PM -0700, Hugh Dickins wrote: > If REQ_SOFTBARRIER means that the device is still free to reorder a > write, which was issued after discard completion was reported, before > the discard (so later discarding the data written), then certainly I > agree with Christoph (now Cc'ed) that the REQ_HARDBARRIER is > unavoidable there; but if not, then it's not needed for the swap case. > I hope to gain a little more enlightenment on such barriers shortly. REQ_SOFTBARRIER is indeed purely a reordering barrier inside the block elevator. > What does seem over the top to me, is for mm/swapfile.c's > blkdev_issue_discard()s to be asking for both BLKDEV_IFL_WAIT and > BLKDEV_IFL_BARRIER: those swap discards were originally written just > to use barriers, without needing to wait for completion in there. I'd > be interested to hear if cutting out the BLKDEV_IFL_WAITs makes the > swap discards behave acceptably again for you - but understand that > you won't have a chance to try that until later next week. That does indeed look incorrect to me. Any kind of explicit waits usually mean the caller provides ordering. Getting rid of BLKDEV_IFL_BARRIER in the swap code ASAP would indeed be beneficial given that we are trying to get rid of hard barriers completely soon. Auditing the existing blkdev_issue_discard callers in filesystems is high on the todo list for me. _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm