Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4187207rdb; Thu, 14 Sep 2023 14:47:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4UE/7bOxNdHZEc0uBRX8Rq1UNxs6YRQZ+1MzSm3K73DeMRemNyRgd1Qieioet+cLNDutU X-Received: by 2002:a05:6a20:ce89:b0:153:beda:863 with SMTP id if9-20020a056a20ce8900b00153beda0863mr22755pzb.45.1694728026742; Thu, 14 Sep 2023 14:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694728026; cv=none; d=google.com; s=arc-20160816; b=nhfH5l7B6YFP0kNTjlXG3S+7KYbUs0FbMoGJuNo5925OV/qDPiIc5Qs282oYer9Nl0 QpJLDGnZwYZIpoLBRcj8BnF3KuZayr2maP4PtRYS6R2+70/ZeMygvmo/WrbtfYiaTgvw +A196HetRgQ06Fs3eWNw1Za9dch9SpkFScgTci+BrTbI6edtQEdodtYO2DKSvNdTqy5C 6jOqd1L4AtmB01Mb5ymMuMltpMNQUqloDfDgwGt59FAP97DsMT0LKlL7vfF+OIDLwYIK hyJ7LKLkHgXRLxKMi6D4rl2QSE9wqCcHair/HpmByA65mlOc8NoQXkVZ63F3qCCwrJxv tbYQ== 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:dkim-signature; bh=dqDv/hwF6Eczp53Duz1WARx/GLsoIfW+je4PWhL2caY=; fh=PnK5SldXcRGbOw0FqlCZ8fQajC4flIoNAR8U6fJoy74=; b=XcfBHuj6LStvj7yuiJ/wkAmxSfWMaCb0HaQSXjh8gzqDA7IFp2ZcRSvYEMbw9XKhX9 a1Vk3HQ2n7e/q4jEYqAVztzcRTcXo6+ms+TEXdaWcGcfWZvYePTeminYa5HV9SZivAKH LNEOpwmnHyAixzjTaUKr9rzZ7QTjElDeu2AZWOTLFlhsGOcfwPyqnVXaN8Ax97YeiW2t L9VxwRJ9oeMiel8uIADkMKc6WS/L5f3n1t1voeMqFtE5jYpl1RzzxmwK/dJgRiVQHZih FVQwEwV50M4LPpQsl7E5+vVTTMPkonaL1oe8IKwnE/7xPUIJQY3Xk9XFnVEBNq1hF7Vf a83g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=v2nCBNcw; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l7-20020a632507000000b00570a41b0417si2100755pgl.72.2023.09.14.14.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 14:47:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=v2nCBNcw; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BD3818286EB0; Thu, 14 Sep 2023 10:27:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239222AbjINR1T (ORCPT + 99 others); Thu, 14 Sep 2023 13:27:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239146AbjINR1A (ORCPT ); Thu, 14 Sep 2023 13:27:00 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06C0135AB; Thu, 14 Sep 2023 10:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dqDv/hwF6Eczp53Duz1WARx/GLsoIfW+je4PWhL2caY=; b=v2nCBNcwGOOcphelXerTWx6E8j LW19T5hhXfSy0yd/e+djrb8Vr5bgOcEv61v8A0VpXSh0qKvaQF/EL8VULTfb3kTixW+HSIriR63gK F/CmEWG5VrFhqvQFDt8agFNKe5h+AJ1usqhvWW9cj7M6AN8CSzkr0ANn5s3TPGnRWwaNzvqgDldaI vLzXZBxTT3MgPGxAnSo+sNq9H+h4sfB4oG8CCg0lfF18F1nCeKhiel8lm/D+E+mwjZHf3fwJirIoj 9inBEbAVJJNV1iS5EWrc9RFFPsi6n7TDo502SiyCCGzuMIR3Oe/REZf4v1bbjqL+GAYogV8P7qGQm kEGBKbpA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qgq69-004BiD-EZ; Thu, 14 Sep 2023 17:25:49 +0000 Date: Thu, 14 Sep 2023 18:25:49 +0100 From: Matthew Wilcox To: Jan Kara Cc: akpm@linux-foundation.org, Hui Zhu , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 2/3] buffer: Hoist GFP flags from grow_dev_page() to __getblk_gfp() Message-ID: References: <20230811161528.506437-1-willy@infradead.org> <20230811161528.506437-3-willy@infradead.org> <20230914091625.hjbmlanqc6sxonwi@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230914091625.hjbmlanqc6sxonwi@quack3> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 10:27:17 -0700 (PDT) On Thu, Sep 14, 2023 at 11:16:25AM +0200, Jan Kara wrote: > On Fri 11-08-23 17:15:27, Matthew Wilcox (Oracle) wrote: > > grow_dev_page() is only called by grow_buffers(). grow_buffers() > > is only called by __getblk_slow() and __getblk_slow() is only called > > from __getblk_gfp(), so it is safe to move the GFP flags setting > > all the way up. With that done, add a new bdev_getblk() entry point > > that leaves the GFP flags the way the caller specified them. > > > > Signed-off-by: Matthew Wilcox (Oracle) > > Can't we just finish this gfp parameter conversion for all the users? > There are five __getblk_gfp() users, three in buffer_head.h directly > generate gfp mask, two (__bread_gfp() and sb_getblk_gfp()) pass it from the > caller. All three __bread_gfp() callers are in buffer_head.h and directly > generate gfp mask. sb_getblk_gfp() has five callers, all in ext4 and easily > convertable as well. > > This results not only in cleaner code but also just checking > sb_getblk_gfp() callers shows how confused they currently are about the gfp > argument (passing NOFS, NOFAIL and other pointless flags). Secondly, we can > keep using sb_getblk_gfp() from the filesystems instead of having to decide > between sb_getblk_gfp() and bdev_getblk(). I didn't do __bread_gfp() because it's basically an internal interface. All users call sb_bread(), sb_bread_unmovable() or __bread(). It doesn't seem worth doing. Now, if we start to see people actually using __bread_gfp() outside of those three interfaces, I'd agree we need to make it use GFP flags properly. BTW, Andrew has taken the bdev_getblk() series into the mm tree, so testing that tree might be a good idea for the ext4 developers (and other filesystems; an earlier revision of this patchset had a bug which would have only affected nilfs2).