Skip to content

Commit

Permalink
proc: fix smaps and meminfo alignment
Browse files Browse the repository at this point in the history
The 4.17-rc /proc/meminfo and /proc/<pid>/smaps look ugly: single-digit
numbers (commonly 0) are misaligned.

Remove seq_put_decimal_ull_width()'s leftover optimization for single
digits: it's wrong now that num_to_str() takes care of the width.

Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1805241554210.1326@eggly.anvils
Fixes: d1be35c ("proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps")
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Andrei Vagin <avagin@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed May 26, 2018
1 parent 8addc2d commit 6c04ab0
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions fs/seq_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,11 +709,6 @@ void seq_put_decimal_ull_width(struct seq_file *m, const char *delimiter,
if (m->count + width >= m->size)
goto overflow;

if (num < 10) {
m->buf[m->count++] = num + '0';
return;
}

len = num_to_str(m->buf + m->count, m->size - m->count, num, width);
if (!len)
goto overflow;
Expand Down

0 comments on commit 6c04ab0

Please sign in to comment.