[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKEwX=OatEx57bOFBb5KNwvDhp4gMZhpjKw356fj4xzanqMJHw@mail.gmail.com>
Date: Tue, 11 Jun 2024 09:32:56 -0700
From: Nhat Pham <nphamcs@...il.com>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Johannes Weiner <hannes@...xchg.org>,
Chengming Zhou <chengming.zhou@...ux.dev>, Barry Song <21cnbao@...il.com>,
Chris Li <chrisl@...nel.org>, David Hildenbrand <david@...hat.com>,
Matthew Wilcox <willy@...radead.org>, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/3] mm: zswap: add zswap_never_enabled()
On Mon, Jun 10, 2024 at 7:45 PM Yosry Ahmed <yosryahmed@...gle.com> wrote:
>
> Add zswap_never_enabled() to skip the xarray lookup in zswap_load() if
> zswap was never enabled on the system. It is implemented using static
> branches for efficiency, as enabling zswap should be a rare event. This
> could shave some cycles off zswap_load() when CONFIG_ZSWAP is used but
> zswap is never enabled.
>
> However, the real motivation behind this patch is two-fold:
> - Incoming large folio swapin work will need to fallback to order-0
> folios if zswap was ever enabled, because any part of the folio could
> be in zswap, until proper handling of large folios with zswap is
> added.
>
> - A warning and recovery attempt will be added in a following change in
> case the above was not done incorrectly. Zswap will fail the read if
> the folio is large and it was ever enabled.
>
> Signed-off-by: Yosry Ahmed <yosryahmed@...gle.com>
This LGTM.
Reviewed-by: Nhat Pham <nphamcs@...il.com>
Powered by blists - more mailing lists