Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1348944 > unrolled thread

[PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers

Started byJan Stancek <jstancek@redhat.com>
First post2016-03-03 11:10 +0100
Last post2016-03-08 04:10 +0100
Articles 8 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers Jan Stancek <jstancek@redhat.com> - 2016-03-03 11:10 +0100
    Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-03-03 12:00 +0100
    Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-03-04 00:10 +0100
    Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers Andrew Morton <akpm@linux-foundation.org> - 2016-03-04 22:40 +0100
      Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers Jan Stancek <jstancek@redhat.com> - 2016-03-05 09:20 +0100
        Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers Andrew Morton <akpm@linux-foundation.org> - 2016-03-08 01:20 +0100
    Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers David Rientjes <rientjes@google.com> - 2016-03-07 23:20 +0100
      Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-03-08 04:10 +0100

#1348944 — [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers

FromJan Stancek <jstancek@redhat.com>
Date2016-03-03 11:10 +0100
Subject[PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers
Message-ID<r8ymJ-5pr-5@gated-at.bofh.it>
Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
this value is propagated to userspace. EOPNOTSUPP is part of uapi
and is widely supported by libc libraries.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 mm/hugetlb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 01f2b48c8618..851a29928a99 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2751,7 +2751,7 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
 	int ret;
 
 	if (!hugepages_supported())
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 
 	table->data = &tmp;
 	table->maxlen = sizeof(unsigned long);
@@ -2792,7 +2792,7 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
 	int ret;
 
 	if (!hugepages_supported())
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 
 	tmp = h->nr_overcommit_huge_pages;
 
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1348986

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2016-03-03 12:00 +0100
Message-ID<r8z99-5Rb-53@gated-at.bofh.it>
In reply to#1348944
On Thu, Mar 03, 2016 at 11:02:51AM +0100, Jan Stancek wrote:
> Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
> this value is propagated to userspace. EOPNOTSUPP is part of uapi
> and is widely supported by libc libraries.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

> ---
>  mm/hugetlb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 01f2b48c8618..851a29928a99 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2751,7 +2751,7 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
>  	int ret;
>  
>  	if (!hugepages_supported())
> -		return -ENOTSUPP;
> +		return -EOPNOTSUPP;
>  
>  	table->data = &tmp;
>  	table->maxlen = sizeof(unsigned long);
> @@ -2792,7 +2792,7 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
>  	int ret;
>  
>  	if (!hugepages_supported())
> -		return -ENOTSUPP;
> +		return -EOPNOTSUPP;
>  
>  	tmp = h->nr_overcommit_huge_pages;
>  
> -- 
> 1.8.3.1
> 
> --
> 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>

-- 
 Kirill A. Shutemov

[toc] | [prev] | [next] | [standalone]


#1349676

FromNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Date2016-03-04 00:10 +0100
Message-ID<r8Kxz-63E-3@gated-at.bofh.it>
In reply to#1348944
On Thu, Mar 03, 2016 at 11:02:51AM +0100, Jan Stancek wrote:
> Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
> this value is propagated to userspace. EOPNOTSUPP is part of uapi
> and is widely supported by libc libraries.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

> ---
>  mm/hugetlb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 01f2b48c8618..851a29928a99 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2751,7 +2751,7 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
>  	int ret;
>  
>  	if (!hugepages_supported())
> -		return -ENOTSUPP;
> +		return -EOPNOTSUPP;
>  
>  	table->data = &tmp;
>  	table->maxlen = sizeof(unsigned long);
> @@ -2792,7 +2792,7 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
>  	int ret;
>  
>  	if (!hugepages_supported())
> -		return -ENOTSUPP;
> +		return -EOPNOTSUPP;
>  
>  	tmp = h->nr_overcommit_huge_pages;
>  
> -- 
> 1.8.3.1
> 

[toc] | [prev] | [next] | [standalone]


#1350620

FromAndrew Morton <akpm@linux-foundation.org>
Date2016-03-04 22:40 +0100
Message-ID<r95C1-4Cy-13@gated-at.bofh.it>
In reply to#1348944
On Thu,  3 Mar 2016 11:02:51 +0100 Jan Stancek <jstancek@redhat.com> wrote:

> Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
> this value is propagated to userspace. EOPNOTSUPP is part of uapi
> and is widely supported by libc libraries.

hm, what is the actual user-visible effect of this change?  Does it fix
some misbehaviour?

[toc] | [prev] | [next] | [standalone]


#1350833

FromJan Stancek <jstancek@redhat.com>
Date2016-03-05 09:20 +0100
Message-ID<r9fBp-3k0-25@gated-at.bofh.it>
In reply to#1350620



----- Original Message -----
> From: "Andrew Morton" <akpm@linux-foundation.org>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, n-horiguchi@ah.jp.nec.com, "mike kravetz"
> <mike.kravetz@oracle.com>, "hillf zj" <hillf.zj@alibaba-inc.com>, "kirill shutemov"
> <kirill.shutemov@linux.intel.com>, "dave hansen" <dave.hansen@linux.intel.com>, "paul gortmaker"
> <paul.gortmaker@windriver.com>
> Sent: Friday, 4 March, 2016 10:38:07 PM
> Subject: Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers
> 
> On Thu,  3 Mar 2016 11:02:51 +0100 Jan Stancek <jstancek@redhat.com> wrote:
> 
> > Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
> > this value is propagated to userspace. EOPNOTSUPP is part of uapi
> > and is widely supported by libc libraries.
> 
> hm, what is the actual user-visible effect of this change?  Does it fix
> some misbehaviour?
> 

It gives nicer message to user, rather than:
# cat /proc/sys/vm/nr_hugepages
cat: /proc/sys/vm/nr_hugepages: Unknown error 524

And also LTP's proc01 test was failing because this ret code (524)
was unexpected:
proc01      1  TFAIL  :  proc01.c:396: read failed: /proc/sys/vm/nr_hugepages: errno=???(524): Unknown error 524
proc01      2  TFAIL  :  proc01.c:396: read failed: /proc/sys/vm/nr_hugepages_mempolicy: errno=???(524): Unknown error 524
proc01      3  TFAIL  :  proc01.c:396: read failed: /proc/sys/vm/nr_overcommit_hugepages: errno=???(524): Unknown error 524

Regards,
Jan

[toc] | [prev] | [next] | [standalone]


#1352363

FromAndrew Morton <akpm@linux-foundation.org>
Date2016-03-08 01:20 +0100
Message-ID<radxw-1Da-15@gated-at.bofh.it>
In reply to#1350833
On Sat, 5 Mar 2016 03:09:50 -0500 (EST) Jan Stancek <jstancek@redhat.com> wrote:

> > > Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
> > > this value is propagated to userspace. EOPNOTSUPP is part of uapi
> > > and is widely supported by libc libraries.
> > 
> > hm, what is the actual user-visible effect of this change?  Does it fix
> > some misbehaviour?
> > 
> 
> It gives nicer message to user, rather than:
> # cat /proc/sys/vm/nr_hugepages
> cat: /proc/sys/vm/nr_hugepages: Unknown error 524
> 
> And also LTP's proc01 test was failing because this ret code (524)
> was unexpected:
> proc01      1  TFAIL  :  proc01.c:396: read failed: /proc/sys/vm/nr_hugepages: errno=???(524): Unknown error 524
> proc01      2  TFAIL  :  proc01.c:396: read failed: /proc/sys/vm/nr_hugepages_mempolicy: errno=???(524): Unknown error 524
> proc01      3  TFAIL  :  proc01.c:396: read failed: /proc/sys/vm/nr_overcommit_hugepages: errno=???(524): Unknown error 524
> 

Ah, OK, thanks.  "Unknown error 524" is rather rude.  I'll queue this
for 4.5.

[toc] | [prev] | [next] | [standalone]


#1352023

FromDavid Rientjes <rientjes@google.com>
Date2016-03-07 23:20 +0100
Message-ID<rabFn-m1-9@gated-at.bofh.it>
In reply to#1348944
On Thu, 3 Mar 2016, Jan Stancek wrote:

> Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
> this value is propagated to userspace. EOPNOTSUPP is part of uapi
> and is widely supported by libc libraries.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

Acked-by: David Rientjes <rientjes@google.com>

[toc] | [prev] | [next] | [standalone]


#1352593

From"Hillf Danton" <hillf.zj@alibaba-inc.com>
Date2016-03-08 04:10 +0100
Message-ID<ragc1-3ra-1@gated-at.bofh.it>
In reply to#1352023
> 
> On Thu, 3 Mar 2016, Jan Stancek wrote:
> 
> > Replace ENOTSUPP with EOPNOTSUPP. If hugepages are not supported,
> > this value is propagated to userspace. EOPNOTSUPP is part of uapi
> > and is widely supported by libc libraries.
> >
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> > Cc: Mike Kravetz <mike.kravetz@oracle.com>
> > Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> > Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> > Cc: Dave Hansen <dave.hansen@linux.intel.com>
> > Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
> >
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> 
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web