Re: [PATCH] mm/slub: disallow obj's allocation on page with mismatched pfmemalloc purpose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 26 Sep 2018, Pingfan Liu wrote:

> -
>  	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.

> -	return freelist;
> +	else
> +		goto load_freelist;
>  }
>
>  /*
>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux