[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20230415032305.3860-1-sj@kernel.org>
Date: Sat, 15 Apr 2023 03:23:05 +0000
From: SeongJae Park <sj@...nel.org>
To: "Paul E . McKenney" <paulmck@...nel.org>
Cc: SeongJae Park <sj@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
akpm@...ux-foundation.org, vbabka@...e.cz, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] mm/slab: break up RCU readers on SLAB_TYPESAFE_BY_RCU example code
On Sat, 15 Apr 2023 03:04:52 +0000 SeongJae Park <sj@...nel.org> wrote:
> On Sat, 15 Apr 2023 03:51:54 +0100 Matthew Wilcox <willy@...radead.org> wrote:
>
> > On Sat, Apr 15, 2023 at 12:37:53AM +0000, SeongJae Park wrote:
> > > *
> > > + * begin:
> > > * rcu_read_lock();
> > > - * again:
> > > * obj = lockless_lookup(key);
> > > * if (obj) {
> > > * if (!try_get_ref(obj)) // might fail for free objects
> > > - * goto again;
> > > + * goto begin;
I simply followed the commit da82af04352b ("doc: Update and wordsmith
rculist_nulls.rst") for this change, and I think I overlooked this part. If
I'm not missing something, I think we should call rcu_read_unlock() here too,
just before 'goto begin'.
I will post another patch for rculist_null.rst later.
Thanks,
SJ
> > > *
> > > * if (obj->key != key) { // not the object we expected
> > > * put_ref(obj);
> > > + * rcu_read_unlock();
> > > * goto again;
> >
> > - * goto again;
> > + * goto begin;
>
> Oops, thank you for catching, Matthew!
>
>
> Thanks,
> SJ
Powered by blists - more mailing lists