From: Rafael Aquini <aquini@redhat.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
oleg@redhat.com, dave.hansen@linux.intel.com,
rientjes@google.com, linux-mm@kvack.org
Subject: Re: [PATCH] proc: task_mmu: show page size in /proc/<pid>/numa_maps
Date: Sat, 20 Dec 2014 17:44:58 -0200 [thread overview]
Message-ID: <20141220194457.GA3166@x61.redhat.com> (raw)
In-Reply-To: <20141220183613.GA19229@phnom.home.cmpxchg.org>
On Sat, Dec 20, 2014 at 01:36:13PM -0500, Johannes Weiner wrote:
> On Sat, Dec 20, 2014 at 08:54:45AM -0500, Rafael Aquini wrote:
> > This patch introduces 'pagesize' line element to /proc/<pid>/numa_maps
> > report file in order to help disambiguating the size of pages that are
> > backing memory areas mapped by a task. When the VMA backing page size
> > is observed different from kernel's default PAGE_SIZE, the new element
> > is printed out to complement report output. This is specially useful to
> > help differentiating between HUGE and GIGANTIC page VMAs.
> >
> > This patch is based on Dave Hansen's proposal and reviewer's follow ups
> > taken from this dicussion: https://lkml.org/lkml/2011/9/21/454
> >
> > Signed-off-by: Rafael Aquini <aquini@redhat.com>
> > ---
> > fs/proc/task_mmu.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> > index 246eae8..9f2e2c8 100644
> > --- a/fs/proc/task_mmu.c
> > +++ b/fs/proc/task_mmu.c
> > @@ -1479,6 +1479,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
> > struct mm_struct *mm = vma->vm_mm;
> > struct mm_walk walk = {};
> > struct mempolicy *pol;
> > + unsigned long page_size;
> > char buffer[64];
> > int nid;
> >
> > @@ -1533,6 +1534,10 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
> > if (!md->pages)
> > goto out;
> >
> > + page_size = vma_kernel_pagesize(vma);
> > + if (page_size != PAGE_SIZE)
> > + seq_printf(m, " pagesize=%lu", page_size);
>
> It would be simpler to include this unconditionally. Otherwise you
> are forcing everybody parsing the file and trying to run calculations
> of it to check for its presence, and then have them fall back and get
> the value from somewhere else if not.
I'm fine either way, it makes the change even simpler. Also, if we
decide to get rid of page_size != PAGE_SIZE condition I believe we can
also get rid of that "huge" hint being conditionally printed out too.
-- Rafael
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Rafael Aquini <aquini@redhat.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
oleg@redhat.com, dave.hansen@linux.intel.com,
rientjes@google.com, linux-mm@kvack.org
Subject: Re: [PATCH] proc: task_mmu: show page size in /proc/<pid>/numa_maps
Date: Sat, 20 Dec 2014 17:44:58 -0200 [thread overview]
Message-ID: <20141220194457.GA3166@x61.redhat.com> (raw)
In-Reply-To: <20141220183613.GA19229@phnom.home.cmpxchg.org>
On Sat, Dec 20, 2014 at 01:36:13PM -0500, Johannes Weiner wrote:
> On Sat, Dec 20, 2014 at 08:54:45AM -0500, Rafael Aquini wrote:
> > This patch introduces 'pagesize' line element to /proc/<pid>/numa_maps
> > report file in order to help disambiguating the size of pages that are
> > backing memory areas mapped by a task. When the VMA backing page size
> > is observed different from kernel's default PAGE_SIZE, the new element
> > is printed out to complement report output. This is specially useful to
> > help differentiating between HUGE and GIGANTIC page VMAs.
> >
> > This patch is based on Dave Hansen's proposal and reviewer's follow ups
> > taken from this dicussion: https://lkml.org/lkml/2011/9/21/454
> >
> > Signed-off-by: Rafael Aquini <aquini@redhat.com>
> > ---
> > fs/proc/task_mmu.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> > index 246eae8..9f2e2c8 100644
> > --- a/fs/proc/task_mmu.c
> > +++ b/fs/proc/task_mmu.c
> > @@ -1479,6 +1479,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
> > struct mm_struct *mm = vma->vm_mm;
> > struct mm_walk walk = {};
> > struct mempolicy *pol;
> > + unsigned long page_size;
> > char buffer[64];
> > int nid;
> >
> > @@ -1533,6 +1534,10 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
> > if (!md->pages)
> > goto out;
> >
> > + page_size = vma_kernel_pagesize(vma);
> > + if (page_size != PAGE_SIZE)
> > + seq_printf(m, " pagesize=%lu", page_size);
>
> It would be simpler to include this unconditionally. Otherwise you
> are forcing everybody parsing the file and trying to run calculations
> of it to check for its presence, and then have them fall back and get
> the value from somewhere else if not.
I'm fine either way, it makes the change even simpler. Also, if we
decide to get rid of page_size != PAGE_SIZE condition I believe we can
also get rid of that "huge" hint being conditionally printed out too.
-- Rafael
next prev parent reply other threads:[~2014-12-20 20:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-20 13:54 [PATCH] proc: task_mmu: show page size in /proc/<pid>/numa_maps Rafael Aquini
2014-12-20 13:54 ` Rafael Aquini
2014-12-20 16:40 ` Dave Hansen
2014-12-20 16:40 ` Dave Hansen
2014-12-22 22:27 ` David Rientjes
2014-12-22 22:27 ` David Rientjes
2014-12-20 18:36 ` Johannes Weiner
2014-12-20 18:36 ` Johannes Weiner
2014-12-20 19:44 ` Rafael Aquini [this message]
2014-12-20 19:44 ` Rafael Aquini
2014-12-21 18:02 ` Dave Hansen
2014-12-21 18:02 ` Dave Hansen
2014-12-21 22:28 ` Rafael Aquini
2014-12-21 22:28 ` Rafael Aquini
2014-12-22 17:10 ` Dave Hansen
2014-12-22 17:10 ` Dave Hansen
2014-12-22 17:25 ` Rafael Aquini
2014-12-22 17:25 ` Rafael Aquini
2014-12-22 17:59 ` Dave Hansen
2014-12-22 17:59 ` Dave Hansen
2014-12-22 22:21 ` David Rientjes
2014-12-22 22:21 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141220194457.GA3166@x61.redhat.com \
--to=aquini@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=oleg@redhat.com \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.