From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760429AbcIWOjN (ORCPT ); Fri, 23 Sep 2016 10:39:13 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34575 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760311AbcIWOjK (ORCPT ); Fri, 23 Sep 2016 10:39:10 -0400 Date: Fri, 23 Sep 2016 16:39:08 +0200 From: Michal Hocko To: Robert Ho Cc: pbonzini@redhat.com, akpm@linux-foundation.org, oleg@redhat.com, dan.j.williams@intel.com, dave.hansen@intel.com, guangrong.xiao@linux.intel.com, gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, stefanha@redhat.com, yuhuang@redhat.com, linux-mm@kvack.org, ross.zwisler@linux.intel.com Subject: Re: [PATCH v3 1/2] mm, proc: Fix region lost in /proc/self/smaps Message-ID: <20160923143907.GT4478@dhcp22.suse.cz> References: <1474636354-25573-1-git-send-email-robert.hu@intel.com> <20160923135051.GQ4478@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160923135051.GQ4478@dhcp22.suse.cz> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 23-09-16 15:50:51, Michal Hocko wrote: > On Fri 23-09-16 21:12:33, Robert Ho wrote: [...] > > @@ -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