Alexey Dobriyan
f7a5f132b4
proc: faster /proc/*/status
top(1) opens the following files for every PID:
/proc/*/stat
/proc/*/statm
/proc/*/status
This patch switches /proc/*/status away from seq_printf().
The result is 13.5% speedup.
Benchmark is open("/proc/self/status")+read+close 1.000.000 million times.
BEFORE
$ perf stat -r 10 taskset -c 3 ./proc-self-status
Performance counter stats for 'taskset -c 3 ./proc-self-status' (10 runs):
10748.474301 task-clock (msec) # 0.954 CPUs utilized ( +- 0.91% )
12 context-switches # 0.001 K/sec ( +- 1.09% )
1 cpu-migrations # 0.000 K/sec
104 page-faults # 0.010 K/sec ( +- 0.45% )
37,424,127,876 cycles # 3.482 GHz ( +- 0.04% )
8,453,010,029 stalled-cycles-frontend # 22.59% frontend cycles idle ( +- 0.12% )
3,747,609,427 stalled-cycles-backend # 10.01% backend cycles idle ( +- 0.68% )
65,632,764,147 instructions # 1.75 insn per cycle
# 0.13 stalled cycles per insn ( +- 0.00% )
13,981,324,775 branches # 1300.773 M/sec ( +- 0.00% )
138,967,110 branch-misses # 0.99% of all branches ( +- 0.18% )
11.263885428 seconds time elapsed ( +- 0.04% )
^^^^^^^^^^^^
AFTER
$ perf stat -r 10 taskset -c 3 ./proc-self-status
Performance counter stats for 'taskset -c 3 ./proc-self-status' (10 runs):
9010.521776 task-clock (msec) # 0.925 CPUs utilized ( +- 1.54% )
11 context-switches # 0.001 K/sec ( +- 1.54% )
1 cpu-migrations # 0.000 K/sec ( +- 11.11% )
103 page-faults # 0.011 K/sec ( +- 0.60% )
32,352,310,603 cycles # 3.591 GHz ( +- 0.07% )
7,849,199,578 stalled-cycles-frontend # 24.26% frontend cycles idle ( +- 0.27% )
3,269,738,842 stalled-cycles-backend # 10.11% backend cycles idle ( +- 0.73% )
56,012,163,567 instructions # 1.73 insn per cycle
# 0.14 stalled cycles per insn ( +- 0.00% )
11,735,778,795 branches # 1302.453 M/sec ( +- 0.00% )
98,084,459 branch-misses # 0.84% of all branches ( +- 0.28% )
9.741247736 seconds time elapsed ( +- 0.07% )
^^^^^^^^^^^
Link: http://lkml.kernel.org/r/20160806125608.GB1187@p183.telecom.by
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-07 18:46:30 -07:00
..
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-07-31 16:37:25 -04:00
2016-09-08 11:10:12 +01:00
2016-10-06 09:52:23 -07:00
2016-05-23 17:04:14 -07:00
2016-05-09 11:41:14 -04:00
2016-09-23 13:39:37 -07:00
2016-08-03 13:33:26 -04:00
2016-09-05 14:30:35 +02:00
2016-09-09 23:58:07 -05:00
2016-05-29 19:08:00 -04:00
2016-09-16 12:58:28 +02:00
2016-05-09 11:41:14 -04:00
2016-09-10 01:18:57 -04:00
2016-09-27 12:45:57 +02:00
2016-09-23 11:31:31 +02:00
2016-08-26 13:22:14 -05:00
2016-07-08 10:35:28 -05:00
2016-09-09 16:08:48 +01:00
2016-05-20 17:58:30 -07:00
2016-06-07 13:41:38 -06:00
2016-05-02 19:49:29 -04:00
2016-10-07 18:46:28 -07:00
2016-10-07 18:46:28 -07:00
2016-10-06 15:30:40 -07:00
2016-08-07 10:01:14 -04:00
2016-06-13 10:20:39 +02:00
2016-06-30 23:34:49 -04:00
2016-10-03 11:06:05 +02:00
2016-10-04 13:42:13 -07:00
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-08-04 00:18:10 +02:00
2016-07-31 16:37:25 -04:00
2016-10-07 18:46:29 -07:00
2016-07-31 16:37:25 -04:00
2016-07-26 18:35:55 -07:00
2016-06-10 20:21:46 -07:00
2016-09-06 12:17:24 -05:00
2016-08-31 14:48:52 +02:00
2016-07-28 12:59:05 -07:00
2016-08-06 09:49:02 -04:00
2016-05-02 19:49:32 -04:00
2016-07-31 16:37:25 -04:00
2016-10-07 18:46:28 -07:00
2015-08-13 10:22:06 -04:00
2016-08-12 16:10:25 -04:00
2016-08-02 19:35:21 -04:00
2016-10-07 18:46:26 -07:00
2016-07-28 12:59:05 -07:00
2016-10-07 18:46:26 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-10-03 15:07:36 -04:00
2016-10-04 14:48:27 -07:00
2016-10-07 18:46:30 -07:00
2016-09-08 15:01:13 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-08-15 17:43:31 +02:00
2016-09-19 15:36:17 -07:00
2016-09-16 17:20:59 +02:00
2016-05-09 11:41:15 -04:00
2016-06-07 13:41:38 -06:00
2016-09-27 12:24:29 +02:00
2016-06-10 20:21:46 -07:00
2016-05-29 16:22:07 -04:00
2016-08-23 23:02:52 +02:00
2016-09-19 10:47:01 +02:00
2016-07-28 12:59:05 -07:00
2016-10-07 18:46:28 -07:00
2016-09-15 15:49:28 -07:00
2016-07-05 15:06:46 -05:00
2016-05-27 20:09:16 -04:00
2016-05-28 16:34:59 -07:00
2016-07-25 16:51:49 +10:00
2016-09-14 21:28:10 +02:00
2016-08-02 19:35:15 -04:00
2016-07-28 13:29:12 +10:00
2016-08-07 10:13:14 -04:00
2016-08-25 08:38:26 -06:00
2016-07-27 09:53:35 -07:00
2016-07-14 16:21:53 +09:00
2016-06-28 10:00:13 -03:00
2016-05-24 12:55:26 -07:00
2016-06-07 22:07:09 -04:00
2016-10-07 18:46:28 -07:00
2016-08-07 10:01:14 -04:00
2016-06-07 13:41:38 -06:00
2015-08-17 18:39:46 -04:00
2016-03-22 15:36:02 -07:00
2016-05-19 19:12:14 -07:00
2016-08-04 18:04:44 -04:00
2016-01-09 02:55:37 -05:00
2016-03-22 15:36:02 -07:00
2015-08-07 04:39:40 +03:00
2016-05-02 19:49:28 -04:00
2016-01-19 12:02:23 -05:00
2016-08-09 19:58:06 -06:00
2016-08-07 10:01:14 -04:00
2016-09-19 11:24:49 +10:00
2016-09-15 13:29:52 -07:00
2016-10-03 09:53:59 +11:00
2016-10-07 18:46:29 -07:00
2016-08-12 16:47:05 +01:00
2016-06-20 17:11:29 -04:00
2016-10-04 13:36:19 -07:00
2016-06-21 09:23:11 +10:00
2016-02-22 22:44:04 -05:00
2016-09-30 12:46:48 -05:00
2016-08-07 14:41:02 -06:00
2016-08-07 10:03:31 -04:00
2016-09-30 12:46:48 -05:00
2016-09-22 20:06:20 -05:00
2016-08-07 10:13:14 -04:00
2016-08-09 10:14:10 -07:00
2016-09-30 12:46:48 -05:00
2016-09-30 12:46:48 -05:00
2016-07-29 15:54:19 -07:00
2016-03-16 13:09:08 -04:00
2016-07-15 10:30:26 +02:00
2016-05-26 00:13:25 -04:00
2016-05-19 19:12:14 -07:00
2016-08-26 17:39:35 -07:00
2015-08-07 04:39:40 +03:00
2016-05-11 00:00:29 -04:00
2016-01-16 11:17:23 -08:00
2016-07-29 15:54:19 -07:00
2016-04-04 10:41:08 -07:00
2016-06-09 23:42:38 +02:00
2016-07-26 16:19:19 -07:00
2016-08-07 10:03:31 -04:00
2016-07-05 15:06:46 -05:00