diff options
author | Rasmus Villemoes <[email protected]> | 2016-12-12 16:45:25 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2016-12-12 18:55:09 -0800 |
commit | 209b14dc030760d3a17029a5c3bd92c9d6fd3f37 (patch) | |
tree | 3c48f90dea40257ef96b2a64d3d405a84a5a7376 /scripts/gcc-plugins/cyc_complexity_plugin.c | |
parent | 492b2da6056e7051917516368e75e062422c3557 (diff) |
fs/proc/array.c: slightly improve render_sigset_t
format_decode and vsnprintf occasionally show up in perf top, so I went
looking for places that might not need the full printf power. With the
help of kprobes, I gathered some statistics on which format strings we
mostly pass to vsnprintf. On a trivial desktop workload, I hit "%x" 25%
of the time, so something apparently reads /proc/pid/status (which does
5*16 printf("%x") calls) a lot.
With this patch, reading /proc/pid/status is 30% faster according to
this microbenchmark:
char buf[4096];
int i, fd;
for (i = 0; i < 10000; ++i) {
fd = open("/proc/self/status", O_RDONLY);
read(fd, buf, sizeof(buf));
close(fd);
}
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Rasmus Villemoes <[email protected]>
Acked-by: Andrei Vagin <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/cyc_complexity_plugin.c')
0 files changed, 0 insertions, 0 deletions