path: root/fs/proc/internal.h
diff options
authorVlastimil Babka <>2018-08-21 21:52:59 -0700
committerLinus Torvalds <>2018-08-22 10:52:44 -0700
commit258f669e7e88c18edbc23fe5ce00a476b924551f (patch)
tree12b68694a8fea80e2cd66db87e91e9410f7ecafc /fs/proc/internal.h
parentf1547959d9efd0be6cac2a2fd32f05dd7144dd6c (diff)
mm: /proc/pid/smaps_rollup: convert to single value seq_file
The /proc/pid/smaps_rollup file is currently implemented via the m_start/m_next/m_stop seq_file iterators shared with the other maps files, that iterate over vma's. However, the rollup file doesn't print anything for each vma, only accumulate the stats. There are some issues with the current code as reported in [1] - the accumulated stats can get skewed if seq_file start()/stop() op is called multiple times, if show() is called multiple times, and after seeks to non-zero position. Patch [1] fixed those within existing design, but I believe it is fundamentally wrong to expose the vma iterators to the seq_file mechanism when smaps_rollup shows logically a single set of values for the whole address space. This patch thus refactors the code to provide a single "value" at offset 0, with vma iteration to gather the stats done internally. This fixes the situations where results are skewed, and simplifies the code, especially in show_smap(), at the expense of somewhat less code reuse. [1] [vbabka@suse.c: use seq_file infrastructure] Link: Link: Signed-off-by: Vlastimil Babka <> Reported-by: Daniel Colascione <> Reviewed-by: Alexey Dobriyan <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'fs/proc/internal.h')
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 0c538769512a..f5b75d258d22 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -285,7 +285,6 @@ struct proc_maps_private {
struct inode *inode;
struct task_struct *task;
struct mm_struct *mm;
- struct mem_size_stats *rollup;
struct vm_area_struct *tail_vma;