eventfd: move 'eventfd-count' printing out of spinlock
authorWen Yang <wenyang.linux@foxmail.com>
Mon, 15 Jan 2024 15:27:00 +0000 (23:27 +0800)
committerChristian Brauner <brauner@kernel.org>
Tue, 23 Jan 2024 16:56:29 +0000 (17:56 +0100)
commitbd46543d7f9a8b2c03420499b1885287e96aaf28
tree52a195002a8ac09a8a83840b0351fa4c176da5e1
parent3948abaa4e2be938ccdfc289385a27342fb13d43
eventfd: move 'eventfd-count' printing out of spinlock

When printing eventfd->count, interrupts will be disabled and a spinlock
will be obtained, competing with eventfd_write(). By moving the
"eventfd-count" print out of the spinlock and merging multiple
seq_printf() into one, it could improve a bit, just like timerfd_show().

Signed-off-by: Wen Yang <wenyang.linux@foxmail.com>
Link: https://lore.kernel.org/r/tencent_B0B3D2BD9861FD009E03AB18A81783322709@qq.com
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dylan Yudaken <dylany@fb.com>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Eric Biggers <ebiggers@google.com>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/eventfd.c