Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-30 Thread Vlastimil Babka
On 01/26/2017 01:09 PM, Michal Hocko wrote: On Thu 12-01-17 16:37:12, Michal Hocko wrote: [...] +void *kvmalloc_node(size_t size, gfp_t flags, int node) +{ + gfp_t kmalloc_flags = flags; + void *ret; + + /* +* vmalloc uses GFP_KERNEL for some internal allocations (e.g p

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-26 Thread Michal Hocko
On Thu 12-01-17 16:37:12, Michal Hocko wrote: [...] > +void *kvmalloc_node(size_t size, gfp_t flags, int node) > +{ > + gfp_t kmalloc_flags = flags; > + void *ret; > + > + /* > + * vmalloc uses GFP_KERNEL for some internal allocations (e.g page > tables) > + * so the given se

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-19 Thread John Hubbard
On 01/19/2017 01:56 AM, Michal Hocko wrote: On Thu 19-01-17 01:09:35, John Hubbard wrote: [...] So that leaves us with maybe this for documentation? * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL should not be passed in. * Passing in __GFP_REPEAT is supported, and will cause the followi

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-19 Thread Michal Hocko
On Thu 19-01-17 01:09:35, John Hubbard wrote: [...] > So that leaves us with maybe this for documentation? > > * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL should not be passed in. > * Passing in __GFP_REPEAT is supported, and will cause the following > behavior: > * for larger (>64KB)

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-19 Thread John Hubbard
On 01/19/2017 12:45 AM, Michal Hocko wrote: On Thu 19-01-17 00:37:08, John Hubbard wrote: On 01/18/2017 12:21 AM, Michal Hocko wrote: On Tue 17-01-17 21:59:13, John Hubbard wrote: [...] * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL should not be passed in. * Passing in __GFP_REPEAT

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-19 Thread Michal Hocko
On Thu 19-01-17 00:37:08, John Hubbard wrote: > > > On 01/18/2017 12:21 AM, Michal Hocko wrote: > > On Tue 17-01-17 21:59:13, John Hubbard wrote: [...] > > > * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL should not be > > > passed in. > > > * Passing in __GFP_REPEAT is supported, but no

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-19 Thread John Hubbard
On 01/18/2017 12:21 AM, Michal Hocko wrote: On Tue 17-01-17 21:59:13, John Hubbard wrote: On 01/16/2017 11:51 PM, Michal Hocko wrote: On Mon 16-01-17 13:57:43, John Hubbard wrote: On 01/16/2017 01:48 PM, Michal Hocko wrote: On Mon 16-01-17 13:15:08, John Hubbard wrote: On 01/16/2017 1

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-18 Thread Michal Hocko
On Tue 17-01-17 21:59:13, John Hubbard wrote: > > On 01/16/2017 11:51 PM, Michal Hocko wrote: > > On Mon 16-01-17 13:57:43, John Hubbard wrote: > > > > > > > > > On 01/16/2017 01:48 PM, Michal Hocko wrote: > > > > On Mon 16-01-17 13:15:08, John Hubbard wrote: > > > > > > > > > > > > > > > On 0

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-17 Thread John Hubbard
On 01/16/2017 11:51 PM, Michal Hocko wrote: On Mon 16-01-17 13:57:43, John Hubbard wrote: On 01/16/2017 01:48 PM, Michal Hocko wrote: On Mon 16-01-17 13:15:08, John Hubbard wrote: On 01/16/2017 11:40 AM, Michal Hocko wrote: On Mon 16-01-17 11:09:37, John Hubbard wrote: On 01/16/2017 1

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-16 Thread Michal Hocko
On Mon 16-01-17 13:57:43, John Hubbard wrote: > > > On 01/16/2017 01:48 PM, Michal Hocko wrote: > > On Mon 16-01-17 13:15:08, John Hubbard wrote: > > > > > > > > > On 01/16/2017 11:40 AM, Michal Hocko wrote: > > > > On Mon 16-01-17 11:09:37, John Hubbard wrote: > > > > > > > > > > > > > > > O

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-16 Thread John Hubbard
On 01/16/2017 01:48 PM, Michal Hocko wrote: On Mon 16-01-17 13:15:08, John Hubbard wrote: On 01/16/2017 11:40 AM, Michal Hocko wrote: On Mon 16-01-17 11:09:37, John Hubbard wrote: On 01/16/2017 12:47 AM, Michal Hocko wrote: On Sun 15-01-17 20:34:13, John Hubbard wrote: [...] Is that "

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-16 Thread Michal Hocko
On Mon 16-01-17 13:15:08, John Hubbard wrote: > > > On 01/16/2017 11:40 AM, Michal Hocko wrote: > > On Mon 16-01-17 11:09:37, John Hubbard wrote: > > > > > > > > > On 01/16/2017 12:47 AM, Michal Hocko wrote: > > > > On Sun 15-01-17 20:34:13, John Hubbard wrote: > > [...] > > > > > Is that "Recl

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-16 Thread John Hubbard
On 01/16/2017 11:40 AM, Michal Hocko wrote: On Mon 16-01-17 11:09:37, John Hubbard wrote: On 01/16/2017 12:47 AM, Michal Hocko wrote: On Sun 15-01-17 20:34:13, John Hubbard wrote: [...] Is that "Reclaim modifiers" line still true, or is it a leftover from an earlier approach? I am having

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-16 Thread Michal Hocko
On Mon 16-01-17 11:09:37, John Hubbard wrote: > > > On 01/16/2017 12:47 AM, Michal Hocko wrote: > > On Sun 15-01-17 20:34:13, John Hubbard wrote: [...] > > > Is that "Reclaim modifiers" line still true, or is it a leftover from an > > > earlier approach? I am having trouble reconciling it with re

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-16 Thread John Hubbard
On 01/16/2017 12:47 AM, Michal Hocko wrote: On Sun 15-01-17 20:34:13, John Hubbard wrote: On 01/12/2017 07:37 AM, Michal Hocko wrote: [...] diff --git a/mm/util.c b/mm/util.c index 3cb2164f4099..7e0c240b5760 100644 --- a/mm/util.c +++ b/mm/util.c @@ -324,6 +324,48 @@ unsigned long vm_mmap(

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-16 Thread Michal Hocko
On Sun 15-01-17 20:34:13, John Hubbard wrote: > > > On 01/12/2017 07:37 AM, Michal Hocko wrote: [...] > > diff --git a/mm/util.c b/mm/util.c > > index 3cb2164f4099..7e0c240b5760 100644 > > --- a/mm/util.c > > +++ b/mm/util.c > > @@ -324,6 +324,48 @@ unsigned long vm_mmap(struct file *file, unsign

Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers

2017-01-15 Thread John Hubbard
On 01/12/2017 07:37 AM, Michal Hocko wrote: From: Michal Hocko Using kmalloc with the vmalloc fallback for larger allocations is a common pattern in the kernel code. Yet we do not have any common helper for that and so users have invented their own helpers. Some of them are really creative wh