From patchwork Wed Oct 26 20:27:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 9398241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 94E2B60231 for ; Wed, 26 Oct 2016 20:28:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 782BB29DE5 for ; Wed, 26 Oct 2016 20:28:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C66729DE7; Wed, 26 Oct 2016 20:28:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B8E729DE5 for ; Wed, 26 Oct 2016 20:28:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933128AbcJZU17 (ORCPT ); Wed, 26 Oct 2016 16:27:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44866 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932320AbcJZU17 (ORCPT ); Wed, 26 Oct 2016 16:27:59 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2CEC7F08B; Wed, 26 Oct 2016 20:27:58 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QKRw5V007084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 26 Oct 2016 16:27:58 -0400 Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QKRw5u013208; Wed, 26 Oct 2016 16:27:58 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id u9QKRweC013204; Wed, 26 Oct 2016 16:27:58 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Wed, 26 Oct 2016 16:27:57 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Jens Axboe cc: Mike Snitzer , Christoph Hellwig , dm-devel@redhat.com, "Alasdair G. Kergon" , linux-block@vger.kernel.org Subject: [PATCH 4/4] brd: remove unused brd_zero_page In-Reply-To: Message-ID: References: <20161021200022.GA12580@redhat.com> <20161024155756.GA48306@redhat.com> <20161025130712.GA12717@infradead.org> <20161025143719.GA51266@redhat.com> <710b07a3-9091-6935-37c4-ea1dcedcab4f@kernel.dk> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 26 Oct 2016 20:27:58 +0000 (UTC) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove the function brd_zero_page. This function was used to zero a page when the discard request came in. The discard request is used for performance or space optimization, it makes no sense to zero pages on discard request, as it neither improves performance nor saves memory. Signed-off-by: Mikulas Patocka --- drivers/block/brd.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/block/brd.c =================================================================== --- linux-2.6.orig/drivers/block/brd.c +++ linux-2.6/drivers/block/brd.c @@ -156,19 +156,6 @@ static void brd_free_page(struct brd_dev call_rcu(&page->rcu_head, brd_free_page_rcu); } -static void brd_zero_page(struct brd_device *brd, sector_t sector) -{ - struct page *page; - - rcu_read_lock(); - - page = brd_lookup_page(brd, sector); - if (page) - clear_highpage(page); - - rcu_read_unlock(); -} - /* * Free all backing store pages and radix tree. This must only be called when * there are no other users of the device. @@ -234,15 +221,7 @@ static void discard_from_brd(struct brd_ sector += boundary; n_sectors -= boundary; while (n_sectors >= PAGE_SIZE >> SECTOR_SHIFT) { - /* - * Don't want to actually discard pages here because - * re-allocating the pages can result in writeback - * deadlocks under heavy load. - */ - if (1) - brd_free_page(brd, sector); - else - brd_zero_page(brd, sector); + brd_free_page(brd, sector); sector += PAGE_SIZE >> SECTOR_SHIFT; n_sectors -= PAGE_SIZE >> SECTOR_SHIFT; }