Re: [PATCH RFC v2 1/2] mm/zswap: replace the zswap_pools list with a fixed pools array

From: Jianyue Wu

Date: Tue Aug 11 2026 - 20:46:13 EST


On Wed, Aug 12, 2026 at 12:22 AM Yosry Ahmed <yosry@xxxxxxxxxx> wrote:
>
> > > > @@ -404,7 +437,11 @@ static void __zswap_pool_empty(struct percpu_ref *ref)
> > > >
> > > > WARN_ON(pool == zswap_pool_current());
> > > >
> > > > - list_del_rcu(&pool->list);
> > > > + /*
> > > > + * Clear the slot before scheduling the release so new readers cannot
> > > > + * see it; __zswap_pool_release()'s synchronize_rcu() drains the rest.
> > > > + */
> > > > + rcu_assign_pointer(zswap_pools[pool->idx], NULL);
> > > >
> > > > INIT_WORK(&pool->release_work, __zswap_pool_release);
> > > > schedule_work(&pool->release_work);
> > >
> > > Not related to this change, but I wonder if we can use call_rcu() or
> > > similar here instead of the manual synchronize_rcu().
> > Agree, will use call_rcu() to replace workqueue + synchronize_rcu(),
> > so it no longer synchronously waits on an RCU grace period.
>
> If you make this change, please do it in a separate patch. You can
> keep it a part of this series if it conflicts with it, otherwise you
> can send it separately. Thanks!

Thanks for the hint, I think I can use a separate patch.
I'll also check with CONFIG_DEBUG_ATOMIC_SLEEP to confirm no sleep
in atomic context.

Best regards,
Jianyue