close on evdev file descriptor slow

From: Andreas Otto <hidden>
Date: 2020-02-24 21:45:48

Hi,

when I strace -r the following program

  #include <unistd.h>
  #include <fcntl.h>
  int main()
  {
    int fd = open("/dev/input/mice", O_RDONLY | O_NONBLOCK);
    close(fd);
    write(1, "dummy\n", 6);
  }

I get the following relevant output:

  0.000040 openat(AT_FDCWD, "/dev/input/mice", O_RDONLY|O_NONBLOCK) = 3
  0.000028 close(3)                  = 0
  0.043189 write(1, "dummy\n", 6)    = 6

Why is the close so slow?

Kernel version is 5.4.21.

I'd appreciate if I could be cc'd, since I'm not subscribed to the list.

All the best
Andreas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help