Re: [PATCH v4 01/53] perf comm: Use regular mutex

From: Namhyung Kim
Date: Sun Nov 05 2023 - 22:59:04 EST


On Sun, Nov 5, 2023 at 1:35 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> On Sun, Nov 5, 2023 at 9:32 AM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > Hi Ian,
> >
> > On Thu, Nov 2, 2023 at 10:58 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> > >
> > > The rwsem is only after used for writing so switch to a mutex that has
> > > better error checking.
> >
> > Hmm.. ok. It doesn't make sense to use rwsem without readers.
> >
> > >
> > > Fixes: 7a8f349e9d14 ("perf rwsem: Add debug mode that uses a mutex")
> >
> > But I'm not sure this is a fix. Other than that,
>
> Thanks Namhyung, it fixes the case that you enable RWS_ERRORCHECK in
> rwsem.h as the rwsem static initialization is wrong for a mutex.

Sounds like we need a separate fix. Maybe you need to
add a static initializer macro depending on the config.

Thanks,
Namhyung