Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-03 Thread Michal Hocko
On Thu 02-08-18 22:21:53, Jeremy Linton wrote: > Hi, > > On 08/02/2018 04:15 AM, Michal Hocko wrote: > > On Wed 01-08-18 15:04:17, Jeremy Linton wrote: > > [...] > > > @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, > > > gfp_t gfpflags, int node, > > >

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-03 Thread Michal Hocko
On Thu 02-08-18 22:21:53, Jeremy Linton wrote: > Hi, > > On 08/02/2018 04:15 AM, Michal Hocko wrote: > > On Wed 01-08-18 15:04:17, Jeremy Linton wrote: > > [...] > > > @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, > > > gfp_t gfpflags, int node, > > >

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Jeremy Linton
Hi, On 08/02/2018 04:15 AM, Michal Hocko wrote: On Wed 01-08-18 15:04:17, Jeremy Linton wrote: [...] @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, if (unlikely(!node_match(page, searchnode))) { stat(s,

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Jeremy Linton
Hi, On 08/02/2018 04:15 AM, Michal Hocko wrote: On Wed 01-08-18 15:04:17, Jeremy Linton wrote: [...] @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, if (unlikely(!node_match(page, searchnode))) { stat(s,

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Jeremy Linton
Hi, On 08/02/2018 09:23 AM, Christopher Lameter wrote: On Wed, 1 Aug 2018, Jeremy Linton wrote: diff --git a/mm/slub.c b/mm/slub.c index 51258eff4178..e03719bac1e2 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags,

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Jeremy Linton
Hi, On 08/02/2018 09:23 AM, Christopher Lameter wrote: On Wed, 1 Aug 2018, Jeremy Linton wrote: diff --git a/mm/slub.c b/mm/slub.c index 51258eff4178..e03719bac1e2 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags,

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Christopher Lameter
On Wed, 1 Aug 2018, Jeremy Linton wrote: > diff --git a/mm/slub.c b/mm/slub.c > index 51258eff4178..e03719bac1e2 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t > gfpflags, int node, > if

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Christopher Lameter
On Wed, 1 Aug 2018, Jeremy Linton wrote: > diff --git a/mm/slub.c b/mm/slub.c > index 51258eff4178..e03719bac1e2 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t > gfpflags, int node, > if

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Michal Hocko
On Wed 01-08-18 15:04:17, Jeremy Linton wrote: [...] > @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t > gfpflags, int node, > if (unlikely(!node_match(page, searchnode))) { > stat(s, ALLOC_NODE_MISMATCH); >

Re: [RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-02 Thread Michal Hocko
On Wed 01-08-18 15:04:17, Jeremy Linton wrote: [...] > @@ -2519,6 +2519,8 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t > gfpflags, int node, > if (unlikely(!node_match(page, searchnode))) { > stat(s, ALLOC_NODE_MISMATCH); >

[RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-01 Thread Jeremy Linton
If a user calls the *alloc_node() functions with an invalid node its possible to crash in alloc_pages_nodemask because NODE_DATA() returns a bad node, which propogates into the node zonelist in prepare_alloc_pages. This avoids that by not trying to allocate new slabs against offline nodes.

[RFC 1/2] slub: Avoid trying to allocate memory on offline nodes

2018-08-01 Thread Jeremy Linton
If a user calls the *alloc_node() functions with an invalid node its possible to crash in alloc_pages_nodemask because NODE_DATA() returns a bad node, which propogates into the node zonelist in prepare_alloc_pages. This avoids that by not trying to allocate new slabs against offline nodes.