Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp18509pxb; Tue, 14 Sep 2021 17:29:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6wo99C1dl4cxkzsOQPkmwPnJkr1g7XLEIq8P2XLbUXqgpCv2ja62ttmHSw/MguX/iiEVQ X-Received: by 2002:a05:6512:3f9f:: with SMTP id x31mr16010381lfa.233.1631665771657; Tue, 14 Sep 2021 17:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631665771; cv=none; d=google.com; s=arc-20160816; b=DY5pfOuX2JCw6RkZ3qdkdwWtxQ0flKAGS7+tc+8DZETamDfhewMSGSEvet1m98uMcm 4gQm/+LA8A6xRFik1kbsoaOZD0Ln5vbB6pHjOpStzDuRsl4eThuo9qBAVRtv7hlV4xTr lGHvJ+OesW+ivGawli5OmEAtfksr5+OZ4TBIIe83BLlE1IxveGVaudMIQ/TX8qq6a8Ht HPsDqzt+wkL14ovCvcrTfpoi6uW/IqIbqEvlrzE7VPP84JYPx3cqdiq8N1T/YCYhL52z bXmQv7zTcNR2H5HgJZiO3mF/MAnbwCqIyrFgBmVHoLWiKKBuBxrMOtAlxSMjUzRM6g+x 2vWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=3bbuLO5/bR+k4fK7IWwit5Cu4PzhNBHD6+5k8qyo3lY=; b=tzO+XN/aSXERpogb5CD6sVEDlO+jP11HMQzgHoNfBZ5XdOc0WYBASUWuuLv9Ru2H3B myc90v4NcCBRBx0T6hQUkCblk5y7xjpZ3+yw74eZjenJb92fRtRZBaiKsoG3vVeqXKHF 8vMqfp6cRy7P4dcJIMehqSzIQAWhMV1zF81Eco1xuQtq5hN39znEN9HObBuRkD0VzrvF UdzMtuQlJwWWcCx5VKEutLXVsmacVz3yGdJY5/CzO95G1s1iwdS26wEILBpO4mpTKwwI mDy9KhKaALpdmsXFqI8J39fyILMaEEf/GruOiRJlb4D3+5mruGXcoPxIXDgY/objV50i 40vQ== ARC-Authentication-Results: i=1; mx.google.com; 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 r19si16584257lji.46.2021.09.14.17.28.57; Tue, 14 Sep 2021 17:29:31 -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; 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 S230055AbhIOAaM (ORCPT + 99 others); Tue, 14 Sep 2021 20:30:12 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:41785 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229991AbhIOAaL (ORCPT ); Tue, 14 Sep 2021 20:30:11 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 18F0SW4D005150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Sep 2021 20:28:32 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id EEB2F15C3424; Tue, 14 Sep 2021 20:28:31 -0400 (EDT) Date: Tue, 14 Sep 2021 20:28:31 -0400 From: "Theodore Ts'o" To: NeilBrown 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. Message-ID: References: <163157808321.13293.486682642188075090.stgit@noble.brown> <163157838437.13293.14244628630141187199.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163157838437.13293.14244628630141187199.stgit@noble.brown> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Sep 14, 2021 at 10:13:04AM +1000, NeilBrown wrote: > > 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. 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. 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.: #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)) but it's probably better to do something like this: #define ext4_journal_start_with_revoke(gfp_mask, inode, type, blocks, revoke_creds) \ __ext4_journal_start((inode), __LINE__, (type), (blocks), 0, \ gfp_mask, (revoke_creds)) 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. Does that make sense? - Ted