[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZBMWHUJfFnIX7F9y@casper.infradead.org>
Date: Thu, 16 Mar 2023 13:14:05 +0000
From: Matthew Wilcox <willy@...radead.org>
To: yang.yang29@....com.cn
Cc: akpm@...ux-foundation.org, hannes@...xchg.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
iamjoonsoo.kim@....com
Subject: Re: [PATCH linux-next] mm: workingset: simplify the calculation of workingset size
On Thu, Mar 16, 2023 at 05:23:05PM +0800, yang.yang29@....com.cn wrote:
> * Compare the distance to the existing workingset size. We
> * don't activate pages that couldn't stay resident even if
> - * all the memory was available to the workingset. Whether
> - * workingset competition needs to consider anon or not depends
> - * on having swap.
> + * all the memory was available to the workingset. For page
> + * cache whether workingset competition needs to consider
> + * anon or not depends on having swap.
I don't mind this change
> */
> workingset_size = lruvec_page_state(eviction_lruvec, NR_ACTIVE_FILE);
> + /* For anonymous page */
This comment adds no value
> if (!file) {
> + workingset_size += lruvec_page_state(eviction_lruvec,
> + NR_ACTIVE_ANON);
> workingset_size += lruvec_page_state(eviction_lruvec,
> NR_INACTIVE_FILE);
> - }
> - if (mem_cgroup_get_nr_swap_pages(eviction_memcg) > 0) {
> + /* For page cache */
Nor this one
> + } else if (mem_cgroup_get_nr_swap_pages(eviction_memcg) > 0) {
> workingset_size += lruvec_page_state(eviction_lruvec,
> NR_ACTIVE_ANON);
> - if (file) {
> - workingset_size += lruvec_page_state(eviction_lruvec,
> + workingset_size += lruvec_page_state(eviction_lruvec,
> NR_INACTIVE_ANON);
> - }
> }
I don't have an opinion on the actual code changes.
Powered by blists - more mailing lists