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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 24439C433E0 for ; Tue, 12 Jan 2021 07:03:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B03222CA2 for ; Tue, 12 Jan 2021 07:03:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B03222CA2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9AD828D0069; Tue, 12 Jan 2021 02:03:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 95F178D0051; Tue, 12 Jan 2021 02:03:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8762C8D0069; Tue, 12 Jan 2021 02:03:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6E7CD8D0051 for ; Tue, 12 Jan 2021 02:03:14 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 364A91EE6 for ; Tue, 12 Jan 2021 07:03:14 +0000 (UTC) X-FDA: 77696231508.22.test62_1a0183027513 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 1AC9418038E60 for ; Tue, 12 Jan 2021 07:03:14 +0000 (UTC) X-HE-Tag: test62_1a0183027513 X-Filterd-Recvd-Size: 3957 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 07:03:12 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1610434991; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4ig/BzfwIsrlPajsj3oElCG90RaaTlGpS+pt8s/fcBI=; b=A+Jthmoc0Sgvqf0+XpBapP/4WObyv+kjOe4Pvmkz8/5nZ+ThYcTuplMRY6GLP0pVG/nk9q 42f5VDCS47iJbDbEjiLiCLIM0CL8ZzIV+NWdokvawQw8qg9la3z35ylKMwGd7Ac2Q89wac qcBWHO2Nl6TLU+65yFVxNkkpnCtZdAQ= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A4E3AAB92; Tue, 12 Jan 2021 07:03:11 +0000 (UTC) Date: Tue, 12 Jan 2021 08:03:10 +0100 From: Michal Hocko To: Sudarshan Rajagopalan Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH] mm: vmscan: support equal reclaim for anon and file pages Message-ID: <20210112070310.GE22493@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 11-01-21 12:58:43, Sudarshan Rajagopalan wrote: > When performing memory reclaim support treating anonymous and > file backed pages equally. > Swapping anonymous pages out to memory can be efficient enough > to justify treating anonymous and file backed pages equally. This changelog doesn't explain, what kind of problem you are trying to address, why the existing code and tunables are insufficient, how it is supposed to work, what are potential risks, what kind of testing have you done and more. Please have a look at Documentation/process/submitting-patches.rst for more guidance about expectations from a patch when it is submitted. > Signed-off-by: Sudarshan Rajagopalan > Cc: Andrew Morton > --- > mm/vmscan.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 257cba79a96d..ec7585e0d5f5 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -169,6 +169,8 @@ struct scan_control { > */ > int vm_swappiness = 60; > > +bool balance_anon_file_reclaim = false; > + > static void set_task_reclaim_state(struct task_struct *task, > struct reclaim_state *rs) > { > @@ -201,6 +203,13 @@ static DECLARE_RWSEM(shrinker_rwsem); > static DEFINE_IDR(shrinker_idr); > static int shrinker_nr_max; > > +static int __init cmdline_parse_balance_reclaim(char *p) > +{ > + balance_anon_file_reclaim = true; > + return 0; > +} > +early_param("balance_reclaim", cmdline_parse_balance_reclaim); > + > static int prealloc_memcg_shrinker(struct shrinker *shrinker) > { > int id, ret = -ENOMEM; > @@ -2291,9 +2300,11 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, > > /* > * If there is enough inactive page cache, we do not reclaim > - * anything from the anonymous working right now. > + * anything from the anonymous working right now. But when balancing > + * anon and page cache files for reclaim, allow swapping of anon pages > + * even if there are a number of inactive file cache pages. > */ > - if (sc->cache_trim_mode) { > + if (!balance_anon_file_reclaim && sc->cache_trim_mode) { > scan_balance = SCAN_FILE; > goto out; > } > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > a Linux Foundation Collaborative Project > -- Michal Hocko SUSE Labs