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=-9.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 5820BC4363D for ; Fri, 25 Sep 2020 12:08:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A00CE21D7A for ; Fri, 25 Sep 2020 12:08:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="q+VCo7i6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A00CE21D7A Authentication-Results: mail.kernel.org; dmarc=fail (p=none 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 B13316B0073; Fri, 25 Sep 2020 08:08:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9C846B0074; Fri, 25 Sep 2020 08:08:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 965CD8E0001; Fri, 25 Sep 2020 08:08:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id 7AE316B0073 for ; Fri, 25 Sep 2020 08:08:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3B88E365B for ; Fri, 25 Sep 2020 12:08:02 +0000 (UTC) X-FDA: 77301460404.11.net75_590e63627167 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 10FE2180F8B80 for ; Fri, 25 Sep 2020 12:08:02 +0000 (UTC) X-HE-Tag: net75_590e63627167 X-Filterd-Recvd-Size: 3278 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Fri, 25 Sep 2020 12:08:01 +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=1601035680; h=from:from:reply-to:subject:subject: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=nszEjIbYTATgPqb+Wk4ZGDbaqZhHCtp9XSNVJYKEvy0=; b=q+VCo7i6IDMjHdNeb2ShtmdpxF5dyBun/fvUPXZDpz5l5IhszELfmnmqXA4D3lAeF1OJWp ALssYZGibZRJnwKn+UyBHnRq+0EIr0B+GUUA022gn3X7w+8dZkO6vxQpc/FHVxcSTEqsP8 XC15E60nVJi4NyZxJlnUAPcyA8YoZIM= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5EB78AC55; Fri, 25 Sep 2020 12:08:00 +0000 (UTC) Date: Fri, 25 Sep 2020 14:07:58 +0200 From: Michal Hocko To: zhongjiang-ali Cc: hannes@cmpxchg.org, akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: Do not deactivate when the cgroup has plenty inactive page Message-ID: <20200925120758.GF3389@dhcp22.suse.cz> References: <1601034552-95831-1-git-send-email-zhongjiang-ali@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1601034552-95831-1-git-send-email-zhongjiang-ali@linux.alibaba.com> 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 Fri 25-09-20 19:49:12, zhongjiang-ali wrote: > After appling the series patches(mm: fix page aging across multiple cgroups), > cgroup memory reclaim strategy is based on reclaim root's inactive:active > ratio. if the target lruvec need to deactivate, its children cgroup also will > deactivate. That will result in hot page to be reclaimed and other cgroup's > cold page will be left, which is not expected. > > The patch will not force deactivate when inactive_is_low is not true unless > we has scanned the inactive list and memory is unable to reclaim. Do you have any data to present? > Signed-off-by: zhongjiang-ali > --- > mm/vmscan.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 466fc31..77d395f 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2407,8 +2407,21 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, > case SCAN_FILE: > case SCAN_ANON: > /* Scan one type exclusively */ > - if ((scan_balance == SCAN_FILE) != file) > + if ((scan_balance == SCAN_FILE) != file) { > scan = 0; > + } else { > + /* > + * Reclaim memory is based on the root's inactive: active > + * ratio, but it is possible that silbing cgroup has a lot > + * of cold memory to reclaim rather than reclaim the hot > + * cache in the current cgroup. > + */ > + if (!sc->force_deactivate && is_active_lru(lru) && > + !inactive_is_low(lruvec, lru - LRU_ACTIVE)) { > + if (sc->may_deactivate & (1 << file)) > + scan = 0; > + } > + } > break; > default: > /* Look ma, no brain */ > -- > 1.8.3.1 > -- Michal Hocko SUSE Labs