Re: [PATCH] mm: kill frontswap

From: Johannes Weiner
Date: Mon Jul 17 2023 - 17:51:11 EST


On Mon, Jul 17, 2023 at 05:07:46PM +0100, Matthew Wilcox wrote:
> On Mon, Jul 17, 2023 at 12:02:27PM -0400, Johannes Weiner wrote:
> > - pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s%s\n",
> > + pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s\n",
> > p->pages<<(PAGE_SHIFT-10), name->name, p->prio,
> > nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10),
> > (p->flags & SWP_SOLIDSTATE) ? "SS" : "",
> > (p->flags & SWP_DISCARDABLE) ? "D" : "",
> > (p->flags & SWP_AREA_DISCARD) ? "s" : "",
> > - (p->flags & SWP_PAGE_DISCARD) ? "c" : "",
> > - (frontswap_map) ? "FS" : "");
> > + (p->flags & SWP_PAGE_DISCARD) ? "c" : "");
>
> Is it useful information (to the sysadmin) that zswap is enabled? If so,
> we might want to print a "Z" instead of a "FS" here (would need to
> know whether enabling zswap succeeded ...)

I don't think it is needed in this particular place.

zswap prints to dmesg when it is initialized. And it's easy to runtime
check in sysfs or in /proc/meminfo if it's enabled - that's where I
would look first if I checked a system that's showing zswap issues -
not in the dmesg that may have long wrapped since swapon.

There is also a warning to dmesg if zswap fails to enable for a given
swapfile. But with the current page allocator implementation this
can't actually fail.