From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754792AbbCBUd3 (ORCPT ); Mon, 2 Mar 2015 15:33:29 -0500 Received: from mail-ie0-f176.google.com ([209.85.223.176]:36229 "EHLO mail-ie0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754187AbbCBUdZ (ORCPT ); Mon, 2 Mar 2015 15:33:25 -0500 Date: Mon, 2 Mar 2015 12:33:21 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Dave Chinner , "Theodore Ts'o" , Mel Gorman , Tetsuo Handa , "David S. Miller" , sparclinux@vger.kernel.org, Vipul Pandya , netdev@vger.kernel.org, LKML Subject: Re: [RFC 2/4] jbd2: revert must-not-fail allocation loops back to GFP_NOFAIL In-Reply-To: <1425304483-7987-3-git-send-email-mhocko@suse.cz> Message-ID: References: <1425304483-7987-1-git-send-email-mhocko@suse.cz> <1425304483-7987-3-git-send-email-mhocko@suse.cz> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Mar 2015, Michal Hocko wrote: > This basically reverts 47def82672b3 (jbd2: Remove __GFP_NOFAIL from jbd2 > layer). The deprecation of __GFP_NOFAIL was a bad choice because it led > to open coding the endless loop around the allocator rather than > removing the dependency on the non failing allocation. So the > deprecation was a clear failure and the reality tells us that > __GFP_NOFAIL is not even close to go away. > > It is still true that __GFP_NOFAIL allocations are generally discouraged > and new uses should be evaluated and an alternative (pre-allocations or > reservations) should be considered but it doesn't make any sense to lie > the allocator about the requirements. Allocator can take steps to help > making a progress if it knows the requirements. > The changelog should state that this only changes the source code, there is no functional change since alloc_buffer_head() and kmem_cache_zalloc(transaction_cache) are already implicitly nofail due to the allocation order. The failure code added by the commit you cite are never executed. I agree that if the implementation of the page allocator were to change with respect to PAGE_ALLOC_COSTLY_ORDER that we'd need __GFP_NOFAIL and that such an allocation is better handled in the page allocator. > Signed-off-by: Michal Hocko Acked-by: David Rientjes GFP_NOFS|__GFP_NOFAIL is scary.