[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+fCnZfDRx6VMSevQKfYYwCj49iqsKMaPaWt95rug-nw8Pgx8w@mail.gmail.com>
Date: Mon, 23 Oct 2023 18:16:42 +0200
From: Andrey Konovalov <andreyknvl@...il.com>
To: Alexander Potapenko <glider@...gle.com>
Cc: andrey.konovalov@...ux.dev, Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>, kasan-dev@...glegroups.com,
Evgenii Stepanov <eugenis@...gle.com>,
Oscar Salvador <osalvador@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrey Konovalov <andreyknvl@...gle.com>
Subject: Re: [PATCH v2 11/19] lib/stackdepot: use read/write lock
On Mon, Oct 9, 2023 at 11:45 AM Alexander Potapenko <glider@...gle.com> wrote:
>
> > static struct stack_record *depot_fetch_stack(depot_stack_handle_t handle)
> > {
> > union handle_parts parts = { .handle = handle };
> > - /*
> > - * READ_ONCE pairs with potential concurrent write in
> > - * depot_init_pool.
> > - */
> > - int pools_num_cached = READ_ONCE(pools_num);
> > void *pool;
> > size_t offset = parts.offset << DEPOT_STACK_ALIGN;
> > struct stack_record *stack;
> >
> > - if (parts.pool_index > pools_num_cached) {
> > + lockdep_assert_held(&pool_rwlock);
>
> Shouldn't it be lockdep_assert_held_read()?
Indeed, this is more precise. Will fix in v3, thanks!
Powered by blists - more mailing lists