Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4543030pxb; Tue, 5 Oct 2021 05:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx85JqavGJY98MMwGQZbA4KXlod+TODdL+BSAy7Mm3Ea6NJJSg2/E5PPWJsyYhHw51js3bq X-Received: by 2002:a17:902:6849:b0:13e:97cf:416a with SMTP id f9-20020a170902684900b0013e97cf416amr4902640pln.79.1633436899012; Tue, 05 Oct 2021 05:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633436899; cv=none; d=google.com; s=arc-20160816; b=qPYov489zz8AGP8b6OLj0fVsvsgIKBFFHC5Yaejxl0z/59ySGiH4+OVDfoHAHVjz+4 67M8tNiHJxtLrVR/DoWhKkCQFuWrpU5G6yll93zBPLqd46ulKt9oQPQ+z3fdr8bKa5X3 92woKZMXh1+WV0ByF0lTaG+MjLaGP2DB4i8b1qbdHUoEhKefLSV9wbxH6xsVolrxyHV5 3T0JM9fu2Kw64S+12oK6Y/EDNN4RfCCu1KPdlLf3unRQQ4bKNdJU5ZTDza2I8sZF4l79 T3Aa0PTb2HhNULmLndzkG5MgzxW5uRnEaqbW2XkbSiovCiNGWkPKxbifzFn+NT1HWkKE kZFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=JjGOU28aseIxzbgxmKKGBf+lfKA8napnrkp1mk29VtE=; b=GjeaXZMu4/6FqXQrWKhwDyGKKDEMMygrZGS1/L6FXEMJL+94bASOMcnZBNA6WH6SiX XG8uIlfOz+eyeaWIXzu32DBRnuTGbDxr11+cw9GtUcGny6vMFzkOCEyHOsQgqCxJuGQK 3iK/KeVSAKOuF6RQijl1mItLtOZFqap+dA/WH6R3WoKVoHilwF4s7/yjYH55KAxDl7bI c3Y0cDtW1LWIOmct9Oyb1BqVtYPurVqcZThxxUCfTeGRgUgK6yrwpyswAoTyYqOh0LAN ebDUinWtbmH+zs0ie4fN6vRZ4YY94n1SayfjAoL9v7qbeh50Oxf5delVnSuVpHFoz69P 0pzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Bzpre7we; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si23611984pfj.249.2021.10.05.05.27.57; Tue, 05 Oct 2021 05:28:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Bzpre7we; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234714AbhJEM3i (ORCPT + 99 others); Tue, 5 Oct 2021 08:29:38 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:52934 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234401AbhJEM3i (ORCPT ); Tue, 5 Oct 2021 08:29:38 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 054E220020; Tue, 5 Oct 2021 12:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1633436866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JjGOU28aseIxzbgxmKKGBf+lfKA8napnrkp1mk29VtE=; b=Bzpre7weOsXJ/u0YLszAyXJT5NP2OpWOG4HD0n3NXs9HPxWb/XUtF8fVLg5+g0fPQL7LIJ J+ePJ6f5kRNWYMjcrWW79ogSqTmH18OMCLxa5kV7b9ZPYN+22E9C2nckip1BhlQLaiO4EX QPHzankMnoMtHNaLmhKTwWqqdxyCKDk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1633436866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JjGOU28aseIxzbgxmKKGBf+lfKA8napnrkp1mk29VtE=; b=JcXixsvED2f4ufImevKRnrpIhO7jiSyFefYaC+44w0N5Nf8Va0GlAZnYmtiF0is3Ufq1tf FDf4ReDNhB2Fa1AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B2EE113C50; Tue, 5 Oct 2021 12:27:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id aGXfKsFEXGHXawAAMHmgww (envelope-from ); Tue, 05 Oct 2021 12:27:45 +0000 Message-ID: Date: Tue, 5 Oct 2021 14:27:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH 2/6] MM: improve documentation for __GFP_NOFAIL Content-Language: en-US To: Michal Hocko Cc: NeilBrown , Andrew Morton , Theodore Ts'o , Andreas Dilger , "Darrick J. Wong" , Matthew Wilcox , Mel Gorman , ". Dave Chinner" , Jonathan Corbet , linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <163184698512.29351.4735492251524335974.stgit@noble.brown> <163184741778.29351.16920832234899124642.stgit@noble.brown> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 10/5/21 13:09, Michal Hocko wrote: > On Tue 05-10-21 11:20:51, Vlastimil Babka wrote: > [...] >> > --- a/include/linux/gfp.h >> > +++ b/include/linux/gfp.h >> > @@ -209,7 +209,11 @@ struct vm_area_struct; >> > * used only when there is no reasonable failure policy) but it is >> > * definitely preferable to use the flag rather than opencode endless >> > * loop around allocator. >> > - * Using this flag for costly allocations is _highly_ discouraged. >> > + * Use of this flag may lead to deadlocks if locks are held which would >> > + * be needed for memory reclaim, write-back, or the timely exit of a >> > + * process killed by the OOM-killer. Dropping any locks not absolutely >> > + * needed is advisable before requesting a %__GFP_NOFAIL allocate. >> > + * Using this flag for costly allocations (order>1) is _highly_ discouraged. >> >> We define costly as 3, not 1. But sure it's best to avoid even order>0 for >> __GFP_NOFAIL. Advising order>1 seems arbitrary though? > > This is not completely arbitrary. We have a warning for any higher order > allocation. > rmqueue: > WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)); Oh, I missed that. > I do agree that "Using this flag for higher order allocations is > _highly_ discouraged. Well, with the warning in place this is effectively forbidden, not just discouraged. >> > */ >> > #define __GFP_IO ((__force gfp_t)___GFP_IO) >> > #define __GFP_FS ((__force gfp_t)___GFP_FS) >> > >> > >> > >