Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1351675 > unrolled thread

Re: [PATCH] mm: remove __GFP_NOFAIL is deprecated comment

Started byVlastimil Babka <vbabka@suse.cz>
First post2016-03-07 16:00 +0100
Last post2016-03-07 16:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] mm: remove __GFP_NOFAIL is deprecated comment Vlastimil Babka <vbabka@suse.cz> - 2016-03-07 16:00 +0100

#1351675 — Re: [PATCH] mm: remove __GFP_NOFAIL is deprecated comment

FromVlastimil Babka <vbabka@suse.cz>
Date2016-03-07 16:00 +0100
SubjectRe: [PATCH] mm: remove __GFP_NOFAIL is deprecated comment
Message-ID<ra4NA-49R-27@gated-at.bofh.it>
On 02/25/2016 02:48 PM, Michal Hocko wrote:
> On Thu 25-02-16 13:36:11, Nikolay Borisov wrote:
> -		if (unlikely(gfp_flags & __GFP_NOFAIL)) {
> -			/*
> -			 * __GFP_NOFAIL is not to be used in new code.
> -			 *
> -			 * All __GFP_NOFAIL callers should be fixed so that they
> -			 * properly detect and handle allocation failures.
> -			 *
> -			 * We most definitely don't want callers attempting to
> -			 * allocate greater than order-1 page units with
> -			 * __GFP_NOFAIL.
> -			 */
> -			WARN_ON_ONCE(order > 1);
> -		}
> +		/*
> +		 * We most definitely don't want callers attempting to
> +		 * allocate greater than order-1 page units with __GFP_NOFAIL.
> +		 */
> +		WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1));
>   		spin_lock_irqsave(&zone->lock, flags);
>
>   		page = NULL;
>

Hmm, even the reduced text (and the WARN_ON in the first place) sounds 
IMHO discouraging enough to make people think that opencoding a loop 
around such allocations is a good workaround. Yeah, we have a 
better/more thorough explanation around the __GFP_NOFAIL definition, but 
the WARN_ON will point people here.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web