* [PATCH 2/2] arch:mm: Use hugetlb_bad_size
@ 2016-03-22 10:05 Vaishali Thakkar
2016-03-22 23:38 ` Naoya Horiguchi
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Vaishali Thakkar @ 2016-03-22 10:05 UTC (permalink / raw)
To: akpm
Cc: linux-kernel, linux-mm, Vaishali Thakkar, Mike Kravetz,
Naoya Horiguchi, Hillf Danton, Michal Hocko, Yaowei Bai,
Dominik Dingel, Kirill A. Shutemov, Paul Gortmaker, Dave Hansen
Update the setup_hugepagesz function to call the routine
hugetlb_bad_size when unsupported hugepage size is found.
Misc:
- Silent 80 characters warning
Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Cc: Dominik Dingel <dingel@linux.vnet.ibm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
---
- Please note that the patch is tested for x86 only. But as this
is one line change I just changed them. So, it would be good if
the patch can be tested for other architectures before adding
this in to mainline.
- Not sure if printk related checkpatch.pl warning should be resolved
with this patch as code is not consistent in architectures. May be
one separate patch for changing all printk's to pr_<level> kind of
debugging functions would be good.
---
arch/arm64/mm/hugetlbpage.c | 1 +
arch/metag/mm/hugetlbpage.c | 1 +
arch/powerpc/mm/hugetlbpage.c | 7 +++++--
arch/tile/mm/hugetlbpage.c | 7 ++++++-
arch/x86/mm/hugetlbpage.c | 1 +
5 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index 589fd28..aa8aee7 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -307,6 +307,7 @@ static __init int setup_hugepagesz(char *opt)
} else if (ps == PUD_SIZE) {
hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
} else {
+ hugetlb_bad_size();
pr_err("hugepagesz: Unsupported page size %lu K\n", ps >> 10);
return 0;
}
diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c
index b38700a..db1b7da 100644
--- a/arch/metag/mm/hugetlbpage.c
+++ b/arch/metag/mm/hugetlbpage.c
@@ -239,6 +239,7 @@ static __init int setup_hugepagesz(char *opt)
if (ps == (1 << HPAGE_SHIFT)) {
hugetlb_add_hstate(HPAGE_SHIFT - PAGE_SHIFT);
} else {
+ hugetlb_bad_size();
pr_err("hugepagesz: Unsupported page size %lu M\n",
ps >> 20);
return 0;
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 6dd272b..a437ff7 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -772,8 +772,11 @@ static int __init hugepage_setup_sz(char *str)
size = memparse(str, &str);
- if (add_huge_page_size(size) != 0)
- printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
+ if (add_huge_page_size(size) != 0) {
+ hugetlb_bad_size();
+ printk(KERN_WARNING "Invalid huge page size specified(%llu)\n",
+ size);
+ }
return 1;
}
diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
index e212c64..77ceaa3 100644
--- a/arch/tile/mm/hugetlbpage.c
+++ b/arch/tile/mm/hugetlbpage.c
@@ -308,11 +308,16 @@ static bool saw_hugepagesz;
static __init int setup_hugepagesz(char *opt)
{
+ int rc;
+
if (!saw_hugepagesz) {
saw_hugepagesz = true;
memset(huge_shift, 0, sizeof(huge_shift));
}
- return __setup_hugepagesz(memparse(opt, NULL));
+ rc = __setup_hugepagesz(memparse(opt, NULL));
+ if (rc)
+ hugetlb_bad_size();
+ return rc;
}
__setup("hugepagesz=", setup_hugepagesz);
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 740d7ac..3ec44f8 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -165,6 +165,7 @@ static __init int setup_hugepagesz(char *opt)
} else if (ps == PUD_SIZE && cpu_has_gbpages) {
hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
} else {
+ hugetlb_bad_size();
printk(KERN_ERR "hugepagesz: Unsupported page size %lu M\n",
ps >> 20);
return 0;
--
2.1.4
--
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] 7+ messages in thread
* Re: [PATCH 2/2] arch:mm: Use hugetlb_bad_size
2016-03-22 10:05 [PATCH 2/2] arch:mm: Use hugetlb_bad_size Vaishali Thakkar
@ 2016-03-22 23:38 ` Naoya Horiguchi
2016-03-23 2:42 ` Mike Kravetz
2016-03-23 3:15 ` Hillf Danton
2 siblings, 0 replies; 7+ messages in thread
From: Naoya Horiguchi @ 2016-03-22 23:38 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, Mike Kravetz, Hillf Danton, Michal Hocko,
Yaowei Bai, Dominik Dingel, Kirill A. Shutemov, Paul Gortmaker,
Dave Hansen
On Tue, Mar 22, 2016 at 03:35:59PM +0530, Vaishali Thakkar wrote:
> Update the setup_hugepagesz function to call the routine
> hugetlb_bad_size when unsupported hugepage size is found.
>
> Misc:
> - Silent 80 characters warning
>
> Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
> - Please note that the patch is tested for x86 only. But as this
> is one line change I just changed them. So, it would be good if
> the patch can be tested for other architectures before adding
> this in to mainline.
> - Not sure if printk related checkpatch.pl warning should be resolved
> with this patch as code is not consistent in architectures. May be
> one separate patch for changing all printk's to pr_<level> kind of
> debugging functions would be good.
> ---
> arch/arm64/mm/hugetlbpage.c | 1 +
> arch/metag/mm/hugetlbpage.c | 1 +
> arch/powerpc/mm/hugetlbpage.c | 7 +++++--
> arch/tile/mm/hugetlbpage.c | 7 ++++++-
> arch/x86/mm/hugetlbpage.c | 1 +
> 5 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> index 589fd28..aa8aee7 100644
> --- a/arch/arm64/mm/hugetlbpage.c
> +++ b/arch/arm64/mm/hugetlbpage.c
> @@ -307,6 +307,7 @@ static __init int setup_hugepagesz(char *opt)
> } else if (ps == PUD_SIZE) {
> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> pr_err("hugepagesz: Unsupported page size %lu K\n", ps >> 10);
> return 0;
> }
> diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c
> index b38700a..db1b7da 100644
> --- a/arch/metag/mm/hugetlbpage.c
> +++ b/arch/metag/mm/hugetlbpage.c
> @@ -239,6 +239,7 @@ static __init int setup_hugepagesz(char *opt)
> if (ps == (1 << HPAGE_SHIFT)) {
> hugetlb_add_hstate(HPAGE_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> pr_err("hugepagesz: Unsupported page size %lu M\n",
> ps >> 20);
> return 0;
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index 6dd272b..a437ff7 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -772,8 +772,11 @@ static int __init hugepage_setup_sz(char *str)
>
> size = memparse(str, &str);
>
> - if (add_huge_page_size(size) != 0)
> - printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
> + if (add_huge_page_size(size) != 0) {
> + hugetlb_bad_size();
> + printk(KERN_WARNING "Invalid huge page size specified(%llu)\n",
> + size);
> + }
>
> return 1;
> }
> diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
> index e212c64..77ceaa3 100644
> --- a/arch/tile/mm/hugetlbpage.c
> +++ b/arch/tile/mm/hugetlbpage.c
> @@ -308,11 +308,16 @@ static bool saw_hugepagesz;
>
> static __init int setup_hugepagesz(char *opt)
> {
> + int rc;
> +
> if (!saw_hugepagesz) {
> saw_hugepagesz = true;
> memset(huge_shift, 0, sizeof(huge_shift));
> }
> - return __setup_hugepagesz(memparse(opt, NULL));
> + rc = __setup_hugepagesz(memparse(opt, NULL));
> + if (rc)
> + hugetlb_bad_size();
> + return rc;
> }
> __setup("hugepagesz=", setup_hugepagesz);
>
> diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
> index 740d7ac..3ec44f8 100644
> --- a/arch/x86/mm/hugetlbpage.c
> +++ b/arch/x86/mm/hugetlbpage.c
> @@ -165,6 +165,7 @@ static __init int setup_hugepagesz(char *opt)
> } else if (ps == PUD_SIZE && cpu_has_gbpages) {
> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> printk(KERN_ERR "hugepagesz: Unsupported page size %lu M\n",
> ps >> 20);
> return 0;
> --
> 2.1.4
>
--
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] 7+ messages in thread
* Re: [PATCH 2/2] arch:mm: Use hugetlb_bad_size
2016-03-22 10:05 [PATCH 2/2] arch:mm: Use hugetlb_bad_size Vaishali Thakkar
2016-03-22 23:38 ` Naoya Horiguchi
@ 2016-03-23 2:42 ` Mike Kravetz
2016-03-23 3:15 ` Hillf Danton
2 siblings, 0 replies; 7+ messages in thread
From: Mike Kravetz @ 2016-03-23 2:42 UTC (permalink / raw)
To: Vaishali Thakkar, akpm
Cc: linux-kernel, linux-mm, Naoya Horiguchi, Hillf Danton,
Michal Hocko, Yaowei Bai, Dominik Dingel, Kirill A. Shutemov,
Paul Gortmaker, Dave Hansen
On 03/22/2016 03:05 AM, Vaishali Thakkar wrote:
> Update the setup_hugepagesz function to call the routine
> hugetlb_bad_size when unsupported hugepage size is found.
>
> Misc:
> - Silent 80 characters warning
>
> Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> ---
Looks fine to me,
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
> - Please note that the patch is tested for x86 only. But as this
> is one line change I just changed them. So, it would be good if
> the patch can be tested for other architectures before adding
> this in to mainline.
> - Not sure if printk related checkpatch.pl warning should be resolved
> with this patch as code is not consistent in architectures. May be
> one separate patch for changing all printk's to pr_<level> kind of
> debugging functions would be good.
> ---
> arch/arm64/mm/hugetlbpage.c | 1 +
> arch/metag/mm/hugetlbpage.c | 1 +
> arch/powerpc/mm/hugetlbpage.c | 7 +++++--
> arch/tile/mm/hugetlbpage.c | 7 ++++++-
> arch/x86/mm/hugetlbpage.c | 1 +
> 5 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> index 589fd28..aa8aee7 100644
> --- a/arch/arm64/mm/hugetlbpage.c
> +++ b/arch/arm64/mm/hugetlbpage.c
> @@ -307,6 +307,7 @@ static __init int setup_hugepagesz(char *opt)
> } else if (ps == PUD_SIZE) {
> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> pr_err("hugepagesz: Unsupported page size %lu K\n", ps >> 10);
> return 0;
> }
> diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c
> index b38700a..db1b7da 100644
> --- a/arch/metag/mm/hugetlbpage.c
> +++ b/arch/metag/mm/hugetlbpage.c
> @@ -239,6 +239,7 @@ static __init int setup_hugepagesz(char *opt)
> if (ps == (1 << HPAGE_SHIFT)) {
> hugetlb_add_hstate(HPAGE_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> pr_err("hugepagesz: Unsupported page size %lu M\n",
> ps >> 20);
> return 0;
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index 6dd272b..a437ff7 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -772,8 +772,11 @@ static int __init hugepage_setup_sz(char *str)
>
> size = memparse(str, &str);
>
> - if (add_huge_page_size(size) != 0)
> - printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
> + if (add_huge_page_size(size) != 0) {
> + hugetlb_bad_size();
> + printk(KERN_WARNING "Invalid huge page size specified(%llu)\n",
> + size);
> + }
>
> return 1;
> }
> diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
> index e212c64..77ceaa3 100644
> --- a/arch/tile/mm/hugetlbpage.c
> +++ b/arch/tile/mm/hugetlbpage.c
> @@ -308,11 +308,16 @@ static bool saw_hugepagesz;
>
> static __init int setup_hugepagesz(char *opt)
> {
> + int rc;
> +
> if (!saw_hugepagesz) {
> saw_hugepagesz = true;
> memset(huge_shift, 0, sizeof(huge_shift));
> }
> - return __setup_hugepagesz(memparse(opt, NULL));
> + rc = __setup_hugepagesz(memparse(opt, NULL));
> + if (rc)
> + hugetlb_bad_size();
> + return rc;
> }
> __setup("hugepagesz=", setup_hugepagesz);
>
> diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
> index 740d7ac..3ec44f8 100644
> --- a/arch/x86/mm/hugetlbpage.c
> +++ b/arch/x86/mm/hugetlbpage.c
> @@ -165,6 +165,7 @@ static __init int setup_hugepagesz(char *opt)
> } else if (ps == PUD_SIZE && cpu_has_gbpages) {
> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> printk(KERN_ERR "hugepagesz: Unsupported page size %lu M\n",
> ps >> 20);
> return 0;
>
--
Mike Kravetz
--
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] 7+ messages in thread
* Re: [PATCH 2/2] arch:mm: Use hugetlb_bad_size
2016-03-22 10:05 [PATCH 2/2] arch:mm: Use hugetlb_bad_size Vaishali Thakkar
2016-03-22 23:38 ` Naoya Horiguchi
2016-03-23 2:42 ` Mike Kravetz
@ 2016-03-23 3:15 ` Hillf Danton
2016-03-23 3:55 ` Vaishali Thakkar
2 siblings, 1 reply; 7+ messages in thread
From: Hillf Danton @ 2016-03-23 3:15 UTC (permalink / raw)
To: 'Vaishali Thakkar', akpm
Cc: linux-kernel, linux-mm, 'Mike Kravetz',
'Naoya Horiguchi', 'Michal Hocko',
'Yaowei Bai', 'Dominik Dingel',
'Kirill A. Shutemov', 'Paul Gortmaker',
'Dave Hansen', 'Chris Metcalf'
>
> Update the setup_hugepagesz function to call the routine
> hugetlb_bad_size when unsupported hugepage size is found.
>
> Misc:
> - Silent 80 characters warning
>
> Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> ---
> - Please note that the patch is tested for x86 only. But as this
> is one line change I just changed them. So, it would be good if
> the patch can be tested for other architectures before adding
> this in to mainline.
> - Not sure if printk related checkpatch.pl warning should be resolved
> with this patch as code is not consistent in architectures. May be
> one separate patch for changing all printk's to pr_<level> kind of
> debugging functions would be good.
> ---
> arch/arm64/mm/hugetlbpage.c | 1 +
> arch/metag/mm/hugetlbpage.c | 1 +
> arch/powerpc/mm/hugetlbpage.c | 7 +++++--
> arch/tile/mm/hugetlbpage.c | 7 ++++++-
Looks Chris Metcalf <cmetcalf@ezchip.com> not cced;-(
> arch/x86/mm/hugetlbpage.c | 1 +
> 5 files changed, 14 insertions(+), 3 deletions(-)
>
Help more if separate patches rather than a monolithic one are
delivered to the arch maintainers.
> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> index 589fd28..aa8aee7 100644
> --- a/arch/arm64/mm/hugetlbpage.c
> +++ b/arch/arm64/mm/hugetlbpage.c
> @@ -307,6 +307,7 @@ static __init int setup_hugepagesz(char *opt)
> } else if (ps == PUD_SIZE) {
> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> pr_err("hugepagesz: Unsupported page size %lu K\n", ps >> 10);
> return 0;
> }
> diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c
> index b38700a..db1b7da 100644
> --- a/arch/metag/mm/hugetlbpage.c
> +++ b/arch/metag/mm/hugetlbpage.c
> @@ -239,6 +239,7 @@ static __init int setup_hugepagesz(char *opt)
> if (ps == (1 << HPAGE_SHIFT)) {
> hugetlb_add_hstate(HPAGE_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> pr_err("hugepagesz: Unsupported page size %lu M\n",
> ps >> 20);
> return 0;
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index 6dd272b..a437ff7 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -772,8 +772,11 @@ static int __init hugepage_setup_sz(char *str)
>
> size = memparse(str, &str);
>
> - if (add_huge_page_size(size) != 0)
> - printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
> + if (add_huge_page_size(size) != 0) {
> + hugetlb_bad_size();
> + printk(KERN_WARNING "Invalid huge page size specified(%llu)\n",
> + size);
> + }
>
> return 1;
> }
> diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
> index e212c64..77ceaa3 100644
> --- a/arch/tile/mm/hugetlbpage.c
> +++ b/arch/tile/mm/hugetlbpage.c
> @@ -308,11 +308,16 @@ static bool saw_hugepagesz;
>
> static __init int setup_hugepagesz(char *opt)
> {
> + int rc;
> +
> if (!saw_hugepagesz) {
> saw_hugepagesz = true;
> memset(huge_shift, 0, sizeof(huge_shift));
> }
> - return __setup_hugepagesz(memparse(opt, NULL));
> + rc = __setup_hugepagesz(memparse(opt, NULL));
> + if (rc)
> + hugetlb_bad_size();
> + return rc;
> }
> __setup("hugepagesz=", setup_hugepagesz);
>
> diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
> index 740d7ac..3ec44f8 100644
> --- a/arch/x86/mm/hugetlbpage.c
> +++ b/arch/x86/mm/hugetlbpage.c
> @@ -165,6 +165,7 @@ static __init int setup_hugepagesz(char *opt)
> } else if (ps == PUD_SIZE && cpu_has_gbpages) {
> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> } else {
> + hugetlb_bad_size();
> printk(KERN_ERR "hugepagesz: Unsupported page size %lu M\n",
> ps >> 20);
> return 0;
> --
> 2.1.4
--
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] 7+ messages in thread
* Re: [PATCH 2/2] arch:mm: Use hugetlb_bad_size
2016-03-23 3:15 ` Hillf Danton
@ 2016-03-23 3:55 ` Vaishali Thakkar
2016-03-23 4:12 ` Hillf Danton
0 siblings, 1 reply; 7+ messages in thread
From: Vaishali Thakkar @ 2016-03-23 3:55 UTC (permalink / raw)
To: Hillf Danton, akpm
Cc: linux-kernel, linux-mm, 'Mike Kravetz',
'Naoya Horiguchi', 'Michal Hocko',
'Yaowei Bai', 'Dominik Dingel',
'Kirill A. Shutemov', 'Paul Gortmaker',
'Dave Hansen', 'Chris Metcalf'
On Wednesday 23 March 2016 08:45 AM, Hillf Danton wrote:
>> Update the setup_hugepagesz function to call the routine
>> hugetlb_bad_size when unsupported hugepage size is found.
>>
>> Misc:
>> - Silent 80 characters warning
>>
>> Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
>> Cc: Mike Kravetz <mike.kravetz@oracle.com>
>> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
>> Cc: Michal Hocko <mhocko@suse.com>
>> Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
>> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com>
>> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
>> Cc: Dave Hansen <dave.hansen@linux.intel.com>
>> ---
>> - Please note that the patch is tested for x86 only. But as this
>> is one line change I just changed them. So, it would be good if
>> the patch can be tested for other architectures before adding
>> this in to mainline.
>> - Not sure if printk related checkpatch.pl warning should be resolved
>> with this patch as code is not consistent in architectures. May be
>> one separate patch for changing all printk's to pr_<level> kind of
>> debugging functions would be good.
>> ---
>> arch/arm64/mm/hugetlbpage.c | 1 +
>> arch/metag/mm/hugetlbpage.c | 1 +
>> arch/powerpc/mm/hugetlbpage.c | 7 +++++--
>> arch/tile/mm/hugetlbpage.c | 7 ++++++-
> Looks Chris Metcalf <cmetcalf@ezchip.com> not cced;-(
>
>> arch/x86/mm/hugetlbpage.c | 1 +
>> 5 files changed, 14 insertions(+), 3 deletions(-)
>>
> Help more if separate patches rather than a monolithic one are
> delivered to the arch maintainers.
Do you want me to send new version of the patchset breaking this patch in
to separate patches?
>> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
>> index 589fd28..aa8aee7 100644
>> --- a/arch/arm64/mm/hugetlbpage.c
>> +++ b/arch/arm64/mm/hugetlbpage.c
>> @@ -307,6 +307,7 @@ static __init int setup_hugepagesz(char *opt)
>> } else if (ps == PUD_SIZE) {
>> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
>> } else {
>> + hugetlb_bad_size();
>> pr_err("hugepagesz: Unsupported page size %lu K\n", ps >> 10);
>> return 0;
>> }
>> diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c
>> index b38700a..db1b7da 100644
>> --- a/arch/metag/mm/hugetlbpage.c
>> +++ b/arch/metag/mm/hugetlbpage.c
>> @@ -239,6 +239,7 @@ static __init int setup_hugepagesz(char *opt)
>> if (ps == (1 << HPAGE_SHIFT)) {
>> hugetlb_add_hstate(HPAGE_SHIFT - PAGE_SHIFT);
>> } else {
>> + hugetlb_bad_size();
>> pr_err("hugepagesz: Unsupported page size %lu M\n",
>> ps >> 20);
>> return 0;
>> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
>> index 6dd272b..a437ff7 100644
>> --- a/arch/powerpc/mm/hugetlbpage.c
>> +++ b/arch/powerpc/mm/hugetlbpage.c
>> @@ -772,8 +772,11 @@ static int __init hugepage_setup_sz(char *str)
>>
>> size = memparse(str, &str);
>>
>> - if (add_huge_page_size(size) != 0)
>> - printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
>> + if (add_huge_page_size(size) != 0) {
>> + hugetlb_bad_size();
>> + printk(KERN_WARNING "Invalid huge page size specified(%llu)\n",
>> + size);
>> + }
>>
>> return 1;
>> }
>> diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
>> index e212c64..77ceaa3 100644
>> --- a/arch/tile/mm/hugetlbpage.c
>> +++ b/arch/tile/mm/hugetlbpage.c
>> @@ -308,11 +308,16 @@ static bool saw_hugepagesz;
>>
>> static __init int setup_hugepagesz(char *opt)
>> {
>> + int rc;
>> +
>> if (!saw_hugepagesz) {
>> saw_hugepagesz = true;
>> memset(huge_shift, 0, sizeof(huge_shift));
>> }
>> - return __setup_hugepagesz(memparse(opt, NULL));
>> + rc = __setup_hugepagesz(memparse(opt, NULL));
>> + if (rc)
>> + hugetlb_bad_size();
>> + return rc;
>> }
>> __setup("hugepagesz=", setup_hugepagesz);
>>
>> diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
>> index 740d7ac..3ec44f8 100644
>> --- a/arch/x86/mm/hugetlbpage.c
>> +++ b/arch/x86/mm/hugetlbpage.c
>> @@ -165,6 +165,7 @@ static __init int setup_hugepagesz(char *opt)
>> } else if (ps == PUD_SIZE && cpu_has_gbpages) {
>> hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
>> } else {
>> + hugetlb_bad_size();
>> printk(KERN_ERR "hugepagesz: Unsupported page size %lu M\n",
>> ps >> 20);
>> return 0;
>> --
>> 2.1.4
--
Vaishali
--
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] 7+ messages in thread
* Re: [PATCH 2/2] arch:mm: Use hugetlb_bad_size
2016-03-23 3:55 ` Vaishali Thakkar
@ 2016-03-23 4:12 ` Hillf Danton
2016-03-23 20:31 ` Andrew Morton
0 siblings, 1 reply; 7+ messages in thread
From: Hillf Danton @ 2016-03-23 4:12 UTC (permalink / raw)
To: 'Vaishali Thakkar', akpm
Cc: linux-kernel, linux-mm, 'Mike Kravetz',
'Naoya Horiguchi', 'Michal Hocko',
'Yaowei Bai', 'Dominik Dingel',
'Kirill A. Shutemov', 'Paul Gortmaker',
'Dave Hansen', 'Chris Metcalf'
>
> Do you want me to send new version of the patchset breaking this patch in
> to separate patches?
>
Yes.
thanks
Hillf
--
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] 7+ messages in thread
* Re: [PATCH 2/2] arch:mm: Use hugetlb_bad_size
2016-03-23 4:12 ` Hillf Danton
@ 2016-03-23 20:31 ` Andrew Morton
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2016-03-23 20:31 UTC (permalink / raw)
To: Hillf Danton
Cc: 'Vaishali Thakkar', linux-kernel, linux-mm,
'Mike Kravetz', 'Naoya Horiguchi',
'Michal Hocko', 'Yaowei Bai',
'Dominik Dingel', 'Kirill A. Shutemov',
'Paul Gortmaker', 'Dave Hansen',
'Chris Metcalf'
On Wed, 23 Mar 2016 12:12:48 +0800 "Hillf Danton" <hillf.zj@alibaba-inc.com> wrote:
> >
> > Do you want me to send new version of the patchset breaking this patch in
> > to separate patches?
> >
> Yes.
That would be a bit of a pain because then each arch maintainer will
need to check that the [1/1] patch is merged. In fact the arch
maintainer can't actually merge the arch patch locally without having
[1/1] present.
Simply acking this patch would make life much simpler, please.
--
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] 7+ messages in thread
end of thread, other threads:[~2016-03-23 20:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 10:05 [PATCH 2/2] arch:mm: Use hugetlb_bad_size Vaishali Thakkar
2016-03-22 23:38 ` Naoya Horiguchi
2016-03-23 2:42 ` Mike Kravetz
2016-03-23 3:15 ` Hillf Danton
2016-03-23 3:55 ` Vaishali Thakkar
2016-03-23 4:12 ` Hillf Danton
2016-03-23 20:31 ` Andrew Morton
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).