* [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma
@ 2010-03-19 6:26 Naoya Horiguchi
2010-03-19 6:29 ` KAMEZAWA Hiroyuki
2010-03-19 20:07 ` Matt Mackall
0 siblings, 2 replies; 6+ messages in thread
From: Naoya Horiguchi @ 2010-03-19 6:26 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, akpm, andi.kleen, fengguang.wu
If !CONFIG_HUGETLB_PAGE, pagemap_hugetlb_range() is never called.
So put it (and its calling function) into #ifdef block.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
---
fs/proc/task_mmu.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 183f8ff..2a3ef17 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -652,6 +652,7 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
return err;
}
+#ifdef CONFIG_HUGETLB_PAGE
static u64 huge_pte_to_pagemap_entry(pte_t pte, int offset)
{
u64 pme = 0;
@@ -695,6 +696,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long addr,
return err;
}
+#endif /* HUGETLB_PAGE */
/*
* /proc/pid/pagemap - an array mapping virtual pages to pfns
@@ -788,7 +790,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
pagemap_walk.pmd_entry = pagemap_pte_range;
pagemap_walk.pte_hole = pagemap_pte_hole;
+#ifdef CONFIG_HUGETLB_PAGE
pagemap_walk.hugetlb_entry = pagemap_hugetlb_range;
+#endif
pagemap_walk.mm = mm;
pagemap_walk.private = ±
--
1.7.0
--
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>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma
2010-03-19 6:26 [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma Naoya Horiguchi
@ 2010-03-19 6:29 ` KAMEZAWA Hiroyuki
2010-03-19 6:53 ` Naoya Horiguchi
2010-03-19 20:07 ` Matt Mackall
1 sibling, 1 reply; 6+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-03-19 6:29 UTC (permalink / raw)
To: Naoya Horiguchi; +Cc: linux-kernel, linux-mm, akpm, andi.kleen, fengguang.wu
On Fri, 19 Mar 2010 15:26:35 +0900
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:
> If !CONFIG_HUGETLB_PAGE, pagemap_hugetlb_range() is never called.
> So put it (and its calling function) into #ifdef block.
>
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Hmm? What is benefit ? Is this broken now ?
Thanks,
-Kame
> ---
> fs/proc/task_mmu.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 183f8ff..2a3ef17 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -652,6 +652,7 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
> return err;
> }
>
> +#ifdef CONFIG_HUGETLB_PAGE
> static u64 huge_pte_to_pagemap_entry(pte_t pte, int offset)
> {
> u64 pme = 0;
> @@ -695,6 +696,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long addr,
>
> return err;
> }
> +#endif /* HUGETLB_PAGE */
>
> /*
> * /proc/pid/pagemap - an array mapping virtual pages to pfns
> @@ -788,7 +790,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
>
> pagemap_walk.pmd_entry = pagemap_pte_range;
> pagemap_walk.pte_hole = pagemap_pte_hole;
> +#ifdef CONFIG_HUGETLB_PAGE
> pagemap_walk.hugetlb_entry = pagemap_hugetlb_range;
> +#endif
> pagemap_walk.mm = mm;
> pagemap_walk.private = ±
>
> --
> 1.7.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma
2010-03-19 6:29 ` KAMEZAWA Hiroyuki
@ 2010-03-19 6:53 ` Naoya Horiguchi
2010-03-19 7:15 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 6+ messages in thread
From: Naoya Horiguchi @ 2010-03-19 6:53 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki; +Cc: linux-kernel, linux-mm, akpm, andi.kleen, fengguang.wu
On Fri, Mar 19, 2010 at 03:29:34PM +0900, KAMEZAWA Hiroyuki wrote:
> On Fri, 19 Mar 2010 15:26:35 +0900
> Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:
>
> > If !CONFIG_HUGETLB_PAGE, pagemap_hugetlb_range() is never called.
> > So put it (and its calling function) into #ifdef block.
> >
> > Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>
> Hmm? What is benefit ? Is this broken now ?
>
Not broken, but this is needed to avoid build error with patch 2/2 applied,
where I move huge_pte_offset() (not defined when !HUGETLB_PAGE)
into pagemap_hugetlb_range().
Thanks,
Naoya Horiguchi
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma
2010-03-19 6:53 ` Naoya Horiguchi
@ 2010-03-19 7:15 ` KAMEZAWA Hiroyuki
2010-03-19 8:30 ` Naoya Horiguchi
0 siblings, 1 reply; 6+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-03-19 7:15 UTC (permalink / raw)
To: Naoya Horiguchi; +Cc: linux-kernel, linux-mm, akpm, andi.kleen, fengguang.wu
On Fri, 19 Mar 2010 15:53:34 +0900
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:
> On Fri, Mar 19, 2010 at 03:29:34PM +0900, KAMEZAWA Hiroyuki wrote:
> > On Fri, 19 Mar 2010 15:26:35 +0900
> > Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:
> >
> > > If !CONFIG_HUGETLB_PAGE, pagemap_hugetlb_range() is never called.
> > > So put it (and its calling function) into #ifdef block.
> > >
> > > Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> >
> > Hmm? What is benefit ? Is this broken now ?
> >
>
> Not broken, but this is needed to avoid build error with patch 2/2 applied,
> where I move huge_pte_offset() (not defined when !HUGETLB_PAGE)
> into pagemap_hugetlb_range().
>
I think this should be merged with 2/2....if necessary.
Thanks,
-Kame
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma
2010-03-19 7:15 ` KAMEZAWA Hiroyuki
@ 2010-03-19 8:30 ` Naoya Horiguchi
0 siblings, 0 replies; 6+ messages in thread
From: Naoya Horiguchi @ 2010-03-19 8:30 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki; +Cc: linux-kernel, linux-mm, akpm, andi.kleen, fengguang.wu
On Fri, Mar 19, 2010 at 04:15:04PM +0900, KAMEZAWA Hiroyuki wrote:
> On Fri, 19 Mar 2010 15:53:34 +0900
> Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:
>
> > On Fri, Mar 19, 2010 at 03:29:34PM +0900, KAMEZAWA Hiroyuki wrote:
> > > On Fri, 19 Mar 2010 15:26:35 +0900
> > > Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:
> > >
> > > > If !CONFIG_HUGETLB_PAGE, pagemap_hugetlb_range() is never called.
> > > > So put it (and its calling function) into #ifdef block.
> > > >
> > > > Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> > >
> > > Hmm? What is benefit ? Is this broken now ?
> > >
> >
> > Not broken, but this is needed to avoid build error with patch 2/2 applied,
> > where I move huge_pte_offset() (not defined when !HUGETLB_PAGE)
> > into pagemap_hugetlb_range().
> >
>
> I think this should be merged with 2/2....if necessary.
>
I split them for ease of review.
Also removing unused code is beneficial as it reduces kernel binary size.
But if you really want, I can merge them into one patch.
Thanks,
Naoya Horiguchi
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma
2010-03-19 6:26 [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma Naoya Horiguchi
2010-03-19 6:29 ` KAMEZAWA Hiroyuki
@ 2010-03-19 20:07 ` Matt Mackall
1 sibling, 0 replies; 6+ messages in thread
From: Matt Mackall @ 2010-03-19 20:07 UTC (permalink / raw)
To: Naoya Horiguchi; +Cc: linux-kernel, linux-mm, akpm, andi.kleen, fengguang.wu
On Fri, 2010-03-19 at 15:26 +0900, Naoya Horiguchi wrote:
> If !CONFIG_HUGETLB_PAGE, pagemap_hugetlb_range() is never called.
> So put it (and its calling function) into #ifdef block.
>
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Matt Mackall <mpm@selenic.com>
> ---
> fs/proc/task_mmu.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 183f8ff..2a3ef17 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -652,6 +652,7 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
> return err;
> }
>
> +#ifdef CONFIG_HUGETLB_PAGE
> static u64 huge_pte_to_pagemap_entry(pte_t pte, int offset)
> {
> u64 pme = 0;
> @@ -695,6 +696,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long addr,
>
> return err;
> }
> +#endif /* HUGETLB_PAGE */
>
> /*
> * /proc/pid/pagemap - an array mapping virtual pages to pfns
> @@ -788,7 +790,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
>
> pagemap_walk.pmd_entry = pagemap_pte_range;
> pagemap_walk.pte_hole = pagemap_pte_hole;
> +#ifdef CONFIG_HUGETLB_PAGE
> pagemap_walk.hugetlb_entry = pagemap_hugetlb_range;
> +#endif
> pagemap_walk.mm = mm;
> pagemap_walk.private = ±
>
--
http://selenic.com : development and support for Mercurial and Linux
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-19 20:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 6:26 [PATCH 1/2] pagemap: add #ifdefs CONFIG_HUGETLB_PAGE on code walking hugetlb vma Naoya Horiguchi
2010-03-19 6:29 ` KAMEZAWA Hiroyuki
2010-03-19 6:53 ` Naoya Horiguchi
2010-03-19 7:15 ` KAMEZAWA Hiroyuki
2010-03-19 8:30 ` Naoya Horiguchi
2010-03-19 20:07 ` Matt Mackall
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).