Re: regression: gpiolib: switch the line state notifier to atomic unexpected impact on performance

From: Bartosz Golaszewski
Date: Tue Mar 11 2025 - 09:23:21 EST


On Tue, Mar 11, 2025 at 1:30 PM David Jander <david@xxxxxxxxxxx> wrote:
>
> On Tue, 11 Mar 2025 12:45:51 +0100
> Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> > On Tue, Mar 11, 2025 at 11:01 AM David Jander <david@xxxxxxxxxxx> wrote:
> > >
> > > On kernel 6.13, after git revert -n fcc8b637c542 time is back to what it was
> > > on 6.12.
> > >
> >
> > Interestingly: I cannot reproduce it. Obviously gpiofind doesn't exist
> > in libgpiod v2 but I'm running gpiodetect with and without reverting
> > these changes and am getting roughly the same results: ~0.050s real
> > time for 1 up to 4 chips.
> >
> > Any idea why that could be? Can you reproduce it with libgpiod v2 (I
> > don't know why that wouldn't be the case but worth double checking).
>
>
> Can you describe your platform? Is it a multi-core or single-core CPU? What
> RCU implementation does it use? Tree or tiny? If it is multi-core, is there a
> difference if you disable all but one core?
> Maybe some kernel CONFIG option that makes a difference? I am not an expert in
> RCU (in fact I barely know what it does), so maybe I am missing something that
> makes this problem go away?
>

I'm testing on a qemu VM - SMP and single core. RCU algo is tree. In
any case: I've just sent you an RFT patch that switches to using the
raw notifier. Could you see what results you're getting with it?

Bart