lkml.org 
[lkml]   [2023]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 11/19] lib/stackdepot: use read/write lock
On Mon, Oct 9, 2023 at 11:45 AM Alexander Potapenko <glider@google.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!

\
 
 \ /
  Last update: 2023-10-23 18:18    [W:0.353 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site