From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail190.messagelabs.com (mail190.messagelabs.com [216.82.249.51]) by kanga.kvack.org (Postfix) with SMTP id 9A13F6B004F for ; Mon, 17 Aug 2009 14:14:38 -0400 (EDT) Message-ID: <4A899E73.6000505@redhat.com> Date: Mon, 17 Aug 2009 14:16:19 -0400 From: Ric Wheeler MIME-Version: 1.0 Subject: Re: Discard support (was Re: [PATCH] swap: send callback when swap slot is freed) References: <200908122007.43522.ngupta@vflare.org> <1250344518.4159.4.camel@mulgrave.site> <20090816150530.2bae6d1f@lxorguk.ukuu.org.uk> <20090816083434.2ce69859@infradead.org> <1250437927.3856.119.camel@mulgrave.site> <4A8834B6.2070104@rtr.ca> <1250446047.3856.273.camel@mulgrave.site> <4A884D9C.3060603@rtr.ca> <1250447052.3856.294.camel@mulgrave.site> <4A898752.9000205@tmr.com> <87f94c370908171008t44ff64ack2153e740128278e@mail.gmail.com> <1250529575.7858.31.camel@mulgrave.site> In-Reply-To: <1250529575.7858.31.camel@mulgrave.site> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: James Bottomley Cc: Greg Freemyer , Bill Davidsen , Mark Lord , Arjan van de Ven , Alan Cox , Chris Worley , Matthew Wilcox , Bryan Donlan , david@lang.hm, Markus Trippelsdorf , Matthew Wilcox , Hugh Dickins , Nitin Gupta , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, Linux RAID List-ID: Chiming in here a bit late, but coalescing requests is also a good way to prevent read-modify-write cycles. Specifically, if I remember the concern correctly, for the WRITE_SAME with unmap bit set, when the IO is not evenly aligned on the "erase chunk" (whatever they call it) boundary the device can be forced to do a read-modify-write (of zeroes) to the end or beginning of that region. For a disk array, the WRITE_SAME with unmap bit when done cleanly on an aligned boundary can be done entirely in the array's cache. The read-modify-write can generate several reads to the back end disks which are significantly slower.... ric -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org