linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] cleanups and refactor of /proc/pid/smaps*
@ 2018-07-23 11:19 Vlastimil Babka
  2018-07-23 11:19 ` [PATCH 1/4] mm: /proc/pid/*maps remove is_pid and related wrappers Vlastimil Babka
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Vlastimil Babka @ 2018-07-23 11:19 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Daniel Colascione, linux-mm, linux-kernel, linux-fsdevel,
	Alexey Dobriyan, linux-api, Vlastimil Babka

The recent regression in /proc/pid/smaps made me look more into the code.
Especially the issues with smaps_rollup reported in [1] as explained in
Patch 4, which fixes them by refactoring the code. Patches 2 and 3 are
preparations for that. Patch 1 is me realizing that there's a lot of
boilerplate left from times where we tried (unsuccessfuly) to mark thread
stacks in the output.

Originally I had also plans to rework the translation from /proc/pid/*maps*
file offsets to the internal structures. Now the offset means "vma number",
which is not really stable (vma's can come and go between read() calls) and
there's an extra caching of last vma's address. My idea was that offsets would
be interpreted directly as addresses, which would also allow meaningful seeks
(see the ugly seek_to_smaps_entry() in tools/testing/selftests/vm/mlock2.h).
However loff_t is (signed) long long so that might be insufficient somewhere
for the unsigned long addresses.

So the result is fixed issues with skewed /proc/pid/smaps_rollup results,
simpler smaps code, and a lot of unused code removed.

[1] https://marc.info/?l=linux-mm&m=151927723128134&w=2

Vlastimil Babka (4):
  mm: /proc/pid/*maps remove is_pid and related wrappers
  mm: proc/pid/smaps: factor out mem stats gathering
  mm: proc/pid/smaps: factor out common stats printing
  mm: proc/pid/smaps_rollup: convert to single value seq_file

 fs/proc/base.c       |   6 +-
 fs/proc/internal.h   |   3 -
 fs/proc/task_mmu.c   | 294 +++++++++++++++++++------------------------
 fs/proc/task_nommu.c |  39 +-----
 4 files changed, 133 insertions(+), 209 deletions(-)

-- 
2.18.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-08-16 14:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 11:19 [PATCH 0/4] cleanups and refactor of /proc/pid/smaps* Vlastimil Babka
2018-07-23 11:19 ` [PATCH 1/4] mm: /proc/pid/*maps remove is_pid and related wrappers Vlastimil Babka
2018-07-23 11:19 ` [PATCH 2/4] mm: proc/pid/smaps: factor out mem stats gathering Vlastimil Babka
2018-07-30  8:45   ` Vlastimil Babka
2018-07-23 11:19 ` [PATCH 3/4] mm: proc/pid/smaps: factor out common stats printing Vlastimil Babka
2018-07-23 11:19 ` [PATCH 4/4] mm: proc/pid/smaps_rollup: convert to single value seq_file Vlastimil Babka
2018-07-25  6:53   ` Vlastimil Babka
2018-07-26 16:26     ` Alexey Dobriyan
2018-07-30  8:53       ` Vlastimil Babka
2018-08-16 14:20         ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).