[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAPL-u-OgmT+R=txfO_rFaYLKC0UZ5xEmFOY3spVHEmk_r4iSQ@mail.gmail.com>
Date: Wed, 7 Apr 2021 11:40:13 -0700
From: Wei Xu <weixugc@...gle.com>
To: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
shy828301@...il.com, Greg Thelen <gthelen@...gle.com>,
David Rientjes <rientjes@...gle.com>, ying.huang@...el.com,
Dan Williams <dan.j.williams@...el.com>, david@...hat.com,
osalvador@...e.de
Subject: Re: [PATCH 07/10] mm/vmscan: add helper for querying ability to age
anonymous pages
> +/*
> + * Anonymous LRU management is a waste if there is
> + * ultimately no way to reclaim the memory.
> + */
> +bool anon_should_be_aged(struct lruvec *lruvec)
> +{
> + struct pglist_data *pgdat = lruvec_pgdat(lruvec);
> +
> + /* Aging the anon LRU is valuable if swap is present: */
> + if (total_swap_pages > 0)
> + return true;
> +
> + /* Also valuable if anon pages can be demoted: */
> + if (next_demotion_node(pgdat->node_id) >= 0)
> + return true;
> +
> + /* No way to reclaim anon pages. Should not age anon LRUs: */
> + return false;
> +}
anon_should_be_aged() doesn't really need "lruvec". It essentially
answers whether the pages of the given node can be swapped or demoted.
So it would be clearer and less confusing if anon_should_be_aged()
takes "pgdat" instead of "lruvec" as the argument. The call to
mem_cgroup_lruvec(NULL, pgdat) in age_active_anon() can then be removed
as well.
Powered by blists - more mailing lists