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=-14.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL 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 7B83BFC6194 for ; Thu, 7 Nov 2019 02:50:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3942B2187F for ; Thu, 7 Nov 2019 02:50:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="n9PsUp0q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3942B2187F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DF8386B0006; Wed, 6 Nov 2019 21:50:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA7E06B0007; Wed, 6 Nov 2019 21:50:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE4E66B0008; Wed, 6 Nov 2019 21:50:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0140.hostedemail.com [216.40.44.140]) by kanga.kvack.org (Postfix) with ESMTP id B921E6B0006 for ; Wed, 6 Nov 2019 21:50:49 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 6485F181AEF1F for ; Thu, 7 Nov 2019 02:50:49 +0000 (UTC) X-FDA: 76127953818.18.sea07_725c0e3e8d10 X-HE-Tag: sea07_725c0e3e8d10 X-Filterd-Recvd-Size: 5225 Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Nov 2019 02:50:48 +0000 (UTC) Received: by mail-oi1-f193.google.com with SMTP id v138so652918oif.6 for ; Wed, 06 Nov 2019 18:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=10UEJHReRRkCxqogp9ovKAQzTbWMZb9ETtZvBc2w3vc=; b=n9PsUp0qLOLm3wGK6uOzCOXqKvmgPnWWAlsm+bH61fBp5I7s0DOeNJAHiWoawbMzlJ UBNhIcvRd60O+T2/7puYtioivkiGfDSKcW95AogUygR40udqSIvMMm1ctuaW1MbeH7B2 nx2IDJ7a8R52fGrCK8GjN5xYz1k8FzHSiINa/nW+Xi1UOfMK1SSkhxWNO1O4WL4xNDy7 YFx8ofRoa/3PuOrCSE4b/8D478nKxV63gjcYW8a5n1W00TtkmSSR/ERQeOS0FJhWDwpi MojGBQ5ILh+cI9z1z47DnjqqlWBvMytlSohM2JWKkAuA+it3n8s5M8f86M4QwUYvFHxv hJpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=10UEJHReRRkCxqogp9ovKAQzTbWMZb9ETtZvBc2w3vc=; b=R8yeKf8sERssZ9bHGeYNogkAkn6hG7V6UHsZL1+ZXErvL5MeDEBk8icrmYsqrFvZsn tQqwE8L0UvHKpzxeHJ0Aa16VUNjynisP9kxtxIyHcw7t5znCXO6dBaJNWKKwGcD5/+L8 XepDK9Y1cnsBa/Ww4jGzDGY8cPcH2u5JwZcsDJcEuLyk3v0mr72WbUcqk8iAcSG/W3vL K6pCXaOctIlPxr1FTsGSW42l1kfpRuzf1NIetX+qyEI75kU9H4rWqG7dkR3QxNH9JHbf mFtS+NUbLDdN/fL7MBYO2TakZAi97a+1DfJEVXpUDZ5fhP5OCbo7OSwyi/YtLui2s95g Ft2Q== X-Gm-Message-State: APjAAAUCIkUi259zV3KrU9Fx5Uldn4dnIyImCuZg2NjH1g008t3N/lhU C3S/TrCrhBCzylQO9RUgt5FCr52jSomU1roYZwEkzQ== X-Google-Smtp-Source: APXvYqzyjKzgEyRmRo9wOEa5cehiAL+Sv7Mn/3zkI13/srHen06wd5TqdFNxutTAASUvt49xy0qAPDm/qOCOQiKf/Tc= X-Received: by 2002:aca:f1c5:: with SMTP id p188mr1092234oih.125.1573095048014; Wed, 06 Nov 2019 18:50:48 -0800 (PST) MIME-Version: 1.0 References: <20190603210746.15800-1-hannes@cmpxchg.org> <20190603210746.15800-2-hannes@cmpxchg.org> In-Reply-To: <20190603210746.15800-2-hannes@cmpxchg.org> From: Shakeel Butt Date: Wed, 6 Nov 2019 18:50:37 -0800 Message-ID: Subject: Re: [PATCH 01/11] mm: vmscan: move inactive_list_is_low() swap check to the caller To: Johannes Weiner Cc: Andrew Morton , Andrey Ryabinin , Suren Baghdasaryan , Michal Hocko , Linux MM , Cgroups , LKML , Kernel Team Content-Type: text/plain; charset="UTF-8" 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, Jun 3, 2019 at 3:05 PM Johannes Weiner wrote: > > inactive_list_is_low() should be about one thing: checking the ratio > between inactive and active list. Kitchensink checks like the one for > swap space makes the function hard to use and modify its > callsites. Luckly, most callers already have an understanding of the > swap situation, so it's easy to clean up. > > get_scan_count() has its own, memcg-aware swap check, and doesn't even > get to the inactive_list_is_low() check on the anon list when there is > no swap space available. > > shrink_list() is called on the results of get_scan_count(), so that > check is redundant too. > > age_active_anon() has its own totalswap_pages check right before it > checks the list proportions. > > The shrink_node_memcg() site is the only one that doesn't do its own > swap check. Add it there. > > Then delete the swap check from inactive_list_is_low(). > > Signed-off-by: Johannes Weiner Reviewed-by: Shakeel Butt > --- > mm/vmscan.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 84dcb651d05c..f396424850aa 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2165,13 +2165,6 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file, > unsigned long refaults; > unsigned long gb; > > - /* > - * If we don't have swap space, anonymous page deactivation > - * is pointless. > - */ > - if (!file && !total_swap_pages) > - return false; > - > inactive = lruvec_lru_size(lruvec, inactive_lru, sc->reclaim_idx); > active = lruvec_lru_size(lruvec, active_lru, sc->reclaim_idx); > > @@ -2592,7 +2585,7 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc > * Even if we did not try to evict anon pages at all, we want to > * rebalance the anon lru active/inactive ratio. > */ > - if (inactive_list_is_low(lruvec, false, sc, true)) > + if (total_swap_pages && inactive_list_is_low(lruvec, false, sc, true)) > shrink_active_list(SWAP_CLUSTER_MAX, lruvec, > sc, LRU_ACTIVE_ANON); > } > -- > 2.21.0 >