From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAB49C46477 for ; Wed, 19 Jun 2019 13:09:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B34B4215EA for ; Wed, 19 Jun 2019 13:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560949789; bh=8YepQqGxxiCYLEevul83mJt5reicSBKBeRcnB/6BH3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=hPjuwQrr3ZE6m0J+/pLZwStcf+XmmwzzZqqVLogV5z57NUm8VjoB2CPQhzEwyskwW XFi4whFPBB6QgiNrKab9dwyTMKWMuKDdjbZf5dTo1Ertv2gJJHuT7eR0uAhNWifpJP VfktpMw98CLRRldCFIOLpurP6e14h1W3J0BwZq9Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731576AbfFSNJs (ORCPT ); Wed, 19 Jun 2019 09:09:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:58880 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727126AbfFSNJr (ORCPT ); Wed, 19 Jun 2019 09:09:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 53761B002; Wed, 19 Jun 2019 13:09:46 +0000 (UTC) Date: Wed, 19 Jun 2019 15:09:44 +0200 From: Michal Hocko To: Minchan Kim Cc: Andrew Morton , linux-mm , LKML , linux-api@vger.kernel.org, Johannes Weiner , Tim Murray , Joel Fernandes , Suren Baghdasaryan , Daniel Colascione , Shakeel Butt , Sonny Rao , Brian Geffon , jannh@google.com, oleg@redhat.com, christian@brauner.io, oleksandr@redhat.com, hdanton@sina.com, lizeb@google.com Subject: Re: [PATCH v2 2/5] mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM Message-ID: <20190619130943.GP2968@dhcp22.suse.cz> References: <20190610111252.239156-1-minchan@kernel.org> <20190610111252.239156-3-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190610111252.239156-3-minchan@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 10-06-19 20:12:49, Minchan Kim wrote: > The local variable references in shrink_page_list is PAGEREF_RECLAIM_CLEAN > as default. It is for preventing to reclaim dirty pages when CMA try to > migrate pages. Strictly speaking, we don't need it because CMA didn't allow > to write out by .may_writepage = 0 in reclaim_clean_pages_from_list. > > Moreover, it has a problem to prevent anonymous pages's swap out even > though force_reclaim = true in shrink_page_list on upcoming patch. > So this patch makes references's default value to PAGEREF_RECLAIM and > rename force_reclaim with ignore_references to make it more clear. > > This is a preparatory work for next patch. > > * RFCv1 > * use ignore_referecnes as parameter name - hannes > > Acked-by: Johannes Weiner > Signed-off-by: Minchan Kim The code path is quite tricky to follow but the patch looks OK to me. Acked-by: Michal Hocko > --- > mm/vmscan.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 84dcb651d05c..0973a46a0472 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1102,7 +1102,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, > struct scan_control *sc, > enum ttu_flags ttu_flags, > struct reclaim_stat *stat, > - bool force_reclaim) > + bool ignore_references) > { > LIST_HEAD(ret_pages); > LIST_HEAD(free_pages); > @@ -1116,7 +1116,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, > struct address_space *mapping; > struct page *page; > int may_enter_fs; > - enum page_references references = PAGEREF_RECLAIM_CLEAN; > + enum page_references references = PAGEREF_RECLAIM; > bool dirty, writeback; > unsigned int nr_pages; > > @@ -1247,7 +1247,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, > } > } > > - if (!force_reclaim) > + if (!ignore_references) > references = page_check_references(page, sc); > > switch (references) { > -- > 2.22.0.rc2.383.gf4fbbf30c2-goog -- Michal Hocko SUSE Labs