From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbcCGO6G (ORCPT ); Mon, 7 Mar 2016 09:58:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:35406 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634AbcCGO57 (ORCPT ); Mon, 7 Mar 2016 09:57:59 -0500 Subject: Re: [PATCH] mm: remove __GFP_NOFAIL is deprecated comment To: Michal Hocko , Nikolay Borisov References: <1456397002-27172-1-git-send-email-mhocko@kernel.org> <56CEE72B.5040009@kyup.com> <20160225134850.GA4204@dhcp22.suse.cz> Cc: Andrew Morton , David Rientjes , linux-mm@kvack.org, LKML From: Vlastimil Babka Message-ID: <56DD96F4.1060805@suse.cz> Date: Mon, 7 Mar 2016 15:57:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160225134850.GA4204@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.