Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-30 Thread David Rientjes
Hi Mike, On Tue, 29 May 2018, Mike Kravetz wrote: > > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > > page fault handler. > > > > Instead, return the proper error code, ERR_PTR(-ENOMEM), so

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-30 Thread David Rientjes
Hi Mike, On Tue, 29 May 2018, Mike Kravetz wrote: > > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > > page fault handler. > > > > Instead, return the proper error code, ERR_PTR(-ENOMEM), so

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-29 Thread Mike Kravetz
On 05/25/2018 01:16 PM, David Rientjes wrote: > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > page fault handler. > > Instead, return the proper error code, ERR_PTR(-ENOMEM), so VM_FAULT_OOM > is

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-29 Thread Mike Kravetz
On 05/25/2018 01:16 PM, David Rientjes wrote: > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > page fault handler. > > Instead, return the proper error code, ERR_PTR(-ENOMEM), so VM_FAULT_OOM > is

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-28 Thread Michal Hocko
On Fri 25-05-18 15:18:11, David Rientjes wrote: [...] > Let's see what Mike and Aneesh say, because they may object to using > VM_FAULT_OOM because there's no way to guarantee that we'll come under the > limit of hugetlb_cgroup as a result of the oom. My assumption is that we > use

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-28 Thread Michal Hocko
On Fri 25-05-18 15:18:11, David Rientjes wrote: [...] > Let's see what Mike and Aneesh say, because they may object to using > VM_FAULT_OOM because there's no way to guarantee that we'll come under the > limit of hugetlb_cgroup as a result of the oom. My assumption is that we > use

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-28 Thread Michal Hocko
On Fri 25-05-18 13:16:45, David Rientjes wrote: > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > page fault handler. > > Instead, return the proper error code, ERR_PTR(-ENOMEM), so VM_FAULT_OOM > is

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-28 Thread Michal Hocko
On Fri 25-05-18 13:16:45, David Rientjes wrote: > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > page fault handler. > > Instead, return the proper error code, ERR_PTR(-ENOMEM), so VM_FAULT_OOM > is

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread David Rientjes
On Fri, 25 May 2018, Andrew Morton wrote: > > > > --- a/mm/hugetlb.c > > > > +++ b/mm/hugetlb.c > > > > @@ -2006,8 +2006,10 @@ struct page *alloc_huge_page(struct > > > > vm_area_struct *vma, > > > > * code of zero indicates a reservation exists (no change). > > > > */ > > > >

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread David Rientjes
On Fri, 25 May 2018, Andrew Morton wrote: > > > > --- a/mm/hugetlb.c > > > > +++ b/mm/hugetlb.c > > > > @@ -2006,8 +2006,10 @@ struct page *alloc_huge_page(struct > > > > vm_area_struct *vma, > > > > * code of zero indicates a reservation exists (no change). > > > > */ > > > >

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread Andrew Morton
On Fri, 25 May 2018 13:59:40 -0700 (PDT) David Rientjes wrote: > > > --- a/mm/hugetlb.c > > > +++ b/mm/hugetlb.c > > > @@ -2006,8 +2006,10 @@ struct page *alloc_huge_page(struct vm_area_struct > > > *vma, > > >* code of zero indicates a reservation exists (no change).

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread Andrew Morton
On Fri, 25 May 2018 13:59:40 -0700 (PDT) David Rientjes wrote: > > > --- a/mm/hugetlb.c > > > +++ b/mm/hugetlb.c > > > @@ -2006,8 +2006,10 @@ struct page *alloc_huge_page(struct vm_area_struct > > > *vma, > > >* code of zero indicates a reservation exists (no change). > > >*/ > > >

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread David Rientjes
On Fri, 25 May 2018, Andrew Morton wrote: > On Fri, 25 May 2018 13:16:45 -0700 (PDT) David Rientjes > wrote: > > > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > > page fault

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread David Rientjes
On Fri, 25 May 2018, Andrew Morton wrote: > On Fri, 25 May 2018 13:16:45 -0700 (PDT) David Rientjes > wrote: > > > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > > page fault handler. > > > >

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread Andrew Morton
On Fri, 25 May 2018 13:16:45 -0700 (PDT) David Rientjes wrote: > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > page fault handler. > > Instead, return the proper error code,

Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread Andrew Morton
On Fri, 25 May 2018 13:16:45 -0700 (PDT) David Rientjes wrote: > When charging to a hugetlb_cgroup fails, alloc_huge_page() returns > ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the > page fault handler. > > Instead, return the proper error code, ERR_PTR(-ENOMEM), so

[patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread David Rientjes
When charging to a hugetlb_cgroup fails, alloc_huge_page() returns ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the page fault handler. Instead, return the proper error code, ERR_PTR(-ENOMEM), so VM_FAULT_OOM is handled correctly. This is consistent with failing mem cgroup

[patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails

2018-05-25 Thread David Rientjes
When charging to a hugetlb_cgroup fails, alloc_huge_page() returns ERR_PTR(-ENOSPC) which will cause VM_FAULT_SIGBUS to be returned to the page fault handler. Instead, return the proper error code, ERR_PTR(-ENOMEM), so VM_FAULT_OOM is handled correctly. This is consistent with failing mem cgroup