Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp680198ybi; Wed, 19 Jun 2019 06:10:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxweL/Ay/SBxDYSTX1mlenoByx9H2RMVY9CLNYb7LUUk0V8BYcxEXrFhQzdFuj9ynYueJ46 X-Received: by 2002:aa7:8281:: with SMTP id s1mr21370258pfm.156.1560949836356; Wed, 19 Jun 2019 06:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560949836; cv=none; d=google.com; s=arc-20160816; b=S/sX8GP8Zp+G6hD9M93CfVq3eeoDliCYg7yRY5kMpKhZWVZaTOMRPZnybdsN2aVdQp UB5q35akXCvRVUrKpQdUDCQoTRO+xRke4U0P4lcea4LoSy6F1HVtGA8IUSfdDPL3c8AT aUK/cqvLRcnb7uJB2Ws0ZswZVvPO/EXvmTWgY/PmJlH/6A0MsoDCKmv3gYdzsS91vpZZ Y6Ug+hXOxRxvU9CSPskG+u91VFl5hYcqzBT+z8DHIBfIYXCQNPvBjq2y+cnk1aFJdL0V FSB8MiO+u+b7ZrW4yOjyK9oNnsIo9oFW2Cmuvh+8JOU22iuFBM3dNMIOQhNExgtYrbeQ TNZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7SQPNktCLhCqG/wC14MDxLI9EWyQNI+OuEYWpOWC0+8=; b=CtAb69qDUsr6jyuahABSlpK/zdy92hAfLDkdrDwPmt0vI5kMhil9LRAdJxQNfCcccw mYWFI+EsNjWbZHwZ3ben/LfJaIAny7HNWgsdaGV92EE+taWQTPQKdongMS+eHwcVKly1 xehdAs38ZliSZRA2DZhkW1yNCDSG83VqKj5yFdG2h3pwdhLdhDDHYFF0XV0B+CUXrEA1 8e6N526t7yklEzwSId/5kLnnk9YuzveeUcStoWTTCm9cJr4kom7N2JqSKAmjWSEEqalb t1bZszigWftlVJlJ3/zmJaG6nU2YcVRdCA0WXXEromVllIrpbLWoH6BZ0uYB+l0+eEy1 2mdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si2856120pgq.440.2019.06.19.06.10.18; Wed, 19 Jun 2019 06:10:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731422AbfFSNJs (ORCPT + 99 others); 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