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: 190806 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp222410dyi; Tue, 23 Jan 2024 01:45:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4MwxrUmbPEV/H1jJ/XRTLyWwxMvciB5z9yS+Zywsva3cokINTm7/cT+NE7MBHg6Knk9Id X-Received: by 2002:aa7:da53:0:b0:55a:9038:ce61 with SMTP id w19-20020aa7da53000000b0055a9038ce61mr659939eds.59.1706003128018; Tue, 23 Jan 2024 01:45:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706003128; cv=pass; d=google.com; s=arc-20160816; b=jFMFjL5sKq92WfWW7JVeHLlea/2AK8kUmIQsOZrmkoDxcrJvMjbYxVWMj8LOmegLs0 7UoNZIBLB9WWfM/xGfTOY33ClNIzIZaTMc9M7FAO8I+R3vZn4QjjZeED7wl6SluR7Ihi kNKPYXdjPrAeXWZQ+AbT6sHX+BHg37mKCM/r2kmAVxxLawZHDtywmRmHJBw4GY1AxfUD /1Sg9B1DqnDm3CMVUbRkQ3/j375c7bWFO6EXoRvbKKTWMcgrPv8E+mkfw8xYub0rM9Vb 9NS4hsSLDmYPbw1nely/OAkjBvxKJTb1sVMRBqRgp7Xu99rfIFWG7UM32GfKTW0JLWO2 FN5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:wdcironportexception:ironport-sdr:ironport-sdr :dkim-signature; bh=xwNR4/EZjtvmjPU5B92P0twDrTPGvgcwhXfRvMp8W3M=; fh=eAi0k/flagmBX9JQ48PVdzOcGziLUreSp20hhkaGOsw=; b=anmQljmUDT6252Os8N7GTYabjxVfY+0RbQ6U91gCZDa0Bwv/DnXV9B26gpnM+Qzr24 eMnHgurTPINR65sUQq+EnIvQsdVx0tpQnaWXkfqLSlgeaz5qySqMjiTSC+5LV9kqCayp TywrZNkTaf2UJnlU6qdACjbdiWtIFs0+K7IwH0dYmpmoqEapMIw5O3CiXNev2ztiDnsI /8YiqYCj3RxKBLxsv+mUUBcmlPOqn2CzHqSCsvQp1igl905ps3gZw68K0NCNKoNp31bb eShPidb6JSs/TsieGZ2NTB5zEP+fuvnUnBuFEGMGttqurP6imY9K4nHhvJcNqPnPv/H1 uxMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=WzxfBXoS; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35016-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35016-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t1-20020a056402240100b0055a8321f767si3825090eda.258.2024.01.23.01.45.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 01:45:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35016-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=WzxfBXoS; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35016-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35016-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A18E31F22F79 for ; Tue, 23 Jan 2024 09:45:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB5025D8E4; Tue, 23 Jan 2024 09:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="WzxfBXoS" Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C3DA5BAFA; Tue, 23 Jan 2024 09:44:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.143.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003044; cv=none; b=c4tJ+CkKgENaodgtw09qYKWOnaSamcQVGmuZHZ4fu3w6E7nh5LmOibJNtSNCpbfjIxBTb1Wp+V0KqE35tlDjEpiMrynKPV4sc257PsyazSpQbplChykubdi7NBL5dCdAh8tBWgolQgsYchmVKKMTWmWf+DRuDrbfmfIn6BofHKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003044; c=relaxed/simple; bh=USx+V+gR/5Lk+0GJr2lbq1FeCI2pXKMzpek+ct39bMM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y3d+ZSffVEdPq1YWX7Y7QJAVDZgL3GyLLSpq7kSefUuJIBfu3S/MVO/eY8TbukYSNbc1NOFfNbvMbVEYpmTM14Jf1qP10sye8YHbF35ZQ07NaGcMGC2uN8xM4rJPaVS+zQuFaPzwpR5rkFAGiuifODD2QhQdNEYBmaCWf/bIHQc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=WzxfBXoS; arc=none smtp.client-ip=68.232.143.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003042; x=1737539042; 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=WzxfBXoSysLCoYvWX9Wk00wDWTjKLQZ+eJlTxBnzw9bmmSvo2NNrikn9 l6rqo5mnfZ8d6VnJ+xH4zdChm1qCSbxkQHhdc0EDyDjrffbsSB3hLSOuk lXwDrZXD5kPrUs6dOgN4I6KprRSvsvBxF4JIqUsUONmhfGEzUHUTNO1bJ k4amxZ1SqjOY309xDtlFQtpOY2SMjcYO2PCZ2P+iFmQ20o0OjDrt+nj6W JtGOFUbpKo7vHDnAo2TUQD3Z852jnBlsumKJxW24PLh1COvrEaNv7Yos4 9R5qXx0CVTuo1qb/kuxQHUK+3++MaEOV5unPDjHvoR76yZ+cwJ5b7V+PL Q==; X-CSE-ConnectionGUID: OLgmSsDqRTC4a2U/r99VOA== X-CSE-MsgGUID: FvWCBe8QRtWec/o+td0l5A== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7514650" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:43:54 +0800 IronPort-SDR: SYyrr2sfevEd2YeeThp4yjSt6XDT1YqATLjmPIuNAYwwoqCCmbs5PoYMlJFbPFp70n3YsNU0YA Llkgv1jyt/Ww== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:53:57 -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 From: Johannes Thumshirn Date: Tue, 23 Jan 2024 01:43:42 -0800 Subject: [PATCH 1/5] zonefs: pass GFP_KERNEL to blkdev_zone_mgmt() call Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Johannes Thumshirn , "Matthew Wilcox (Oracle)" 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788873936115001776 X-GMAIL-MSGID: 1788873936115001776 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: 190819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp224349dyi; Tue, 23 Jan 2024 01:51:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnHA1LP1NCw6hPvAoir3WXyHWzF3grr5Tno8MerCla5G2mEjKYXKNaem1n5yFl5S0aEuAp X-Received: by 2002:a05:6a20:1e54:b0:19a:4144:4392 with SMTP id cy20-20020a056a201e5400b0019a41444392mr2482976pzb.33.1706003478394; Tue, 23 Jan 2024 01:51:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706003478; cv=pass; d=google.com; s=arc-20160816; b=kFH1W/10jV3NXevSKDySOyBIzvYECicy0Z4n4AOrxyxiek4KUodRAR1NvYJ+TNvyVi 4AvjDGfSa42XBgIDt9u9agIyHLUjtwWtmhYUo1BDSTXgnufYCXZlPgqE+yOUa6vadpKp o0f1b7waj5iaJ9pj2iQIV0zyu8GPkKBp4g4Yw3W4EL8lZzYzjvk0a/xiHVt+/xFJ3XfP WFWGP52UKMb33nGdYliCEa7oDZnqsSay5NgTapPYguOAplhyV26ClrrqemVAWLd1LqN0 D8AA7rUoeFaFVrpDConNrnIWkvDFkGuUpusOhjxqtj0Oy3LMsHq+Szg8HGaXhoXawQyJ RhqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:wdcironportexception:ironport-sdr:ironport-sdr :dkim-signature; bh=7IyULlbq2i/AZhH32Afb7WsVyfQNBfYwO7GDrodkVh0=; fh=eAi0k/flagmBX9JQ48PVdzOcGziLUreSp20hhkaGOsw=; b=wpHTjnlcj7r3GoOhHwcFDY3UY4j1TwlmmSRjH4t9gfDcNVKAaJkhSex1apMKxnMwhi 6QmfieYPq3o73yrc9gP5IM8BgcB8KG/W0pwTO05M5OUt8NkGpLSctsGU1ouFJYoKuEAU nIZNmxULEvwzbAnAAGSk8S+8k9WGRsYK6fPIANVTZw0ylz24bRCzIcAEL+djLhcUKgoI Rj9Sm2T0hAlHqUMSBT39xE7Z0+n7rtjSQKXuKTyNNjo+uyWOwh4qmJloISbNNMlgdlW9 T8TT7HVGRwnIAIwcDBTeI1cTuyM22+nBf61d/NVskZQx7zxleckmxFejWG//Ovog+CVV 7myw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=AhPqJ9ds; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35017-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35017-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l7-20020a17090a850700b002904a9cfc34si7622331pjn.165.2024.01.23.01.51.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 01:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35017-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=AhPqJ9ds; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35017-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35017-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 68DA9B23160 for ; Tue, 23 Jan 2024 09:45:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7676B5D8FC; Tue, 23 Jan 2024 09:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="AhPqJ9ds" Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 249DD5C5FB; Tue, 23 Jan 2024 09:44:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.143.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003044; cv=none; b=buqQ07x7ssABAQCFttrUoocP9ocwXCDmybmk5GgNsjq+kIoeHiptu/hSML7cXrm8iT3qdoBOM77kwxssSku8q/ZaFaXzEid7yySgr9J9RbDKSXNLBoWVnRHEGnghABW9TRNN44gnuCavyDFvFkvKWLF2PY5kpFSQyJ8nzxFl4Vs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003044; c=relaxed/simple; bh=aNukikOqhJIFNWqZ0ODBJWyAugGq+LPMMd8TTS5AKQ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QDlQyw+FLP0TDmt/VQ6WdrIIzf03CxMTYLfTo8ZS9eeH7AwqwwQXuEwnVgc+jmfF8dsHZdS7BWVp8HuyikN/v1sbNhKNT/VOdgJ4YwAYZ6UYQfH8J+/kHYfpFdDQwE2Jq5YP3VmSCXIYf603PaH1QJOSG6KDVNzj11ZbIQpD80Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=AhPqJ9ds; arc=none smtp.client-ip=68.232.143.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003043; x=1737539043; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=aNukikOqhJIFNWqZ0ODBJWyAugGq+LPMMd8TTS5AKQ4=; b=AhPqJ9ds8m6BG21acx/H75tbnuvqT/Qa3uMBK2+kYOfu7FlQkPzybcEF yJnUmhMOMiUtGDpF4TSqwU1uhHWspcl3kmLIYUTjMzVkLWSkUFxBR5Row SgJT6BvPsHVLFlDB7T94Uf5x0eXG/J8GOxe3kZ09nUqnE9dcvUMEoVCjn CPLZpdmVN+kBQ/t7nrb1+zstvC2c9k8v3WJbJf9DTMLyvTC7Y22BMDLDc NFBhC/+tx5+RYYg9NnsjoiYyS7k/FAYSBTKI9VtOBzApVl2HvAkdf8LDQ R2KPthGebB/BdD1gKlUWsz3B2MhWnFt6cOLVfTt8fEpzf65XwuHW/9ach w==; X-CSE-ConnectionGUID: KNF/eWqqTuSD/fIF0lBFKQ== X-CSE-MsgGUID: YtLdZ5llSzyzHq2I2uCvRw== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7514656" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:43:58 +0800 IronPort-SDR: Spj8xNqUKqypWYLaeNqVXaVV/wkQ/edLp1GOZveakoHp/xfFFhUh7GzHGrzHlIqRzOfR+tiBth eeFO3gA2+v/A== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:54:01 -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 From: Johannes Thumshirn Date: Tue, 23 Jan 2024 01:43:43 -0800 Subject: [PATCH 2/5] dm: dm-zoned: pass GFP_KERNEL to blkdev_zone_mgmt Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Johannes Thumshirn , "Matthew Wilcox (Oracle)" 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788874303211012583 X-GMAIL-MSGID: 1788874303211012583 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: 190807 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp222551dyi; Tue, 23 Jan 2024 01:45:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2Tsst1Zmz0mDFwE2DsnSmuD9Sot0wWdkKEyw9g8zMH/NEMBYGKCxy+fm65j5iC84OUNrH X-Received: by 2002:a05:620a:25c6:b0:783:85bb:4702 with SMTP id y6-20020a05620a25c600b0078385bb4702mr7590693qko.85.1706003155062; Tue, 23 Jan 2024 01:45:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706003155; cv=pass; d=google.com; s=arc-20160816; b=XnZ1Z4yZO4FMdrXgGudkbbdAF1gxNF/XG9ZQ/iGvpEWbwll9/HytOMEyFFSw/k5W08 iQYHL2hgrQokJL2uwj1GD5iC17yK8Aa7Ij1Y1gUsm2aMcQxrCw7rIEejJG/VAafrXlR+ C6uBKghE6JEV958DPLg5Kc4hYzUlW+EV6d4dQLjGtZy3+/UMovwno5PmhvYMb6OIq6cY XEI4Uq9Bre4QAE2bjSUPiqrWpgdvVkhQWEQ5N3sN0GnAvlxjeIRaZtdaJWlWdtPQdQgp QCKfQALXUGWhOZgjjmozXFDxT55mTrGvVkRiVUu41+PxUrK6xzcWN+0U0cYl3p0WTwH+ 9VYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:wdcironportexception:ironport-sdr:ironport-sdr :dkim-signature; bh=2i0P4UtDfM2GvJlRWNENr44DBD4bzBaFXfbBxw+clIM=; fh=eAi0k/flagmBX9JQ48PVdzOcGziLUreSp20hhkaGOsw=; b=wVb82qr6upx/0rrYeNq/GprEQu9hezgzbH08upl0+vwqK9j542OIlQGvKviq7yVJEz geX035xwl0UZpJitl1b4rKC7JKzQrgbwNQkQyENuXZRFl/FIkDbx+dHq5+55wDcV5KGw GVMdnATu/tOb2Nkl9SfLNOlRh/gRAkzr8PYEazHs9HalYWCIB7NSEEfFj8Q/hb4hv9lf 3DVxEmOo52SjMmwppLXgDvkzirSU423is/v5+zu9HzAz6j1MrsKA5yG6T7KQoxiChzy6 ozIcqkiFFLpM05sjRKobRDZA7/hEE80oo01BC0vrBgLTw+k1RuQiC5eMsfO0201gb1vd VOOQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=kNZ0ZDik; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35018-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35018-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bj3-20020a05620a190300b0078347fb1f27si7979226qkb.149.2024.01.23.01.45.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 01:45:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35018-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=kNZ0ZDik; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35018-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35018-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C802D1C20E3B for ; Tue, 23 Jan 2024 09:45:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B904F5DF04; Tue, 23 Jan 2024 09:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="kNZ0ZDik" Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3065C5C60C; Tue, 23 Jan 2024 09:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.143.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003045; cv=none; b=o2qzjE28k+V1w1CbgfTu7v3csmGJ23AS4jJCmlp6tciLAZpLLIFqaec8nTexuFrJasP3f40MBmHUFXRWdjtEju4ZpQpRvwK+GL8H3QD9+hkcC9pleJGm9EfKq6fw30qKQpNLqMLPVqiFbVnWh2gWkeQwGHLKkqbjkk6FIq85QeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003045; c=relaxed/simple; bh=MadywNv3PPpA8atuGcDj3Vd17mnoG/ezGAm6iZoKSro=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ukQEt9vacRp6sSVQYLeZVO5yYUvbhAEngbPip/Eqq5/xVLRk7/NNEatV90INg3p98X2mGsujZyvuyrhG4XsQe6gWcl6hR9z65c1QtYymy0BUxT6mKvyUW1p/prZwvozfDiCSMtkDi7QFgapu9n1BS9fFZBbBx4GNZfkBeCjMdSw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=kNZ0ZDik; arc=none smtp.client-ip=68.232.143.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003044; x=1737539044; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=MadywNv3PPpA8atuGcDj3Vd17mnoG/ezGAm6iZoKSro=; b=kNZ0ZDikt43HqUzEIc2BqXYd4Is/Mdn3tuANdr1sz4Uz1B4vlJ9IQ3Yk L9h8oHEkusbdwX6T2n9X7hma/GAwcAa49JsTeqjyxTO646hpTpOSknU1n 4TZoc0+BZwJmFE+gXtie+B/Ndza1vgxSvgRpiVK9p5R3LaW7g9/ufFZrQ spxIF26JpLcs3PvS0apEoaHpNfliwUftZveTxSwNAO86dIxl5Ozb9BSNW EjsGiJ/TZBcfTSNYDjnt89SXo+O5L5KjZNWpAA9nSlmF3uq5On5BggWiG gIzWa7wEKu6PnvSXxqZX0WPhUiuDRQJmDoU6k9Sdq9L+vggoQjIN8VAwq A==; X-CSE-ConnectionGUID: Y0DbYVcHRG+U+LyayKzudw== X-CSE-MsgGUID: yfg25ablSRSBPudDxtvc0Q== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7514663" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:44:02 +0800 IronPort-SDR: M/PstV4BTWaUFLg4/dvAdmu4Upifxdfk2XIvxcNz2hRh6aqCOh+ZEsD7RsiZOeqwxRyeIIr1aJ Qp1C13nthedQ== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:54:04 -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 From: Johannes Thumshirn Date: Tue, 23 Jan 2024 01:43:44 -0800 Subject: [PATCH 3/5] btrfs: zoned: call blkdev_zone_mgmt in nofs scope Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Johannes Thumshirn , "Matthew Wilcox (Oracle)" 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788873964418384952 X-GMAIL-MSGID: 1788873964418384952 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: 190808 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp222639dyi; Tue, 23 Jan 2024 01:46:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGi/1UQVBgoousBoz69QaOHczSeYQ2HA43wjGdzCTj9DbWp1nz2+yTxI6+kv9ANF9j6QyoC X-Received: by 2002:a92:d303:0:b0:35f:fcb2:d57b with SMTP id x3-20020a92d303000000b0035ffcb2d57bmr4004693ila.128.1706003171462; Tue, 23 Jan 2024 01:46:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706003171; cv=pass; d=google.com; s=arc-20160816; b=yRKbcd7j5Ldgi0888i1RlHscb0Se9oplQbpUuKrrm1ajBp8toebWgYuBDFXTjHWNXD sKWIXLunXuMm8TCn3bPeB3dT7HIobf2J5x2/w0civ1oeCXXHUrq2W7jbHhX6Ro9a23/w gEuQQETRYRp3Ksw7OiA+gk9HtB7uxUXVdwYeRAXrUwhUpnXdlVoTuOcBbk10zZPj5nJK lLQfzUjXBLZfLUehoD+NC3ChaNlVLRLN2sHtmCC9d7vS7rph4H2O+C97zCrFr1jOzS4P pMMHcvN/EIZ4+PzjJt1wDh0QJ0sjwQ8FaRbn4hLw0l2PseVQB10vbNBYu14m0Sh/WEar QZgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:wdcironportexception:ironport-sdr:ironport-sdr :dkim-signature; bh=Fru1l8dAq84Xfh5gnq+lN/Z+UvKQa5FRHDYekqiQyQc=; fh=eAi0k/flagmBX9JQ48PVdzOcGziLUreSp20hhkaGOsw=; b=XATWJ9bjAVSgK/r7zOLgEFDNmyujKAy7P1h07l8o9tTYroOz5qjtHkcPW9S62G29xv ztt37dAHPBKnKW4xfUU2G9Ow4rKMpkEsX+d+qDIOuiqT4urm74Lk4u1oHCL6cG00KRu3 XvP+rC9tWpFv9H5ija0tDDbT0CIbRMQdlq+14wj9zr1hpeUijBlym1Mjo5RbwPeAB9pa O+yiYGCSQ63zfQ/NwA4G5jdBC9TY0tSSx3gMk0GSblBcS1XLXVZ1Lr8gm2rKg33aUmHy RHB3/eKpBuPHuzXOPnxAapsi4JOQzG5Rn/agi/5Tl3sK5ecpVT/Szl46ys3ft/SWS4JN A0ig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=JLJGboem; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35019-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35019-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s123-20020a632c81000000b005cec620c36esi9561776pgs.460.2024.01.23.01.46.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 01:46:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35019-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=JLJGboem; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35019-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35019-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 34A77288FDB for ; Tue, 23 Jan 2024 09:46:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF3255EE62; Tue, 23 Jan 2024 09:44:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="JLJGboem" Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D93005D8EB; Tue, 23 Jan 2024 09:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.143.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003048; cv=none; b=jjXhc75YdNgr4qZxJoYwJF3jKWZIh9wZiYPED/0KuGMQ7D+SAQlvcncr+pCXyPl3XAasBWKyHp12V/2lTmgMiFYCY5Ah7Fjb9g88Lxlnlw8sLj37MBHqHMpHXMn97uADFGVr0/pxS0hJBulalo0X/6pmvEGGFqe+EXHlrG3R3nM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003048; c=relaxed/simple; bh=jxy1iW5YBQpx2L/2XzM+MqzG0Ug1dnhtomAoOd2ZnbI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JQyeOSAxwxKJdUxMTEbJguZSGrhxq+YuU6DddaISzpx+GdEewqP0Y6qLx33A0/WMcvPtYyVGiv0POK31v1ioqlEexU6Ls98oo0pL0HuSngZ0yRfefXytl4z5NL9xPnIPEw54AcKIKFIjWAOBtpqxCm/Eq/Vmx2F4bkER77yZADg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=JLJGboem; arc=none smtp.client-ip=68.232.143.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003046; x=1737539046; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=jxy1iW5YBQpx2L/2XzM+MqzG0Ug1dnhtomAoOd2ZnbI=; b=JLJGboembopjgrt1zs02eflyRAHG8H9nuF5Vr2P3fVdIy0Fg844RYwaJ 85jGeIVggcv7CVmCpHsFgvJO1Zx4dGssMIiJAqnIcSoCdchUhZutVzA2n B9BOPijtqJbu9VXmkiequ7axE5pUIjyWJ9r9nL3SXqMdNc+V2ywavBur1 zgWAWnSje8KfpAvQO22vfujz9VfmYwAM+uE5s6T6inUMXfoBo6hUqA6Fk fCi1cXGd/sXzhwB1tSgJNaViOk+sN10aIhZQPCXMMox8x2yvqUMXHHAWf rQ2ji/kxu2oOS765nxZMS8WuhoPUvMrtD+ismSf+fwghsow+nBD27eY7e g==; X-CSE-ConnectionGUID: 7qswTcyESwiRNvCm+t8XhA== X-CSE-MsgGUID: te0q95g/RwOIyGX+bKGM0g== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7514667" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:44:05 +0800 IronPort-SDR: sLqNwAQ7YHnZIBl3IEvWOUIg9isqJQ2qAvuDmuUzzQRTTwWsfqrnI+fY7L9+5QvL4Quc5mafaZ TLXEsiHENqog== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:54:08 -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 From: Johannes Thumshirn Date: Tue, 23 Jan 2024 01:43:45 -0800 Subject: [PATCH 4/5] f2fs: guard blkdev_zone_mgmt with nofs scope Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Johannes Thumshirn , "Matthew Wilcox (Oracle)" 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788873981476408224 X-GMAIL-MSGID: 1788873981476408224 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: 190809 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp222815dyi; Tue, 23 Jan 2024 01:46:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTWG3nHc8Jfwja+5sqr+5V1Mg8OEpCkkzPj24cYG090vsD5u/msI8EcjFMnf2DGGREhPsB X-Received: by 2002:a17:906:a414:b0:a30:e1e1:6844 with SMTP id l20-20020a170906a41400b00a30e1e16844mr71296ejz.14.1706003204366; Tue, 23 Jan 2024 01:46:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706003203; cv=pass; d=google.com; s=arc-20160816; b=l3vmP4BolJxBCPwedQWzbmpyh186H2vtISSxamdehej4aCzneP36s20i+J+8j5dtCd UdakoFU06hOj15vD6IudQ1b53a57XtxjbHNv3xpj3oPff0u+wkaSxgF/RjEOytocHDAl t8GLhcK48xMpPiROTMQp4D6yn5qB18jEfMb5976YA+3yilUSGP7vqE6fo3g5kd7gLOTF 4tKsozLaJJPCDixDSrBTu+3mm7JhJByR1+9TCq3Uy2nNj7mTxKSI3N+FCkyS7lt2ExiV 97kvdmaxCDiiqApTjrxhtf6k0FLhl2l6YFrOEjUc/ZKR6jMvH+dHSg926VHjr/ITGFAP ImDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:wdcironportexception:ironport-sdr:ironport-sdr :dkim-signature; bh=CLhezGN2ooOqwf1rRyp++iPoYB+U7gUCrqzkKgaViR0=; fh=eAi0k/flagmBX9JQ48PVdzOcGziLUreSp20hhkaGOsw=; b=KTe+IBfzcfLgP7qkpzxCp4oEOEvI/RqKAKMmPY8ZEOWdDTkO8MDwirr6MMAbysTzQu G7mUYHOkZvnu0byG4Jg0XSMtx19kqMwLzCy5M+h3+0vtJ5eyQQ8y+5hw5BCA4p2KEncj nuxLZfMiKUuWVahoztibXow/vrkhXIW5Futd3TxBMug4hdb12K1BegRroYcmKRmbflB5 dNwur2It7a1QL1Fi4F2hnt77utBXsZPbMOTbc6/BCy0QyHXF1CwUXT+YEEb28vIxnDbf Z6vvjStl8t+LGINvC+aMpqpLK53aDf4alFC2ViCtK/X0zovIBlxfFplZJilx+nhNewRO lHtg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=fZduKiyX; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35020-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35020-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k6-20020a170906128600b00a2a2b08accdsi11262118ejb.420.2024.01.23.01.46.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 01:46:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35020-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=fZduKiyX; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-35020-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35020-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C884B1F22495 for ; Tue, 23 Jan 2024 09:46:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 508925F545; Tue, 23 Jan 2024 09:44:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="fZduKiyX" Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E08D95DF31; Tue, 23 Jan 2024 09:44:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.143.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003051; cv=none; b=Ya6bQqi6QDh7TYKwCj63+p360IqJd/3g/sG5nrGUdEQ0mjX6F9EBSFZoDjg52v6PSWETSrj6jdyE+6Lnklvx/mkub+aey/n7QBdbyMPN30uhJ8vbm6a14Cw5ORSlrdtfda1SGlzpGsfZ0MuRz6emyviXmOBLb0WtNLlz+J8FCCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706003051; c=relaxed/simple; bh=aOQGuVXVKnWXSkXzQjMJhwwtHyTg4oH1lbCa+QOjXsc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cPGpa3xvPQq1gJ127X/BA5QqJNd7t6fxet8xVS09uERiE30oDz/fQMRteLtf7lyo/CT07/9VwUIRRXf20MjsulmYa5BLvsnHQ47cjTaDD6Lil8Jwa5aaTd9mc8PO0VBgTc6U+GXk04+CayZ9x+iSZPp9QxBNF4W9fr9MyEDEpwE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=fZduKiyX; arc=none smtp.client-ip=68.232.143.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706003049; x=1737539049; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=aOQGuVXVKnWXSkXzQjMJhwwtHyTg4oH1lbCa+QOjXsc=; b=fZduKiyXLa83wAXnenDiGunxbMGrBSUFOUjCcfTu8eR1VEZHAXgak8hy voOVoiZSOxWz0HMGQT9klrBTq25OR9Hu3hlN3QYw/7qgYvxuw7HDk+/1i 9AK71qsUP/NPLB/cEtGJ3TuK0BoSw58jhXsSYSCTA5Zx4x3BmuI9fqz1g X+NfS3h2+PIaru4/UQLZaTe1QA6yvkh9s/kZF/H7UXF2AY/RG2+Hs3BFR 7djXBCetxCYnrfQ3WXgEzd7gU6cotGBxG0q5LSDCB+DzDdp5zOLw5JY92 FPQuN+N9U61iVAEB9qeLo8HtEdDBLv8Kt4PGETaCriXIlTL2z87UE7TXE w==; X-CSE-ConnectionGUID: lONOpAhdRhqtZ75GFWVmCA== X-CSE-MsgGUID: EBWonMbyQ5OHzaVNYTHoeg== X-IronPort-AV: E=Sophos;i="6.05,214,1701100800"; d="scan'208";a="7514674" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2024 17:44:09 +0800 IronPort-SDR: qQzQ1TIyLbA96EGKteAh9ZW4eN1v9ZvN9J4i6Krj9ePaQMgOyEAm54Li43i3Cx8HhWNm8g+uQs 0qoIZEnBghPg== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jan 2024 00:54:12 -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 From: Johannes Thumshirn Date: Tue, 23 Jan 2024 01:43:46 -0800 Subject: [PATCH 5/5] block: remove gfp_flags from blkdev_zone_mgmt Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Johannes Thumshirn , "Matthew Wilcox (Oracle)" 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788874015362596845 X-GMAIL-MSGID: 1788874015362596845 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));