[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=McJPStp5UcvRN23yHWL3LHuREvOtQVe2iodeQj85KCojA@mail.gmail.com>
Date: Tue, 11 Mar 2025 15:32:32 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Bartosz Golaszewski <brgl@...ev.pl>, Kent Gibson <warthog618@...il.com>,
Linus Walleij <linus.walleij@...aro.org>, David Jander <david@...tonic.nl>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH RFT v2] gpio: cdev: use raw notifier for line state events
On Tue, Mar 11, 2025 at 3:31 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> We use a notifier to implement the mechanism of informing the user-space
> about changes in GPIO line status. We register with the notifier when
> the GPIO character device file is opened and unregister when the last
> reference to the associated file descriptor is dropped.
>
> Since commit fcc8b637c542 ("gpiolib: switch the line state notifier to
> atomic") we use the atomic notifier variant. Atomic notifiers call
> rcu_synchronize in atomic_notifier_chain_unregister() which caused a
> significant performance regression in some circumstances, observed by
> user-space when calling close() on the GPIO device file descriptor.
>
> Replace the atomic notifier with the raw variant and provide
> synchronization with a read-write spinlock.
>
> Fixes: fcc8b637c542 ("gpiolib: switch the line state notifier to atomic")
> Reported-by: David Jander <david@...tonic.nl>
> Closes: https://lore.kernel.org/all/20250311110034.53959031@erd003.prtnl/
> Tested-by: David Jander <david@...tonic.nl>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> ---
Ah, dang it, I didn't drop the RFT prefix from b4 config...
Bart
Powered by blists - more mailing lists