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

2017-06-02 Thread Michal Hocko
On Fri 02-06-17 07:40:12, Sasha Levin wrote: > On Fri, Jun 02, 2017 at 09:28:56AM +0200, Michal Hocko wrote: > > On Fri 02-06-17 07:17:22, Sasha Levin wrote: > > > On Mon, Mar 06, 2017 at 11:30:24AM +0100, Michal Hocko wrote: > > > > +void *kvmalloc_node(size_t size, gfp_t flags, int node) > > > >

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

2017-06-02 Thread Levin, Alexander (Sasha Levin)
On Fri, Jun 02, 2017 at 09:28:56AM +0200, Michal Hocko wrote: > On Fri 02-06-17 07:17:22, Sasha Levin wrote: > > On Mon, Mar 06, 2017 at 11:30:24AM +0100, Michal Hocko wrote: > > > +void *kvmalloc_node(size_t size, gfp_t flags, int node) > > > +{ > > > + gfp_t kmalloc_flags = flags; > > > + void *r

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

2017-06-02 Thread Michal Hocko
On Fri 02-06-17 07:17:22, Sasha Levin wrote: > On Mon, Mar 06, 2017 at 11:30:24AM +0100, 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 inter

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

2017-06-02 Thread Levin, Alexander (Sasha Levin)
On Mon, Mar 06, 2017 at 11:30:24AM +0100, 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 th

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

2017-03-06 Thread Michal Hocko
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 when doing so. Let's just add kv[mz]alloc and make

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

2017-01-30 Thread Michal Hocko
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 when doing so. Let's just add kv[mz]alloc and make