Thread (13 messages) 13 messages, 5 authors, 2016-09-29

Re: [PATCH v3 1/2] mm, proc: Fix region lost in /proc/self/smaps

From: Michal Hocko <mhocko@kernel.org>
Date: 2016-09-23 14:39:13
Also in: kvm, lkml

On Fri 23-09-16 15:50:51, Michal Hocko wrote:
On Fri 23-09-16 21:12:33, Robert Ho wrote:
[...]
quoted
@@ -786,7 +791,7 @@ static int show_smap(struct seq_file *m, void *v, int is_pid)
 		   "KernelPageSize: %8lu kB\n"
 		   "MMUPageSize:    %8lu kB\n"
 		   "Locked:         %8lu kB\n",
-		   (vma->vm_end - vma->vm_start) >> 10,
+		   (vma->vm_end - max(vma->vm_start, m->version)) >> 10,
 		   mss.resident >> 10,
 		   (unsigned long)(mss.pss >> (10 + PSS_SHIFT)),
 		   mss.shared_clean  >> 10,
And forgot to mention that this is not sufficient either. You also need
to restrict the pte walk to get sane numbers...
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help