Re: [PATCH] mm/zblock: use vmalloc for page allocations
From: Sergey Senozhatsky
Date: Thu May 08 2025 - 02:07:48 EST
On (25/05/07 10:50), Uladzislau Rezki wrote:
> On Wed, May 07, 2025 at 03:08:08PM +0900, Sergey Senozhatsky wrote:
> > On (25/05/07 14:57), Sergey Senozhatsky wrote:
> > > On (25/05/06 13:13), Yosry Ahmed wrote:
> > > > If we can use vmalloc for zblock, then we can probably also use vmalloc
> > > > in zsmalloc and get rid of the chaining logic completely. This would
> > > > make zsmalloc simpler and closer to zblock in that regard.
> > > >
> > > > Sergey, WDYT?
> > >
> > > This sounds interesting. We might get rid of lots of memcpy()
> > > in object read/write paths, and so on. I don't know if 0-order
> > > chaining was the only option for zsmalloc, or just happened to
> > > be the first one.
> >
> > I assume we might have problems with zspage release path. vfree()
> > should break .swap_slot_free_notify, as far as I can see.
> > .swap_slot_free_notify is called under swap-cluster spin-lock,
> > so if we free the last object in the zspage we cannot immediately
> > free that zspage, because vfree() might_sleep().
> >
> you can use vfree_atomic(), it can be collected in any atomic but
> no in NMI.
Indeed, thanks.
A bigger problem than zspage release path is loosing GFP_MOVABLE,
I suspect.