[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28ed23c00effdd531a9e027feb0bc08e22fc677d@linux.dev>
Date: Thu, 13 Feb 2025 01:12:51 +0000
From: "Yosry Ahmed" <yosry.ahmed@...ux.dev>
To: "Sergey Senozhatsky" <senozhatsky@...omium.org>
Cc: "Sergey Senozhatsky" <senozhatsky@...omium.org>, "Andrew Morton"
<akpm@...ux-foundation.org>, "Kairui Song" <ryncsn@...il.com>, "Minchan
Kim" <minchan@...nel.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 10/18] zsmalloc: factor out pool locking helpers
February 12, 2025 at 4:57 PM, "Sergey Senozhatsky" <senozhatsky@...omium.org> wrote:
>
> On (25/02/12 16:18), Yosry Ahmed wrote:
>
> >
> > On Wed, Feb 12, 2025 at 03:27:08PM +0900, Sergey Senozhatsky wrote:
> >
> > We currently have a mix of migrate_{read,write}_lock() helpers
> >
> > that lock zspages, but it's zs_pool that actually has a ->migrate_lock
> >
> > access to which is opene-coded. Factor out pool migrate locking
> >
> > into helpers, zspage migration locking API will be renamed to
> >
> > reduce confusion.
> >
> >
> >
> > It's worth mentioning that zsmalloc locks sync not only migration,
> >
> > but also compaction.
> >
> >
> >
> > Signed-off-by: Sergey Senozhatsky <senozhatsky@...omium.org>
> >
> >
> >
> > FWIW I don't see a lot of value in the helpers (renaming the lock is
> >
> > useful tho).
> >
>
> I want to hide the details, keep them in one place and at some
>
> point *in the future* have the same "locking rules" as for zspage
>
> lock. Also *possibly* throwing a couple of lockdep assertions.
>
> So I'd prefer to abstract all of these.
I'd prefer to introduce the abstractions when they are needed tbh. Right now they just make the code less readable.
Powered by blists - more mailing lists