From patchwork Tue Jan 23 09:43:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13527108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D787C47DDB for ; Tue, 23 Jan 2024 09:59:48 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rSDZK-0004tH-8v; Tue, 23 Jan 2024 09:59:46 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rSDZI-0004sw-Q5 for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xwNR4/EZjtvmjPU5B92P0twDrTPGvgcwhXfRvMp8W3M=; b=L6wcO6WVCWBrrEAeJP6BI9jmNW H4L9q8hxr7oWxUuhWGZUHjai8OvGuQxuDpq/IdCDiksahgI0S7dfBosPzF2A7Vp+bNCkmRU6AvNI2 qZHqHdwN9WpzWlFjIb1J1NOlfGEggDGcVgans187WrWPKI/LG01vucEBWBLAN0qo/MsM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xwNR4/EZjtvmjPU5B92P0twDrTPGvgcwhXfRvMp8W3M=; b=aLNDNSTOtMLJsZlB+iuNis3bV3 0l2a0FU0elyWNTIXPrm4DkMfDGOnCy3Ig2CDK8vtyLQvCkMSTMp76cukbJByQAoJHH8MutBus9MTl lbfMfJnnDLKjCWWxm+HZAU1r9Op+V1U1mq7wUjOSpfMMKzJTGm3zTWZP2En2fsvLp8Ys=; Received: from esa3.hgst.iphmx.com ([216.71.153.141]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rSDZH-0000SS-W1 for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003984; x=1737539984; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=USx+V+gR/5Lk+0GJr2lbq1FeCI2pXKMzpek+ct39bMM=; b=X+1t1vJDLsezySht2wYw8R7QzBdNOvZIK120rnzSDIovY/t2peUlpizx +vSVJJ+YH0nGL6ibN0FR4qu+q4wJ8VMAWHBQRmKew4SkpJj6gfVG4ycGW ECw/unWHcmbOb1te2eYngBgJEIVVJDQw2ivONsmuG1yVwDfA7XjxKWJQd qRjRsxRFOdwUyBkcefS/xPNqdu03oSSqfE/GNclVQ/gx5nOSu8VDN+Qp2 yQwcNs2RJCJOSKnpd+NQk3tF5MPALRuCk80wQZr2Km3xb4AXSYQz4vTz1 PEYoglaNLbR+/4qeBQlBrw6reG1cdu8WTGoyDLYEbOetW9+5lc5jeqJze g==; X-CSE-ConnectionGUID: BOkBxo6+RfijPaJ+38di5g== X-CSE-MsgGUID: diTUpXrVRH+D/od8CmUEqw== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7462059" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:43:56 +0800 IronPort-SDR: xvvsWJXd9mKOetnrFiXw3/09pHul/s6QYoJlOEF3Gfv66CTp7o0QuPp26XlFcQX6asGtf5de+4 YgJpntwVNd7w== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:48:17 -0800 IronPort-SDR: P3OOCgnEiOoiT5kro0hhE2puMVinRxHrlbO9eu21ZDBzEa4K+SZFeEYuAtZNHIp7Zz4lNvn0Hv sg9b/x3sDNFA== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 23 Jan 2024 01:43:50 -0800 Date: Tue, 23 Jan 2024 01:43:42 -0800 MIME-Version: 1.0 Message-Id: <20240123-zonefs_nofs-v1-1-cc0b0308ef25@wdc.com> References: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> In-Reply-To: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> To: Damien Le Moal , Naohiro Aota , Mike Snitzer , dm-devel@lists.linux.dev, Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706003027; l=967; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=USx+V+gR/5Lk+0GJr2lbq1FeCI2pXKMzpek+ct39bMM=; b=CqyzAxjrtVF3h1COiTD1vUp/FvMExp42Wy7b72mtI/+VK3Cc+nQQgb8KdYlLZ32Qn9DwLPhCQ 2dpOdt+5tGWBTomHGv+qgGPRnYLx+GcwkDEU2N7SunPs8Zz3A98pXO5 X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Headers-End: 1rSDZH-0000SS-W1 Subject: [f2fs-dev] [PATCH 1/5] zonefs: pass GFP_KERNEL to blkdev_zone_mgmt() call X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Johannes Thumshirn via Linux-f2fs-devel From: Johannes Thumshirn Reply-To: Johannes Thumshirn Cc: Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, "Matthew Wilcox \(Oracle\)" , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Pass GFP_KERNEL instead of GFP_NOFS to the blkdev_zone_mgmt() call in zonefs_zone_mgmt(). As as zonefs_zone_mgmt() and zonefs_inode_zone_mgmt() are never called from a place that can recurse back into the filesystem on memory reclaim, it is save to call blkdev_zone_mgmt() with GFP_KERNEL. Signed-off-by: Johannes Thumshirn --- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 93971742613a..63fbac018c04 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -113,7 +113,7 @@ static int zonefs_zone_mgmt(struct super_block *sb, trace_zonefs_zone_mgmt(sb, z, op); ret = blkdev_zone_mgmt(sb->s_bdev, op, z->z_sector, - z->z_size >> SECTOR_SHIFT, GFP_NOFS); + z->z_size >> SECTOR_SHIFT, GFP_KERNEL); if (ret) { zonefs_err(sb, "Zone management operation %s at %llu failed %d\n", From patchwork Tue Jan 23 09:43:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13527107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1E40C47DDC for ; Tue, 23 Jan 2024 09:59:47 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rSDZK-00010x-Cg; Tue, 23 Jan 2024 09:59:46 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rSDZJ-00010r-C4 for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7IyULlbq2i/AZhH32Afb7WsVyfQNBfYwO7GDrodkVh0=; b=fiOABKwo/EmK7XTFRkITsbR0+P 4Kh4v57ar5Hx1t6WbFs3kb/A9NjeRmmd4sNStwA1C+7a3+SH1wfvF1hEcm6L/aqQAN0rlxE1F0q1I 6ChSOrALlCtHbUYRJHiy+XcTZqoIk6gzC6FS7PJ7YvqRunxuwJHe4INH89jMcenndjHA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7IyULlbq2i/AZhH32Afb7WsVyfQNBfYwO7GDrodkVh0=; b=JTCRcOULxg6XWSiiTIsVB0B58h kjlrBg1GCepwYUkAA5Plun9hZBqj475sBzz449cAVVNHDrLFjWUB0x0agNkMntaA3xDrjJbw8N0Ep kPEIyZp/9QIiX9HE1oxodM5/OhcKqdTbjlUe+OmrJC84Up5P9XqHMk1RnmhF8JShFVD4=; Received: from esa3.hgst.iphmx.com ([216.71.153.141]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rSDZI-0000SS-Kf for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003985; x=1737539985; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=aNukikOqhJIFNWqZ0ODBJWyAugGq+LPMMd8TTS5AKQ4=; b=Ru15lQUSt8nxDjoynYfMcuYmqyQO38mF/xXdxTP/33bSMuFQd6W+5xy/ wMERyLqPgEQUAj90IO1JBFfliKLliHhkMQOZ+D+vdNeJ12DMMRREVfC8R sc37RuOtFKs5vC8TcdtfB0Fd36/HATRdz4OvwcciVh4+1HBIrehDgh9JM CSuiNJ5zR8ljcxsa91lmHDCxJ2UC5MA8s8bQxpZ+/3rEbk5i6sV+qek6n 7cgquR3ND2ZH492FyW9nQYjWJDanZOsA/qt4SOMMW0qKKVsar3DOCF4b1 +x+Cn5IhVMZ822TzMx1f1p5yfNyXS4UFeWEImGMVUoxFG8J9v4XDJeG64 w==; X-CSE-ConnectionGUID: ube1Cp7WS8id/CYJO1lneA== X-CSE-MsgGUID: 4JhcnuohT6WfkiUiNa38NA== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7462065" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:43:59 +0800 IronPort-SDR: 5YCDkOFdt0K3N3F36eCHXpRY8S7nAjsGzFzHoZwel2+jROQXpWl6WUENz/dW6I9PByRfgwN5hX WVMQHl49FC/g== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:48:20 -0800 IronPort-SDR: dAsmsPa7PoEjEqCMQJaraanxOd8c/fk8dACLylRy5NqXD//OMj6y9vGDZHd8BuQxOm/a02BIsW R+tMuSbewV1Q== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 23 Jan 2024 01:43:54 -0800 Date: Tue, 23 Jan 2024 01:43:43 -0800 MIME-Version: 1.0 Message-Id: <20240123-zonefs_nofs-v1-2-cc0b0308ef25@wdc.com> References: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> In-Reply-To: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> To: Damien Le Moal , Naohiro Aota , Mike Snitzer , dm-devel@lists.linux.dev, Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706003027; l=991; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=aNukikOqhJIFNWqZ0ODBJWyAugGq+LPMMd8TTS5AKQ4=; b=ikAnavOye/kaxQOEWNUwKqvdUxWGtXZzJ7FWZYYfiyPrwIlpkg/V/fzRFKDthgXe8Ohpt6KhU /FHlNMKNb/eDriIYAew0yBQo7R6HpuBpWUzFGRY/CanTb/8FmZgdOJV X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Headers-End: 1rSDZI-0000SS-Kf Subject: [f2fs-dev] [PATCH 2/5] dm: dm-zoned: pass GFP_KERNEL to blkdev_zone_mgmt X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Johannes Thumshirn via Linux-f2fs-devel From: Johannes Thumshirn Reply-To: Johannes Thumshirn Cc: Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, "Matthew Wilcox \(Oracle\)" , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net The call to blkdev_zone_mgmt() in dm-zoned is only used to perform a ZONE_RESET operation when freeing a zone. This is not done in the IO path, so we can use GFP_KERNEL here, as it will never recurse back into the driver on reclaim. Signed-off-by: Johannes Thumshirn --- drivers/md/dm-zoned-metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index fdfe30f7b697..a39734f0cb7d 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -1658,7 +1658,7 @@ static int dmz_reset_zone(struct dmz_metadata *zmd, struct dm_zone *zone) ret = blkdev_zone_mgmt(dev->bdev, REQ_OP_ZONE_RESET, dmz_start_sect(zmd, zone), - zmd->zone_nr_sectors, GFP_NOIO); + zmd->zone_nr_sectors, GFP_KERNEL); if (ret) { dmz_dev_err(dev, "Reset zone %u failed %d", zone->id, ret); From patchwork Tue Jan 23 09:43:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13527110 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CD0BC47DDC for ; Tue, 23 Jan 2024 09:59:50 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rSDZM-0000AI-QZ; Tue, 23 Jan 2024 09:59:49 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rSDZJ-0000AB-LX for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2i0P4UtDfM2GvJlRWNENr44DBD4bzBaFXfbBxw+clIM=; b=Vw09GhZmsq1fd1Rd/eNE54Vno7 SlOX0y4nb7P0qO0RZxXJmsPYj7bNgLV9L6/HbS6Z0xKGSN4hoZoCFD6cw9w1cEY0klvitm7HEnvB9 J9xspCCY4YmYFZ4z9qR4rlX6jwiBJnRj494X14Cg3Z1XvzXRJF1l6kqS9n/8BHH+sE7I=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2i0P4UtDfM2GvJlRWNENr44DBD4bzBaFXfbBxw+clIM=; b=JHf0jSgc4P8/I8MY+SEWitXqFH TYpiGYVOURtkP6/kfBtaWxcof9Vc4XXnhwJhr6lsBoSu6Xbep1TBlsqKdOXP72r9fm0+tfSQsDD/s j0XxAEwBWacuTYPWug7iNjlHWlcUbT/ciAIrQmXcFBruSOEZPb2Yi4tv2Atf75IurbU0=; Received: from esa3.hgst.iphmx.com ([216.71.153.141]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rSDZJ-0000SS-8g for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003986; x=1737539986; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=MadywNv3PPpA8atuGcDj3Vd17mnoG/ezGAm6iZoKSro=; b=KU5yLQpeuHIYwFAIiDTELFVCyikrNDpKDvtn/qs+ojBIT+AZ7ZnYifzO V5L6fiDs7Hj6Fplfk8LNXjznn0VmotcsNMg7qzRMcewN31T5HNBjEukNi wWLgJLncMeuNrSUdhU1g1zGVLLIoLd+OuMJ1IyYyEA2UJ92OOzrkqMqAS GqZGQGL8bHgFvYrDVB5Vp3IPDxdDHhadZ17huPSp7sZ+j3xFuzMSAJZVP 9yJsJ6HyMfQyfzYaPr64f0EJTb6YtJw9Vc/ujlQMCeIX/yg2yqL89mtX7 vAMQQpICvfADf3c64iC8JSV0edbE5ehEzVFZxHm/RRhh8yXp31pgUs5Oq A==; X-CSE-ConnectionGUID: y00rko1RRRuoXptPGYqwYQ== X-CSE-MsgGUID: Q46SjgMsT7GvD0TWSWgkLw== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7462069" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:44:03 +0800 IronPort-SDR: QLj5/rXcItOLwaqhv7jBVrfTygx/BFb7Bzvv0qTL4G6EOdEk9MgutYYrTwQ28kg4W4gE8XHMSn Bg4QMp2vuIsQ== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:48:24 -0800 IronPort-SDR: 7xViEHS0YVoU8QIBSZlE2HNgQcFT3xfQ37Zri4MllgAiZa3c0o68mcJ0f96h/q8NdnY3wFm02f wGbJDLOULVdw== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 23 Jan 2024 01:43:58 -0800 Date: Tue, 23 Jan 2024 01:43:44 -0800 MIME-Version: 1.0 Message-Id: <20240123-zonefs_nofs-v1-3-cc0b0308ef25@wdc.com> References: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> In-Reply-To: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> To: Damien Le Moal , Naohiro Aota , Mike Snitzer , dm-devel@lists.linux.dev, Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706003027; l=3714; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=MadywNv3PPpA8atuGcDj3Vd17mnoG/ezGAm6iZoKSro=; b=jPU1qJgKMZ/i7HaHjlom8VTdj+Lx2qczH6TOXRim9mYZ5nEhblVM5XvcT7furce1UQ/gp5Wif ATsugvKlk0ZDra9L5KrCXBHheheUpRSNG72vZtsTjnurB7EKtxGltU1 X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Headers-End: 1rSDZJ-0000SS-8g Subject: [f2fs-dev] [PATCH 3/5] btrfs: zoned: call blkdev_zone_mgmt in nofs scope X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Johannes Thumshirn via Linux-f2fs-devel From: Johannes Thumshirn Reply-To: Johannes Thumshirn Cc: Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, "Matthew Wilcox \(Oracle\)" , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Add a memalloc_nofs scope around all calls to blkdev_zone_mgmt(). This allows us to further get rid of the GFP_NOFS argument for blkdev_zone_mgmt(). Signed-off-by: Johannes Thumshirn --- fs/btrfs/zoned.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 168af9d000d1..05640d61e435 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -824,11 +824,15 @@ static int sb_log_location(struct block_device *bdev, struct blk_zone *zones, reset = &zones[1]; if (reset && reset->cond != BLK_ZONE_COND_EMPTY) { + unsigned int nofs_flags; + ASSERT(sb_zone_is_full(reset)); + nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, reset->start, reset->len, - GFP_NOFS); + GFP_KERNEL); + memalloc_nofs_restore(nofs_flags); if (ret) return ret; @@ -974,11 +978,14 @@ int btrfs_advance_sb_log(struct btrfs_device *device, int mirror) * explicit ZONE_FINISH is not necessary. */ if (zone->wp != zone->start + zone->capacity) { + unsigned int nofs_flags; int ret; + nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_FINISH, zone->start, - zone->len, GFP_NOFS); + zone->len, GFP_KERNEL); + memalloc_nofs_restore(nofs_flags); if (ret) return ret; } @@ -996,11 +1003,13 @@ int btrfs_advance_sb_log(struct btrfs_device *device, int mirror) int btrfs_reset_sb_log_zones(struct block_device *bdev, int mirror) { + unsigned int nofs_flags; sector_t zone_sectors; sector_t nr_sectors; u8 zone_sectors_shift; u32 sb_zone; u32 nr_zones; + int ret; zone_sectors = bdev_zone_sectors(bdev); zone_sectors_shift = ilog2(zone_sectors); @@ -1011,9 +1020,13 @@ int btrfs_reset_sb_log_zones(struct block_device *bdev, int mirror) if (sb_zone + 1 >= nr_zones) return -ENOENT; - return blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, - zone_start_sector(sb_zone, bdev), - zone_sectors * BTRFS_NR_SB_LOG_ZONES, GFP_NOFS); + nofs_flags = memalloc_nofs_save(); + ret = blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, + zone_start_sector(sb_zone, bdev), + zone_sectors * BTRFS_NR_SB_LOG_ZONES, + GFP_KERNEL); + memalloc_nofs_restore(nofs_flags); + return ret; } /* @@ -1124,12 +1137,15 @@ static void btrfs_dev_clear_active_zone(struct btrfs_device *device, u64 pos) int btrfs_reset_device_zone(struct btrfs_device *device, u64 physical, u64 length, u64 *bytes) { + unsigned int nofs_flags; int ret; *bytes = 0; + nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_RESET, physical >> SECTOR_SHIFT, length >> SECTOR_SHIFT, - GFP_NOFS); + GFP_KERNEL); + memalloc_nofs_restore(nofs_flags); if (ret) return ret; @@ -2234,14 +2250,17 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ struct btrfs_device *device = map->stripes[i].dev; const u64 physical = map->stripes[i].physical; struct btrfs_zoned_device_info *zinfo = device->zone_info; + unsigned int nofs_flags; if (zinfo->max_active_zones == 0) continue; + nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_FINISH, physical >> SECTOR_SHIFT, zinfo->zone_size >> SECTOR_SHIFT, - GFP_NOFS); + GFP_KERNEL); + memalloc_nofs_restore(nofs_flags); if (ret) return ret; From patchwork Tue Jan 23 09:43:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13527109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E0F7C47E49 for ; Tue, 23 Jan 2024 09:59:48 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rSDZL-0001uk-S5; Tue, 23 Jan 2024 09:59:47 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rSDZL-0001ub-94 for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Fru1l8dAq84Xfh5gnq+lN/Z+UvKQa5FRHDYekqiQyQc=; b=jZbO3ZJi+L+BbkmfCSGhrmzq8p 4rLxB5KBq8jJ7EEMcJ/pbOJUL3dQG96FaOrStBgZGhnUgDZknoRq5nV9ZBnSJIhjIcYToIXGQSdH1 DU/qNS/6Uu+Ss+FG0yAOkINEGQHMv/2Nu10OMul/73NIjTeWLvcVvN8FFZfVVSytaX8Y=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Fru1l8dAq84Xfh5gnq+lN/Z+UvKQa5FRHDYekqiQyQc=; b=eS3hLO7RvG0AqIPcg9ozoKs34X XBElwSx7xzOgJaz8SZ/VWivYWsH1oSJ6latPd5xJJ4IskXmr5voSbFENVslnwrQXcYpv6WpGG2NrJ savIwVXIekiT6pQORYUxRsfu38yvr9B9s4WiUAfAq8QSQvhPfOr8Wr+p5LwLVoeslf58=; Received: from esa3.hgst.iphmx.com ([216.71.153.141]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rSDZJ-0000SS-VB for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003986; x=1737539986; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=jxy1iW5YBQpx2L/2XzM+MqzG0Ug1dnhtomAoOd2ZnbI=; b=BY7+oo5mfEOUl6ZyseshrIheCARVsQfA7c5/7J69yAZ4Bp/MDx+/0ly8 PWGN6K3OLr3oVN1zwwpX3ewD7rUxH3sFhl4LhtZec8efwEe/7g2YaNZ/3 hsPArYR7509vAJ0JQlLN24nUnLqIlaemREy8ZjEwFRGvnALOGtXcQ4ayg l88PWA2AK20WnRIiaQCVXna8Ac238fhpi1PZ/jLctgXnoDSWyqnEplXo9 jz84ugNtDqGIEfBczDhZhoiLZvxPkUzBfVlCkizT8NnmnkaI2LUumuCak DQXlDIVHNCglnOTgjzHgSHI04el2A/5igZthLNtUO7Mlb2g5lt12blGgj Q==; X-CSE-ConnectionGUID: M4rJNpEgSGOzr4U2FIHsjg== X-CSE-MsgGUID: qmBP81s3SIO6L0XnmBswsw== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7462074" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:44:06 +0800 IronPort-SDR: 96qnONrMHzXWefSZRYV/F8L1VdEW417iCHL1twEW1fuIPdYXZAQc7fxVFptp+MKCOuRCjTefgp tJr6bzP8+dXw== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:48:27 -0800 IronPort-SDR: IOh8OwQ887uF8FYicwPpeIj8pGPKsumfi+cLbrdodtKz/molf3mfeRtZvITdJ29oAO3ta0WwLL KVxG7oRWNRUw== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 23 Jan 2024 01:44:02 -0800 Date: Tue, 23 Jan 2024 01:43:45 -0800 MIME-Version: 1.0 Message-Id: <20240123-zonefs_nofs-v1-4-cc0b0308ef25@wdc.com> References: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> In-Reply-To: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> To: Damien Le Moal , Naohiro Aota , Mike Snitzer , dm-devel@lists.linux.dev, Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706003027; l=1916; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=jxy1iW5YBQpx2L/2XzM+MqzG0Ug1dnhtomAoOd2ZnbI=; b=3ZNl4h+s8HSPaptSA3bTG7Cc54lypNN6lGHNAsGVtJDwGDQrTa34PvB3BXdfTQsyIQIenyPIa XCtHIB+z9g5Bw9M9so4He4f+ztWTV5lnoteYP3kS9WTufWUnEYW9XJS X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Headers-End: 1rSDZJ-0000SS-VB Subject: [f2fs-dev] [PATCH 4/5] f2fs: guard blkdev_zone_mgmt with nofs scope X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Johannes Thumshirn via Linux-f2fs-devel From: Johannes Thumshirn Reply-To: Johannes Thumshirn Cc: Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, "Matthew Wilcox \(Oracle\)" , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Guard the calls to blkdev_zone_mgmt() with a memalloc_nofs scope. This helps us getting rid of the GFP_NOFS argument to blkdev_zone_mgmt(); Signed-off-by: Johannes Thumshirn --- fs/f2fs/segment.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 4c8836ded90f..0094fe491364 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1971,9 +1971,15 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi, } if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING))) { + unsigned int nofs_flags; + int ret; + trace_f2fs_issue_reset_zone(bdev, blkstart); - return blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, - sector, nr_sects, GFP_NOFS); + nofs_flags = memalloc_nofs_save(); + ret = blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, + sector, nr_sects, GFP_KERNEL); + memalloc_nofs_restore(nofs_flags); + return ret; } __queue_zone_reset_cmd(sbi, bdev, blkstart, lblkstart, blklen); @@ -4865,6 +4871,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi, block_t zone_block, valid_block_cnt; unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT; int ret; + unsigned int nofs_flags; if (zone->type != BLK_ZONE_TYPE_SEQWRITE_REQ) return 0; @@ -4912,8 +4919,10 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi, "pointer: valid block[0x%x,0x%x] cond[0x%x]", zone_segno, valid_block_cnt, zone->cond); + nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(fdev->bdev, REQ_OP_ZONE_FINISH, - zone->start, zone->len, GFP_NOFS); + zone->start, zone->len, GFP_KERNEL); + memalloc_nofs_restore(nofs_flags); if (ret == -EOPNOTSUPP) { ret = blkdev_issue_zeroout(fdev->bdev, zone->wp, zone->len - (zone->wp - zone->start), From patchwork Tue Jan 23 09:43:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13527111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 918DCC47258 for ; Tue, 23 Jan 2024 09:59:50 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rSDZN-0004u2-Jo; Tue, 23 Jan 2024 09:59:50 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rSDZL-0004tf-Ne for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CLhezGN2ooOqwf1rRyp++iPoYB+U7gUCrqzkKgaViR0=; b=Tryob1ufHGOhz3mgwYubrJF+mA t0oHm1QSsCcCltILJ/S4MNThBP0ut+VZrkvb8HJNuYSef/QOXSisle0Ekn8r0z1FASsShW3EUyHQV cFJyhUAndbwIU6VFopPYkwqqrRE/q8vqwBCH8oDZP+IS1ND7SG+nMjKminM2XebO7ORo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CLhezGN2ooOqwf1rRyp++iPoYB+U7gUCrqzkKgaViR0=; b=QJL7/0r6SMkVzB9qvk6sweS+Ny 1+tlbjPg+nvrb/i1csHzS5e8Pl5tm3q2kl3K4onerkpl3LSQ3YTtW+DyTGOxYUii2G2CaIKepXJNV A9/6qjQgySTABB4G5rhoTdG5JdfwWZUyltT1TxD6Q4eJ3ga9WOvJutjQ/ZuZto8yJoVE=; Received: from esa3.hgst.iphmx.com ([216.71.153.141]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rSDZK-0000SS-JY for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Jan 2024 09:59:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003987; x=1737539987; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=aOQGuVXVKnWXSkXzQjMJhwwtHyTg4oH1lbCa+QOjXsc=; b=bHoVHsGkl3AKqhfBYCwe/DfquOxlURIBe/VmGf38WNlxEUGqgX0a0khQ +ADd4KXUVlb8auhs8xyhZvsHBQ/HURJCZfWXsh819vYF2yDJgksSW8Zai BhyVzHACKS42VwkgpCQMBBw5dtNwuS/6WYKH8MRMe35VFPKOzkG3Qc5VY cNcneCBO0rz3BjwhyUiYIg4bzn1FkcsoRtxn673UGZi9SYonEougQslxN hfRA5yKPdjI65xpqCXCDDenNRTRVeWF0EmBn0HpBzNkXdTmxKT+aAAP+H rUXTs4H2mhzcSOgdlUDDSb2RqQpS6OrQozQr/36iXCfyWR6GfyIwteSne g==; X-CSE-ConnectionGUID: fWy9EOT/TPSEtv5afisayA== X-CSE-MsgGUID: +/nVlHrVQyC4bsyZPdDbbQ== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7462080" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:44:10 +0800 IronPort-SDR: lEUE/Y80xclhx3Oc7BgaI5FlT2qTILflrl5AIrU/LcBIQdiBgZ9c4iTuT8CZDZjTZQ3b4jHoAo CmefdC3UoKkQ== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:48:31 -0800 IronPort-SDR: GxErUU2Z3wBmibU/ymnLULMg2kdoT+BykBlVME6B2sftvvOCc86RtlFFRM9mrvTOS3KUyNKwrD MTBjZoriu3MQ== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 23 Jan 2024 01:44:05 -0800 Date: Tue, 23 Jan 2024 01:43:46 -0800 MIME-Version: 1.0 Message-Id: <20240123-zonefs_nofs-v1-5-cc0b0308ef25@wdc.com> References: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> In-Reply-To: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> To: Damien Le Moal , Naohiro Aota , Mike Snitzer , dm-devel@lists.linux.dev, Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706003027; l=8572; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=aOQGuVXVKnWXSkXzQjMJhwwtHyTg4oH1lbCa+QOjXsc=; b=Zv2P0hHGSf6rJYLtrJRV0J0ObyD9jw1/Pl477Ae1/4W0hj0Dd9O4uq+U9sZMuC1nW19PKQA6/ dtHVkawovRjBi5jCyk9GZWc4UUplEmYHtxWWtobNtQI0xLL0B7+rV3B X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Headers-End: 1rSDZK-0000SS-JY Subject: [f2fs-dev] [PATCH 5/5] block: remove gfp_flags from blkdev_zone_mgmt X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Johannes Thumshirn via Linux-f2fs-devel From: Johannes Thumshirn Reply-To: Johannes Thumshirn Cc: Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, "Matthew Wilcox \(Oracle\)" , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Now that all callers pass in GFP_KERNEL to blkdev_zone_mgmt() and use memalloc_no{io,fs}_{save,restore}() to define the allocation scope, we can drop the gfp_mask parameter from blkdev_zone_mgmt() as well as blkdev_zone_reset_all() and blkdev_zone_reset_all_emulated(). Signed-off-by: Johannes Thumshirn --- block/blk-zoned.c | 19 ++++++++----------- drivers/nvme/target/zns.c | 5 ++--- fs/btrfs/zoned.c | 14 +++++--------- fs/f2fs/segment.c | 4 ++-- fs/zonefs/super.c | 2 +- include/linux/blkdev.h | 2 +- 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index d343e5756a9c..d4f4f8325eff 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -177,8 +177,7 @@ static int blk_zone_need_reset_cb(struct blk_zone *zone, unsigned int idx, } } -static int blkdev_zone_reset_all_emulated(struct block_device *bdev, - gfp_t gfp_mask) +static int blkdev_zone_reset_all_emulated(struct block_device *bdev) { struct gendisk *disk = bdev->bd_disk; sector_t capacity = bdev_nr_sectors(bdev); @@ -205,7 +204,7 @@ static int blkdev_zone_reset_all_emulated(struct block_device *bdev, } bio = blk_next_bio(bio, bdev, 0, REQ_OP_ZONE_RESET | REQ_SYNC, - gfp_mask); + GFP_KERNEL); bio->bi_iter.bi_sector = sector; sector += zone_sectors; @@ -223,7 +222,7 @@ static int blkdev_zone_reset_all_emulated(struct block_device *bdev, return ret; } -static int blkdev_zone_reset_all(struct block_device *bdev, gfp_t gfp_mask) +static int blkdev_zone_reset_all(struct block_device *bdev) { struct bio bio; @@ -238,7 +237,6 @@ static int blkdev_zone_reset_all(struct block_device *bdev, gfp_t gfp_mask) * @sector: Start sector of the first zone to operate on * @nr_sectors: Number of sectors, should be at least the length of one zone and * must be zone size aligned. - * @gfp_mask: Memory allocation flags (for bio_alloc) * * Description: * Perform the specified operation on the range of zones specified by @@ -248,7 +246,7 @@ static int blkdev_zone_reset_all(struct block_device *bdev, gfp_t gfp_mask) * or finish request. */ int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op, - sector_t sector, sector_t nr_sectors, gfp_t gfp_mask) + sector_t sector, sector_t nr_sectors) { struct request_queue *q = bdev_get_queue(bdev); sector_t zone_sectors = bdev_zone_sectors(bdev); @@ -285,12 +283,12 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op, */ if (op == REQ_OP_ZONE_RESET && sector == 0 && nr_sectors == capacity) { if (!blk_queue_zone_resetall(q)) - return blkdev_zone_reset_all_emulated(bdev, gfp_mask); - return blkdev_zone_reset_all(bdev, gfp_mask); + return blkdev_zone_reset_all_emulated(bdev); + return blkdev_zone_reset_all(bdev); } while (sector < end_sector) { - bio = blk_next_bio(bio, bdev, 0, op | REQ_SYNC, gfp_mask); + bio = blk_next_bio(bio, bdev, 0, op | REQ_SYNC, GFP_KERNEL); bio->bi_iter.bi_sector = sector; sector += zone_sectors; @@ -419,8 +417,7 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, blk_mode_t mode, return -ENOTTY; } - ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors, - GFP_KERNEL); + ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors); fail: if (cmd == BLKRESETZONE) diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c index 5b5c1e481722..3148d9f1bde6 100644 --- a/drivers/nvme/target/zns.c +++ b/drivers/nvme/target/zns.c @@ -456,8 +456,7 @@ static u16 nvmet_bdev_execute_zmgmt_send_all(struct nvmet_req *req) switch (zsa_req_op(req->cmd->zms.zsa)) { case REQ_OP_ZONE_RESET: ret = blkdev_zone_mgmt(req->ns->bdev, REQ_OP_ZONE_RESET, 0, - get_capacity(req->ns->bdev->bd_disk), - GFP_KERNEL); + get_capacity(req->ns->bdev->bd_disk)); if (ret < 0) return blkdev_zone_mgmt_errno_to_nvme_status(ret); break; @@ -508,7 +507,7 @@ static void nvmet_bdev_zmgmt_send_work(struct work_struct *w) goto out; } - ret = blkdev_zone_mgmt(bdev, op, sect, zone_sectors, GFP_KERNEL); + ret = blkdev_zone_mgmt(bdev, op, sect, zone_sectors); if (ret < 0) status = blkdev_zone_mgmt_errno_to_nvme_status(ret); diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 05640d61e435..cf2e779d8ef4 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -830,8 +830,7 @@ static int sb_log_location(struct block_device *bdev, struct blk_zone *zones, nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, - reset->start, reset->len, - GFP_KERNEL); + reset->start, reset->len); memalloc_nofs_restore(nofs_flags); if (ret) return ret; @@ -984,7 +983,7 @@ int btrfs_advance_sb_log(struct btrfs_device *device, int mirror) nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_FINISH, zone->start, - zone->len, GFP_KERNEL); + zone->len); memalloc_nofs_restore(nofs_flags); if (ret) return ret; @@ -1023,8 +1022,7 @@ int btrfs_reset_sb_log_zones(struct block_device *bdev, int mirror) nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, zone_start_sector(sb_zone, bdev), - zone_sectors * BTRFS_NR_SB_LOG_ZONES, - GFP_KERNEL); + zone_sectors * BTRFS_NR_SB_LOG_ZONES); memalloc_nofs_restore(nofs_flags); return ret; } @@ -1143,8 +1141,7 @@ int btrfs_reset_device_zone(struct btrfs_device *device, u64 physical, *bytes = 0; nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_RESET, - physical >> SECTOR_SHIFT, length >> SECTOR_SHIFT, - GFP_KERNEL); + physical >> SECTOR_SHIFT, length >> SECTOR_SHIFT); memalloc_nofs_restore(nofs_flags); if (ret) return ret; @@ -2258,8 +2255,7 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_FINISH, physical >> SECTOR_SHIFT, - zinfo->zone_size >> SECTOR_SHIFT, - GFP_KERNEL); + zinfo->zone_size >> SECTOR_SHIFT); memalloc_nofs_restore(nofs_flags); if (ret) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 0094fe491364..e1065ba70207 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1977,7 +1977,7 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi, trace_f2fs_issue_reset_zone(bdev, blkstart); nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(bdev, REQ_OP_ZONE_RESET, - sector, nr_sects, GFP_KERNEL); + sector, nr_sects); memalloc_nofs_restore(nofs_flags); return ret; } @@ -4921,7 +4921,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi, nofs_flags = memalloc_nofs_save(); ret = blkdev_zone_mgmt(fdev->bdev, REQ_OP_ZONE_FINISH, - zone->start, zone->len, GFP_KERNEL); + zone->start, zone->len); memalloc_nofs_restore(nofs_flags); if (ret == -EOPNOTSUPP) { ret = blkdev_issue_zeroout(fdev->bdev, zone->wp, diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 63fbac018c04..cadb1364f951 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -113,7 +113,7 @@ static int zonefs_zone_mgmt(struct super_block *sb, trace_zonefs_zone_mgmt(sb, z, op); ret = blkdev_zone_mgmt(sb->s_bdev, op, z->z_sector, - z->z_size >> SECTOR_SHIFT, GFP_KERNEL); + z->z_size >> SECTOR_SHIFT); if (ret) { zonefs_err(sb, "Zone management operation %s at %llu failed %d\n", diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 99e4f5e72213..8467c1910404 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -325,7 +325,7 @@ void disk_set_zoned(struct gendisk *disk); int blkdev_report_zones(struct block_device *bdev, sector_t sector, unsigned int nr_zones, report_zones_cb cb, void *data); int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op, - sector_t sectors, sector_t nr_sectors, gfp_t gfp_mask); + sector_t sectors, sector_t nr_sectors); int blk_revalidate_disk_zones(struct gendisk *disk, void (*update_driver_data)(struct gendisk *disk));