]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
proc/softirqs: replace seq_printf with seq_put_decimal_ull_width
authorDavid Wang <00107082@163.com>
Wed, 6 Nov 2024 02:12:28 +0000 (10:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 09:59:29 +0000 (10:59 +0100)
commit69ec929028e24617e073fc433d6ea1699507f0de
tree304440ad11eefccbb5a735371a031240ef84339e
parent13e82c27c8aa3465ae745de7c20bd6a4d838a386
proc/softirqs: replace seq_printf with seq_put_decimal_ull_width

[ Upstream commit 84b9749a3a704dcc824a88aa8267247c801d51e4 ]

seq_printf is costy, on a system with n CPUs, reading /proc/softirqs
would yield 10*n decimal values, and the extra cost parsing format string
grows linearly with number of cpus. Replace seq_printf with
seq_put_decimal_ull_width have significant performance improvement.
On an 8CPUs system, reading /proc/softirqs show ~40% performance
gain with this patch.

Signed-off-by: David Wang <00107082@163.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/proc/softirqs.c