From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle McMartin Subject: Re: [patch] brd: support discard Date: Thu, 27 May 2010 07:28:05 -0400 Message-ID: <20100527112805.GD28492@bombadil.infradead.org> References: <20100526133342.GA22536@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jens Axboe , linux-fsdevel@vger.kernel.org To: Nick Piggin Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:48068 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754872Ab0E0L2I (ORCPT ); Thu, 27 May 2010 07:28:08 -0400 Content-Disposition: inline In-Reply-To: <20100526133342.GA22536@laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, May 26, 2010 at 11:33:42PM +1000, Nick Piggin wrote: > +static void discard_from_brd(struct brd_device *brd, > + sector_t sector, size_t n) > +{ > + while (n >= PAGE_SIZE) { > + /* > + * Don't want to actually discard pages here because > + * re-allocating the pages can result in writeback > + * deadlocks under heavy load. > + */ > + if (0) > + brd_free_page(brd, sector); > + else > + brd_zero_page(brd, sector); That if (0) looks a little suspicious... ;-) regards, Kyle