Re: [PATCH] mm/slub: disallow obj's allocation on page with mismatched pfmemalloc purpose
From: Pingfan Liu <hidden>
Date: 2018-09-27 13:15:42
From: Pingfan Liu <hidden>
Date: 2018-09-27 13:15:42
On Thu, Sep 27, 2018 at 12:14 AM Christopher Lameter [off-list ref] wrote:
On Wed, 26 Sep 2018, Pingfan Liu wrote:quoted
- if (unlikely(!freelist)) { slab_out_of_memory(s, gfpflags, node); return NULL; } + VM_BUG_ON(!pfmemalloc_match(page, gfpflags)); page = c->page; - if (likely(!kmem_cache_debug(s) && pfmemalloc_match(page, gfpflags))) + if (likely(!kmem_cache_debug(s)) goto load_freelist; /* Only entered in the debug case */ - if (kmem_cache_debug(s) && - !alloc_debug_processing(s, page, freelist, addr)) + if (!alloc_debug_processing(s, page, freelist, addr)) goto new_slab; /* Slab failed checks. Next slab needed */ - - deactivate_slab(s, page, get_freepointer(s, freelist), c);In the debug case the slab needs to be deactivated. Otherwise the slowpath will not be used and debug checks on the following objects will not be done.
Got it. Thanks, Pingfan