Re: [PATCH v8 12/17] zsmalloc: introduce new object mapping API
From: Sergey Senozhatsky
Date: Mon Feb 24 2025 - 23:30:14 EST
On (25/02/24 10:01), Sebastian Andrzej Siewior wrote:
> Date: Mon, 24 Feb 2025 10:01:54 +0100
> From: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> To: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Yosry Ahmed
> <yosry.ahmed@xxxxxxxxx>, Hillf Danton <hdanton@xxxxxxxx>, Kairui Song
> <ryncsn@xxxxxxxxx>, Minchan Kim <minchan@xxxxxxxxxx>, linux-mm@xxxxxxxxx,
> linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v8 12/17] zsmalloc: introduce new object mapping API
> Message-ID: <20250224090154.7Xlsipmu@xxxxxxxxxxxxx>
>
> On 2025-02-22 07:25:43 [+0900], Sergey Senozhatsky wrote:
> > index 03710d71d022..1288a4120855 100644
> > --- a/mm/zsmalloc.c
> > +++ b/mm/zsmalloc.c
> > @@ -1377,6 +1377,135 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle)
> > }
> > EXPORT_SYMBOL_GPL(zs_unmap_object);
> >
> > +void *zs_obj_read_begin(struct zs_pool *pool, unsigned long handle,
> > + void *local_copy)
> > +{
> > + struct zspage *zspage;
> > + struct zpdesc *zpdesc;
> > + unsigned long obj, off;
> > + unsigned int obj_idx;
> > + struct size_class *class;
> > + void *addr;
> > +
> > + WARN_ON(in_interrupt());
>
> This macro is deprecated. Could you come up with something else like
> !in_task() if needed?
This was derived from the current zsmalloc object mapping API
BUG_ON(in_interrupt());
but converted from BUG_ON() to WARN_ON(). I guess I can drop
entirely tho.