Andrei Vagin 0e3dc01914 procfs: add seq_put_hex_ll to speed up /proc/pid/maps
seq_put_hex_ll() prints a number in hexadecimal notation and works
faster than seq_printf().

== test.py
  num = 0
  with open("/proc/1/maps") as f:
          while num < 10000 :
                  data = f.read()
                  f.seek(0, 0)
                 num = num + 1
==

== Before patch ==
  $  time python test.py

  real	0m1.561s
  user	0m0.257s
  sys	0m1.302s

== After patch ==
  $ time python test.py

  real	0m0.986s
  user	0m0.279s
  sys	0m0.707s

$ perf -g record python test.py:

== Before patch ==
-   67.42%     2.82%  python   [kernel.kallsyms] [k] show_map_vma.isra.22
   - 64.60% show_map_vma.isra.22
      - 44.98% seq_printf
         - seq_vprintf
            - vsnprintf
               + 14.85% number
               + 12.22% format_decode
                 5.56% memcpy_erms
      + 15.06% seq_path
      + 4.42% seq_pad
   + 2.45% __GI___libc_read

== After patch ==
-   47.35%     3.38%  python   [kernel.kallsyms] [k] show_map_vma.isra.23
   - 43.97% show_map_vma.isra.23
      + 20.84% seq_path
      - 15.73% show_vma_header_prefix
           10.55% seq_put_hex_ll
         + 2.65% seq_put_decimal_ull
           0.95% seq_putc
      + 6.96% seq_pad
   + 2.94% __GI___libc_read

[avagin@openvz.org: use unsigned int instead of int where it is suitable]
  Link: http://lkml.kernel.org/r/20180214025619.4005-1-avagin@openvz.org
[avagin@openvz.org: v2]
  Link: http://lkml.kernel.org/r/20180117082050.25406-1-avagin@openvz.org
Link: http://lkml.kernel.org/r/20180112185812.7710-1-avagin@openvz.org
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-11 10:28:32 -07:00
..
2018-02-14 09:43:22 -08:00
2017-11-14 16:49:31 -08:00
2017-11-28 16:30:38 +01:00
2018-02-01 09:51:57 -08:00
2018-01-01 22:54:42 -08:00
2018-04-10 10:22:27 -07:00
2018-04-04 22:11:36 +02:00
2018-02-20 11:34:54 +00:00
2018-03-08 13:56:24 +05:30
2018-03-29 14:29:55 -04:00
2018-04-07 12:08:19 -07:00
2018-04-05 21:29:35 -07:00
2018-04-05 10:42:07 -07:00
2018-03-16 10:56:13 +01:00
2018-03-31 02:15:18 +02:00
2018-03-31 02:16:26 +02:00
2018-03-31 02:14:44 +02:00
2018-02-04 11:16:35 -08:00
2017-11-15 18:21:04 -08:00
2017-12-19 16:35:34 -08:00
2018-01-03 14:03:48 +01:00
2018-03-16 10:55:47 +01:00
2018-03-26 15:09:38 +02:00
2017-11-13 21:05:31 -08:00
2018-04-04 19:41:45 -07:00
2017-11-27 16:19:56 -05:00
2018-04-05 10:23:24 -07:00
2018-04-05 14:21:13 -07:00
2018-03-12 10:05:01 +01:00
2018-01-01 12:40:27 -07:00
2018-03-26 15:56:44 +02:00
2018-03-31 02:15:18 +02:00
2017-11-13 01:41:20 +01:00
2018-04-10 10:25:57 -07:00
2018-01-29 09:08:34 -08:00
2018-02-26 09:48:42 -07:00
2017-11-15 18:21:06 -08:00
2018-04-09 11:42:31 -07:00
2018-04-05 14:27:02 -07:00
2018-02-06 16:41:29 -05:00
2018-02-22 21:13:03 +01:00
2018-03-26 08:53:43 -06:00
2018-01-17 11:30:16 +00:00
2017-11-17 09:51:57 -08:00
2018-01-29 09:08:34 -08:00
2017-11-15 18:21:01 -08:00
2018-02-24 01:43:47 +01:00
2018-03-13 13:29:10 -07:00
2017-12-01 13:09:40 -08:00
2017-10-07 10:45:02 -06:00
2018-01-03 11:00:22 -05:00
2018-04-07 12:08:19 -07:00
2018-04-11 10:28:32 -07:00
2017-11-15 13:46:33 -08:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-30 12:56:22 -04:00
2017-11-17 14:18:00 -08:00
2017-11-17 14:18:00 -08:00
2017-11-17 16:10:00 -08:00
2018-01-28 22:17:24 -05:00
2017-11-15 15:01:28 -08:00
2018-01-08 08:22:45 -06:00
2018-02-01 10:57:45 -08:00
2018-01-17 15:25:50 +01:00
2018-01-08 08:22:45 -06:00
2017-12-14 16:00:49 -08:00
2017-11-15 18:21:06 -08:00
2018-01-31 17:18:37 -08:00
2017-11-09 10:23:28 +01:00
2018-04-06 18:31:06 -07:00
2018-04-06 18:31:06 -07:00
2018-01-19 16:50:53 -08:00
2017-11-17 16:10:04 -08:00
2017-11-17 16:10:04 -08:00
2017-11-13 01:33:48 +01:00
2017-12-16 02:05:48 +01:00
2018-02-06 16:41:28 -05:00
2018-02-20 16:12:26 -08:00
2017-12-11 14:37:11 -07:00
2018-03-17 14:20:55 +01:00
2018-03-01 08:33:05 -07:00
2017-11-07 12:22:21 +01:00
2018-04-05 14:27:02 -07:00
2018-01-29 12:02:54 -05:00
2018-04-05 21:36:24 -07:00
2018-04-05 21:36:27 -07:00
2018-01-18 11:56:49 +01:00
2018-01-15 12:07:46 -08:00
2018-02-06 09:59:40 -08:00
2018-02-06 18:32:47 -08:00
2018-01-09 16:27:43 +01:00
2018-04-10 11:27:30 -07:00
2018-02-20 16:10:25 -08:00
2017-10-11 22:36:54 -04:00
2018-02-06 18:32:44 -08:00
2017-12-20 09:53:54 -07:00