All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@kernel.org>, Nikolay Borisov <kernel@kyup.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: remove __GFP_NOFAIL is deprecated comment
Date: Mon, 7 Mar 2016 15:57:56 +0100	[thread overview]
Message-ID: <56DD96F4.1060805@suse.cz> (raw)
In-Reply-To: <20160225134850.GA4204@dhcp22.suse.cz>

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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@kernel.org>, Nikolay Borisov <kernel@kyup.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: remove __GFP_NOFAIL is deprecated comment
Date: Mon, 7 Mar 2016 15:57:56 +0100	[thread overview]
Message-ID: <56DD96F4.1060805@suse.cz> (raw)
In-Reply-To: <20160225134850.GA4204@dhcp22.suse.cz>

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.

  reply	other threads:[~2016-03-07 14:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 10:43 [PATCH] mm: remove __GFP_NOFAIL is deprecated comment Michal Hocko
2016-02-25 10:43 ` Michal Hocko
2016-02-25 11:36 ` Nikolay Borisov
2016-02-25 11:36   ` Nikolay Borisov
2016-02-25 13:48   ` Michal Hocko
2016-02-25 13:48     ` Michal Hocko
2016-03-07 14:57     ` Vlastimil Babka [this message]
2016-03-07 14:57       ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56DD96F4.1060805@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@kyup.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.