Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp172440pxb; Tue, 14 Sep 2021 22:26:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbLVUjo08hqArsfQkzAYyPILzYS+Kbk0UNhWhe3hN33KKXeqW7LX1RMSZpf31sJxE+OTX3 X-Received: by 2002:a05:6e02:1906:: with SMTP id w6mr15483536ilu.295.1631683580234; Tue, 14 Sep 2021 22:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631683580; cv=none; d=google.com; s=arc-20160816; b=NbUn65aCPqs5EsL0Jnbbwaf4xsNVVoN+X/H1x+4nLkkuoKWVjLuPUS5EMmF477JdET 3E8xh2fsws1KyHtNgd9YdKrdU8CFon23+D7E6FQdGeOMwhrCxXkDXAzX3seQ3Oum5lwn T2k/nrpN4XAiuKjUvGGLIMp3fCPPxTENqnvVIzmJyi2VWUJC1xFdHMcy9FJh8p1vE0Su hbomb6JQBOyMUnmV0GaU1fL2h/cMdryZXP16i/bQMtEVnq7kpjLtApzDi3zYoUNEd+5C 8P6koYBjhEvfKX0Lv9ARp0A8HZsq9zXlMS3isdeROZud8jAJ3/2IC9UPkOTTRt5P4HSB gxuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=5rpIEUD5so8R8lo0Kya+cAjrjZjxenoFRV8Funr8FNM=; b=jZL4XC13FM5LeSejmIEVx5IcKMrRq18MOgMInqlH5Dd1mbXO7DZc99aILYhPv1HyDl qZo5xci8wJLdetOvRYqEhpRKR/nrU0e+8Wo1kloMaeYWxHcxaKWv/ewaH5oscxKv8eCP j37xvibkqUmcPUXBMfRYdEid/0O/qYaRQS7yEC62eRA50mgASySnApYYowW9eMXfQh7k JmFfxezqsz/C5IMgrGg5p1/30PuNafGrRdz87EiX0dmfdkPyToKIlUG8JOMv704lICtM 6NWXVR7Sxbx2qrb7vZlaCSSA4xjST4XOKpX9sjvGZlw0khCZIX42LfzMhGnXm1gzceaZ uiCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HTkyFs6M; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="p5hccMX/"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c30si2017230jaf.100.2021.09.14.22.25.55; Tue, 14 Sep 2021 22:26:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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.de header.s=susede2_rsa header.b=HTkyFs6M; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="p5hccMX/"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234397AbhIOF1H (ORCPT + 99 others); Wed, 15 Sep 2021 01:27:07 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:42952 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbhIOF1G (ORCPT ); Wed, 15 Sep 2021 01:27:06 -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 0169420160; Wed, 15 Sep 2021 05:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1631683547; 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=5rpIEUD5so8R8lo0Kya+cAjrjZjxenoFRV8Funr8FNM=; b=HTkyFs6MSrLXg0WBmwRpij6M/0GLyo+CxIVFJ6D35QRqYTjLRHmjsKpG6s5Zzl2evdpfYr 68nSBxVD+NMBGCugWu5SX5T+DonUBOalYurNLVbK1LDv96kXAGvXKmO+OH10e3fusaGBBl 3cL/i9CpPhzR3L4AhN/PzHB28ontTC4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1631683547; 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=5rpIEUD5so8R8lo0Kya+cAjrjZjxenoFRV8Funr8FNM=; b=p5hccMX/1F9hQZbpKyU9G4EyM6UQTSNuOyG/CFWbr3Ir97QT7dTE0v3+g1uze/1KReNTqY bQHsvo598OY4T+CQ== 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 8B76013C12; Wed, 15 Sep 2021 05:25:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YA0zEteDQWHtYAAAMHmgww (envelope-from ); Wed, 15 Sep 2021 05:25:43 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Theodore Ts'o" Cc: "Andrew Morton" , "Andreas Dilger" , "Darrick J. Wong" , "Matthew Wilcox" , "Mel Gorman" , 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 Subject: Re: [PATCH 3/6] EXT4: Remove ENOMEM/congestion_wait() loops. In-reply-to: References: <163157808321.13293.486682642188075090.stgit@noble.brown>, <163157838437.13293.14244628630141187199.stgit@noble.brown>, Date: Wed, 15 Sep 2021 15:25:40 +1000 Message-id: <163168354018.3992.580533638417199797@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 15 Sep 2021, Theodore Ts'o wrote: > On Tue, Sep 14, 2021 at 10:13:04AM +1000, NeilBrown wrote: > >=20 > > Of particular interest is the ext4_journal_start family of calls which > > can now have EXT4_EX_NOFAIL 'or'ed in to the 'type'. This could be seen > > as a blurring of types. However 'type' is 8 bits, and EXT4_EX_NOFAIL is > > a high bit, so it is safe in practice. >=20 > I'm really not fond of this type blurring. What I'd suggeset doing > instead is adding a "gfp_t gfp_mask" parameter to the > __ext4_journal_start_sb(). With the exception of one call site in > fs/ext4/ialloc.c, most of the callers of __ext4_journal_start_sb() are > via #define helper macros or inline funcions. So it would just > require adding a GFP_NOFS as an extra parameter to the various macros > and inline functions which call __ext4_journal_start_sb() in > ext4_jbd2.h. >=20 > The function ext4_journal_start_with_revoke() is called exactly once > so we could just bury the __GFP_NOFAIL in the definition of that > macros, e.g.: >=20 > #define ext4_journal_start_with_revoke(inode, type, blocks, revoke_creds) \ > __ext4_journal_start((inode), __LINE__, (type), (blocks), 0, \ > GFP_NOFS | __GFP_NOFAIL, (revoke_creds)) >=20 > but it's probably better to do something like this: >=20 > #define ext4_journal_start_with_revoke(gfp_mask, inode, type, blocks, revok= e_creds) \ > __ext4_journal_start((inode), __LINE__, (type), (blocks), 0, \ > gfp_mask, (revoke_creds)) >=20 > So it's explicit in the C function ext4_ext_remove_space() in > fs/ext4/extents.c that we are explicitly requesting the __GFP_NOFAIL > behavior. >=20 > Does that make sense? Mostly. Adding gfp_mask to __ext4_journal_start_sb() make perfect sense. There doesn't seem much point adding one to __ext4_journal_start(), we can have ext4_journal_start_with_revoke() call __ext4_journal_start_sb() directly. But I cannot see what it doesn't already do that. i.e. why have the inline __ext4_journal_start() at all? Is it OK if I don't use that for ext4_journal_start_with_revoke()? Thanks, NeilBrown