[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87czkyzhfe.fsf@linux.ibm.com>
Date: Tue, 11 Jan 2022 16:07:57 +0530
From: "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
To: Yu Zhao <yuzhao@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andi Kleen <ak@...ux.intel.com>,
Catalin Marinas <catalin.marinas@....com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Hillf Danton <hdanton@...a.com>, Jens Axboe <axboe@...nel.dk>,
Jesse Barnes <jsbarnes@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Jonathan Corbet <corbet@....net>,
Matthew Wilcox <willy@...radead.org>,
Mel Gorman <mgorman@...e.de>,
Michael Larabel <Michael@...haellarabel.com>,
Michal Hocko <mhocko@...nel.org>,
Rik van Riel <riel@...riel.com>,
Vlastimil Babka <vbabka@...e.cz>,
Will Deacon <will@...nel.org>,
Ying Huang <ying.huang@...el.com>,
linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
page-reclaim@...gle.com, x86@...nel.org,
Yu Zhao <yuzhao@...gle.com>,
Konstantin Kharlamov <Hi-Angel@...dex.ru>
Subject: Re: [PATCH v6 7/9] mm: multigenerational lru: eviction
...
+static int isolate_folios(struct lruvec *lruvec, struct scan_control *sc, int swappiness,
> + int *type_scanned, struct list_head *list)
> +{
> + int i;
> + int type;
> + int scanned;
> + int tier = -1;
> + DEFINE_MIN_SEQ(lruvec);
> +
> + VM_BUG_ON(!seq_is_valid(lruvec));
> +
> + /*
> + * Try to make the obvious choice first. When anon and file are both
> + * available from the same generation, interpret swappiness 1 as file
> + * first and 200 as anon first.
> + */
> + if (!swappiness)
> + type = 1;
> + else if (min_seq[0] < min_seq[1])
> + type = 0;
> + else if (swappiness == 1)
> + type = 1;
> + else if (swappiness == 200)
> + type = 0;
> + else
> + type = get_type_to_scan(lruvec, swappiness, &tier);
> +
Wondering wether it will make it simpler to use
#define ANON 0
#define FILE 1
and then
else if (min_seq[ANON] < min_seq[FILE])
type = ANON;
The usage of 0/1 across code do confuse
-aneesh
Powered by blists - more mailing lists