From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425149AbcFHMbm (ORCPT ); Wed, 8 Jun 2016 08:31:42 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35092 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423697AbcFHMbk (ORCPT ); Wed, 8 Jun 2016 08:31:40 -0400 Date: Wed, 8 Jun 2016 14:31:38 +0200 From: Michal Hocko To: Johannes Weiner Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Rik van Riel , Mel Gorman , Andrea Arcangeli , Andi Kleen , Tim Chen , kernel-team@fb.com Subject: Re: [PATCH 06/10] mm: remove unnecessary use-once cache bias from LRU balancing Message-ID: <20160608123137.GG22570@dhcp22.suse.cz> References: <20160606194836.3624-1-hannes@cmpxchg.org> <20160606194836.3624-7-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160606194836.3624-7-hannes@cmpxchg.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 06-06-16 15:48:32, Johannes Weiner wrote: > When the splitlru patches divided page cache and swap-backed pages > into separate LRU lists, the pressure balance between the lists was > biased to account for the fact that streaming IO can cause memory > pressure with a flood of pages that are used only once. New page cache > additions would tip the balance toward the file LRU, and repeat access > would neutralize that bias again. This ensured that page reclaim would > always go for used-once cache first. > > Since e9868505987a ("mm,vmscan: only evict file pages when we have > plenty"), page reclaim generally skips over swap-backed memory > entirely as long as there is used-once cache present, and will apply > the LRU balancing when only repeatedly accessed cache pages are left - > at which point the previous use-once bias will have been neutralized. > > This makes the use-once cache balancing bias unnecessary. Remove it. > > Signed-off-by: Johannes Weiner Acked-by: Michal Hocko > --- > mm/swap.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/mm/swap.c b/mm/swap.c > index 576c721f210b..814e3a2e54b4 100644 > --- a/mm/swap.c > +++ b/mm/swap.c > @@ -264,7 +264,6 @@ static void __activate_page(struct page *page, struct lruvec *lruvec, > void *arg) > { > if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) { > - int file = page_is_file_cache(page); > int lru = page_lru_base_type(page); > > del_page_from_lru_list(page, lruvec, lru); > @@ -274,7 +273,6 @@ static void __activate_page(struct page *page, struct lruvec *lruvec, > trace_mm_lru_activate(page); > > __count_vm_event(PGACTIVATE); > - update_page_reclaim_stat(lruvec, file, 1, hpage_nr_pages(page)); > } > } > > @@ -797,8 +795,6 @@ EXPORT_SYMBOL(__pagevec_release); > void lru_add_page_tail(struct page *page, struct page *page_tail, > struct lruvec *lruvec, struct list_head *list) > { > - const int file = 0; > - > VM_BUG_ON_PAGE(!PageHead(page), page); > VM_BUG_ON_PAGE(PageCompound(page_tail), page); > VM_BUG_ON_PAGE(PageLRU(page_tail), page); > @@ -833,20 +829,13 @@ void lru_add_page_tail(struct page *page, struct page *page_tail, > static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec, > void *arg) > { > - int file = page_is_file_cache(page); > - int active = PageActive(page); > enum lru_list lru = page_lru(page); > - bool new = (bool)arg; > > VM_BUG_ON_PAGE(PageLRU(page), page); > > SetPageLRU(page); > add_page_to_lru_list(page, lruvec, lru); > > - if (new) > - update_page_reclaim_stat(lruvec, file, active, > - hpage_nr_pages(page)); > - > trace_mm_lru_insertion(page, lru); > } > > -- > 2.8.3 -- Michal Hocko SUSE Labs