Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2981711pxb; Tue, 12 Jan 2021 03:30:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLnB6tqLvsgprnWhnQXE4QBLnBHQ7I2mr3+M+qmuP/fJL1+aotjpYN0z8kHN2Ijocya4Ag X-Received: by 2002:a05:6402:b57:: with SMTP id bx23mr2961174edb.191.1610451053865; Tue, 12 Jan 2021 03:30:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610451053; cv=none; d=google.com; s=arc-20160816; b=ULwTx2YFJubP5m3gc2rNr4onn3pKI4JRpBmGmXF5iWdfTS+NknvFs2dTy1xsv/LYiH NZARjV/0U6CnC8KquXznQrcuoHbNis9WZifXhyeXzq2/A5yYD5JdeTtJ72LjTx/xcv3j vuvtKot2yuVpttK7ab19H9TGa3IfHvZm0WTz6R0AqVfZ0JWFR9Znp75AkPHvqAMN0P43 UuPshHoSW7nUlrzhkgSS/au2+7TgzeljvwX87wf50GN1a5oqYQ138cR8EsE5HSDF2zES cECQnpWsGRtJRmPlf8ZOEwDTkwUq2OR4yhZvp/EGbbHgwbrk4QXWR0Z353HXUq3B7mwW QRCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4ig/BzfwIsrlPajsj3oElCG90RaaTlGpS+pt8s/fcBI=; b=tZqIK20GJwbV9DH8hVplvND5PslESwH1bRPkF0WC4y7KIxFlw3p+mUPBawuuU8amch uvLpkr2xxYzWAMS2NvZ+hrDMrqHylJ5Zi4od9WH0t4b41HXGmwsWfeQ7z8ZIpYcp7hXE n04zXsE3PxGB63et9HoSeZ4v8SfPyB5boBVvn1fibuh562AZtuW7BZ3lZ1bZpA2U56Xs JALGKAVSmKkwH5fDi3+g/iywL4lzQ3DfqruwhHc5+WfdCxbV1tCodUWSkHpIiBhTNE+Q FuiTM6217VWpboBo1noK4uDou8cfx7FSXOSK0tYW1up1FGF0BvJUmwl1Vg45VrSKdD9x Y7iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=A+Jthmoc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o23si1112501edt.543.2021.01.12.03.30.30; Tue, 12 Jan 2021 03:30:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=A+Jthmoc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391753AbhALHD6 (ORCPT + 99 others); Tue, 12 Jan 2021 02:03:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:49028 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391531AbhALHD6 (ORCPT ); Tue, 12 Jan 2021 02:03:58 -0500 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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