Re: [PATCH] mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers
From: Jan Stancek
Date: Sat Mar 05 2016 - 03:10:16 EST
----- Original Message -----
> From: "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>
> To: "Jan Stancek" <jstancek@xxxxxxxxxx>
> Cc: linux-mm@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, n-horiguchi@xxxxxxxxxxxxx, "mike kravetz"
> <mike.kravetz@xxxxxxxxxx>, "hillf zj" <hillf.zj@xxxxxxxxxxxxxxx>, "kirill shutemov"
> <kirill.shutemov@xxxxxxxxxxxxxxx>, "dave hansen" <dave.hansen@xxxxxxxxxxxxxxx>, "paul gortmaker"
> <paul.gortmaker@xxxxxxxxxxxxx>
> 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@xxxxxxxxxx> 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