Re: [PATCH RFC v2 1/2] mm/zswap: replace the zswap_pools list with a fixed pools array
From: Yosry Ahmed
Date: Tue Aug 11 2026 - 13:21:00 EST
> > > @@ -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!