]> 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>
Sat, 14 Dec 2024 18:47:42 +0000 (19:47 +0100)
commite05e8f54d23f4dc404745d058bba3c92fe3d9d2e
tree54d1d04d3eba66e036b795aa582e0890b67d8f9d
parent444c9d41210c4c53a26e474cb66a6603e42fc394
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