[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230530235447.GB102494@cmpxchg.org>
Date: Tue, 30 May 2023 19:54:47 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Seth Jennings <sjenning@...hat.com>,
Dan Streetman <ddstreet@...e.org>,
Vitaly Wool <vitaly.wool@...sulko.com>,
Nhat Pham <nphamcs@...il.com>,
Domenico Cerasuolo <cerasuolodomenico@...il.com>,
Yu Zhao <yuzhao@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: zswap: support exclusive loads
On Tue, May 30, 2023 at 09:02:51PM +0000, Yosry Ahmed wrote:
> @@ -216,8 +216,13 @@ int __frontswap_load(struct page *page)
>
> /* Try loading from each implementation, until one succeeds. */
> ret = frontswap_ops->load(type, offset, page);
> - if (ret == 0)
> + if (ret == 0) {
> inc_frontswap_loads();
> + if (frontswap_ops->exclusive_loads) {
> + SetPageDirty(page);
> + __frontswap_clear(sis, offset);
> + }
Somewhat tangential, but is there still a point to the frontswap
layer? It seems usecases other than zswap have never materialized, at
least not in tree. Life would be a lot easier if we were to just
hardcode the zswap callbacks in the swap functions.
It's not the patch's fault, but it highlights the boiler plate the
indirection causes. ->load() already has the page and could just dirty
it directly. Instead now both layers have to handle invalidation,
which is a vector for bugs.
Can somebody think of reasons to keep it? If not, I'd take a stab at
removing it.
Powered by blists - more mailing lists