Hi Maxim, On Fri, Jul 17, 2020 at 2:56 PM Maxim Kochetkov <fido_max@xxxxxxxx> wrote: > I'm using libgpiod in userspace. > I have 6 gpiochip's on my board. > gpiod_line_find takes about 300ms to find GPIO line. > > gpiod_line_find calls gpiod_foreach_chip > then gpiod_chip_iter_next > then gpiod_chip_close then close(chip->fd) > then we are going to kernel gpiolib gpio_chrdev_release > then atomic_notifier_chain_unregister > then synchronize_rcu() > > synchronize_rcu takes about 30 ms (6*30ms=280ms) > > I tried to remove synchronize_rcu from atomic_notifier_chain_unregister > and gpiod_line_find takes about 2ms now. Interesting! Can you provide some context? Are you just testing because curious or do you need to meet a design objective? Did you use ftrace or similar instrumentation to drill down and find where time is spent? Yours, Linus Walleij