Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932240AbdI1Pba (ORCPT ); Thu, 28 Sep 2017 11:31:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:53764 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751464AbdI1Pb2 (ORCPT ); Thu, 28 Sep 2017 11:31:28 -0400 Subject: Re: [PATCH 03/12] buffer: eliminate the need to call free_more_memory() in __getblk_slow() To: Jens Axboe , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: hannes@cmpxchg.org, jack@suse.cz, torvalds@linux-foundation.org References: <1506543239-31470-1-git-send-email-axboe@kernel.dk> <1506543239-31470-4-git-send-email-axboe@kernel.dk> From: Nikolay Borisov Message-ID: <92d672f8-1a56-3b54-082e-d760687beed8@suse.com> Date: Thu, 28 Sep 2017 17:12:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1506543239-31470-4-git-send-email-axboe@kernel.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1595 Lines: 61 On 27.09.2017 23:13, Jens Axboe wrote: > Since the previous commit removed any case where grow_buffers() > would return failure due to memory allocations, we can safely > remove the case where we have to call free_more_memory() in > this function. > > Since this is also the last user of free_more_memory(), kill > it off completely. > > Signed-off-by: Jens Axboe Reviewed-by: Nikolay Borisov > --- > fs/buffer.c | 23 ----------------------- > 1 file changed, 23 deletions(-) > > diff --git a/fs/buffer.c b/fs/buffer.c > index 3b60cd8456db..bff571dc7bc3 100644 > --- a/fs/buffer.c > +++ b/fs/buffer.c > @@ -253,27 +253,6 @@ __find_get_block_slow(struct block_device *bdev, sector_t block) > } > > /* > - * Kick the writeback threads then try to free up some ZONE_NORMAL memory. > - */ > -static void free_more_memory(void) > -{ > - struct zoneref *z; > - int nid; > - > - wakeup_flusher_threads(1024, WB_REASON_FREE_MORE_MEM); > - yield(); > - > - for_each_online_node(nid) { > - > - z = first_zones_zonelist(node_zonelist(nid, GFP_NOFS), > - gfp_zone(GFP_NOFS), NULL); > - if (z->zone) > - try_to_free_pages(node_zonelist(nid, GFP_NOFS), 0, > - GFP_NOFS, NULL); > - } > -} > - > -/* > * I/O completion handler for block_read_full_page() - pages > * which come unlocked at the end of I/O. > */ > @@ -1086,8 +1065,6 @@ __getblk_slow(struct block_device *bdev, sector_t block, > ret = grow_buffers(bdev, block, size, gfp); > if (ret < 0) > return NULL; > - if (ret == 0) > - free_more_memory(); > } > } > >