Re: [patch] mm, hugetlb: remove hugetlb_zero and hugetlb_infinity
On Mon, 30 Jun 2014 17:46:35 -0700 (PDT) David Rientjes wrote: > They are unnecessary: "zero" can be used in place of "hugetlb_zero" and > passing extra2 == NULL is equivalent to infinity. > > Signed-off-by: David Rientjes Reviewed-by: Luiz Capitulino > --- > include/linux/hugetlb.h | 1 - > kernel/sysctl.c | 9 +++-- > mm/hugetlb.c| 1 - > 3 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -86,7 +86,6 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long > addr, pud_t *pud); > #endif > > extern unsigned long hugepages_treat_as_movable; > -extern const unsigned long hugetlb_zero, hugetlb_infinity; > extern int sysctl_hugetlb_shm_group; > extern struct list_head huge_boot_pages; > > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -1240,8 +1240,7 @@ static struct ctl_table vm_table[] = { > .maxlen = sizeof(unsigned long), > .mode = 0644, > .proc_handler = hugetlb_sysctl_handler, > - .extra1 = (void *)_zero, > - .extra2 = (void *)_infinity, > + .extra1 = , > }, > #ifdef CONFIG_NUMA > { > @@ -1250,8 +1249,7 @@ static struct ctl_table vm_table[] = { > .maxlen = sizeof(unsigned long), > .mode = 0644, > .proc_handler = _mempolicy_sysctl_handler, > - .extra1 = (void *)_zero, > - .extra2 = (void *)_infinity, > + .extra1 = , > }, > #endif >{ > @@ -1274,8 +1272,7 @@ static struct ctl_table vm_table[] = { > .maxlen = sizeof(unsigned long), > .mode = 0644, > .proc_handler = hugetlb_overcommit_handler, > - .extra1 = (void *)_zero, > - .extra2 = (void *)_infinity, > + .extra1 = , > }, > #endif > { > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -35,7 +35,6 @@ > #include > #include "internal.h" > > -const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; > unsigned long hugepages_treat_as_movable; > > int hugetlb_max_hstate __read_mostly; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch] mm, hugetlb: remove hugetlb_zero and hugetlb_infinity
On Mon, 30 Jun 2014 17:46:35 -0700 (PDT) David Rientjes rient...@google.com wrote: They are unnecessary: zero can be used in place of hugetlb_zero and passing extra2 == NULL is equivalent to infinity. Signed-off-by: David Rientjes rient...@google.com Reviewed-by: Luiz Capitulino lcapitul...@redhat.com --- include/linux/hugetlb.h | 1 - kernel/sysctl.c | 9 +++-- mm/hugetlb.c| 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -86,7 +86,6 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); #endif extern unsigned long hugepages_treat_as_movable; -extern const unsigned long hugetlb_zero, hugetlb_infinity; extern int sysctl_hugetlb_shm_group; extern struct list_head huge_boot_pages; diff --git a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1240,8 +1240,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_sysctl_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #ifdef CONFIG_NUMA { @@ -1250,8 +1249,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_mempolicy_sysctl_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #endif { @@ -1274,8 +1272,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_overcommit_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #endif { diff --git a/mm/hugetlb.c b/mm/hugetlb.c --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -35,7 +35,6 @@ #include linux/node.h #include internal.h -const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; unsigned long hugepages_treat_as_movable; int hugetlb_max_hstate __read_mostly; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch] mm, hugetlb: remove hugetlb_zero and hugetlb_infinity
On Mon, Jun 30, 2014 at 05:46:35PM -0700, David Rientjes wrote: > They are unnecessary: "zero" can be used in place of "hugetlb_zero" and > passing extra2 == NULL is equivalent to infinity. > > Signed-off-by: David Rientjes Reviewed-by: Naoya Horiguchi > --- > include/linux/hugetlb.h | 1 - > kernel/sysctl.c | 9 +++-- > mm/hugetlb.c| 1 - > 3 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -86,7 +86,6 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long > addr, pud_t *pud); > #endif > > extern unsigned long hugepages_treat_as_movable; > -extern const unsigned long hugetlb_zero, hugetlb_infinity; > extern int sysctl_hugetlb_shm_group; > extern struct list_head huge_boot_pages; > > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -1240,8 +1240,7 @@ static struct ctl_table vm_table[] = { > .maxlen = sizeof(unsigned long), > .mode = 0644, > .proc_handler = hugetlb_sysctl_handler, > - .extra1 = (void *)_zero, > - .extra2 = (void *)_infinity, > + .extra1 = , > }, > #ifdef CONFIG_NUMA > { > @@ -1250,8 +1249,7 @@ static struct ctl_table vm_table[] = { > .maxlen = sizeof(unsigned long), > .mode = 0644, > .proc_handler = _mempolicy_sysctl_handler, > - .extra1 = (void *)_zero, > - .extra2 = (void *)_infinity, > + .extra1 = , > }, > #endif >{ > @@ -1274,8 +1272,7 @@ static struct ctl_table vm_table[] = { > .maxlen = sizeof(unsigned long), > .mode = 0644, > .proc_handler = hugetlb_overcommit_handler, > - .extra1 = (void *)_zero, > - .extra2 = (void *)_infinity, > + .extra1 = , > }, > #endif > { > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -35,7 +35,6 @@ > #include > #include "internal.h" > > -const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; > unsigned long hugepages_treat_as_movable; > > int hugetlb_max_hstate __read_mostly; > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majord...@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: mailto:"d...@kvack.org;> em...@kvack.org > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch] mm, hugetlb: remove hugetlb_zero and hugetlb_infinity
On Mon, Jun 30, 2014 at 05:46:35PM -0700, David Rientjes wrote: They are unnecessary: zero can be used in place of hugetlb_zero and passing extra2 == NULL is equivalent to infinity. Signed-off-by: David Rientjes rient...@google.com Reviewed-by: Naoya Horiguchi n-horigu...@ah.jp.nec.com --- include/linux/hugetlb.h | 1 - kernel/sysctl.c | 9 +++-- mm/hugetlb.c| 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -86,7 +86,6 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); #endif extern unsigned long hugepages_treat_as_movable; -extern const unsigned long hugetlb_zero, hugetlb_infinity; extern int sysctl_hugetlb_shm_group; extern struct list_head huge_boot_pages; diff --git a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1240,8 +1240,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_sysctl_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #ifdef CONFIG_NUMA { @@ -1250,8 +1249,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_mempolicy_sysctl_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #endif { @@ -1274,8 +1272,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_overcommit_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #endif { diff --git a/mm/hugetlb.c b/mm/hugetlb.c --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -35,7 +35,6 @@ #include linux/node.h #include internal.h -const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; unsigned long hugepages_treat_as_movable; int hugetlb_max_hstate __read_mostly; -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majord...@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: a href=mailto:d...@kvack.org; em...@kvack.org /a -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[patch] mm, hugetlb: remove hugetlb_zero and hugetlb_infinity
They are unnecessary: "zero" can be used in place of "hugetlb_zero" and passing extra2 == NULL is equivalent to infinity. Signed-off-by: David Rientjes --- include/linux/hugetlb.h | 1 - kernel/sysctl.c | 9 +++-- mm/hugetlb.c| 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -86,7 +86,6 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); #endif extern unsigned long hugepages_treat_as_movable; -extern const unsigned long hugetlb_zero, hugetlb_infinity; extern int sysctl_hugetlb_shm_group; extern struct list_head huge_boot_pages; diff --git a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1240,8 +1240,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_sysctl_handler, - .extra1 = (void *)_zero, - .extra2 = (void *)_infinity, + .extra1 = , }, #ifdef CONFIG_NUMA { @@ -1250,8 +1249,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = _mempolicy_sysctl_handler, - .extra1 = (void *)_zero, - .extra2 = (void *)_infinity, + .extra1 = , }, #endif { @@ -1274,8 +1272,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_overcommit_handler, - .extra1 = (void *)_zero, - .extra2 = (void *)_infinity, + .extra1 = , }, #endif { diff --git a/mm/hugetlb.c b/mm/hugetlb.c --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -35,7 +35,6 @@ #include #include "internal.h" -const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; unsigned long hugepages_treat_as_movable; int hugetlb_max_hstate __read_mostly; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[patch] mm, hugetlb: remove hugetlb_zero and hugetlb_infinity
They are unnecessary: zero can be used in place of hugetlb_zero and passing extra2 == NULL is equivalent to infinity. Signed-off-by: David Rientjes rient...@google.com --- include/linux/hugetlb.h | 1 - kernel/sysctl.c | 9 +++-- mm/hugetlb.c| 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -86,7 +86,6 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); #endif extern unsigned long hugepages_treat_as_movable; -extern const unsigned long hugetlb_zero, hugetlb_infinity; extern int sysctl_hugetlb_shm_group; extern struct list_head huge_boot_pages; diff --git a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1240,8 +1240,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_sysctl_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #ifdef CONFIG_NUMA { @@ -1250,8 +1249,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_mempolicy_sysctl_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #endif { @@ -1274,8 +1272,7 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = hugetlb_overcommit_handler, - .extra1 = (void *)hugetlb_zero, - .extra2 = (void *)hugetlb_infinity, + .extra1 = zero, }, #endif { diff --git a/mm/hugetlb.c b/mm/hugetlb.c --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -35,7 +35,6 @@ #include linux/node.h #include internal.h -const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; unsigned long hugepages_treat_as_movable; int hugetlb_max_hstate __read_mostly; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/