From patchwork Mon Jan 29 07:52:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13535116 X-Patchwork-Delegate: snitzer@redhat.com Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 2FB0D52F8E for ; Mon, 29 Jan 2024 07:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706514759; cv=none; b=tfnGhIYjzU7ewOzyWG9M1IWYSaMAvtVIyAr6YpbBCg+mN7kDmTx1dr19QjF5ST63KGp7Xrj41b7I7rWPB9895VdcoVViYM0+FkNN2Fp9J44TYdcnuYhuG5yWTuPrObW80329NSJ9x7rTdEjIrPxhkPBWCV8QRKCK+dZwH3RvR9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706514759; c=relaxed/simple; bh=CVSDtwbfJeIFTP08Wyxu5GIZXiQgdv2rMRXO0YSre0A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y+HUKqjEfduzmLEMWqpeONpirjYpJ9ueETtlDBgSo1WKZ0iMntA7BDLb241ZujV150UMEXtTF/hFjZVTxnxL3FcIYZr2O0psgKOEvKhP3GHeq/XwERrsDX6zG4RhL4pL6/DK6HVKXJQPFrPU7qcReNFQ7+kYgX/tYb77QuNDhg0= 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=T6JCZqkI; arc=none smtp.client-ip=68.232.141.245 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="T6JCZqkI" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1706514757; x=1738050757; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=CVSDtwbfJeIFTP08Wyxu5GIZXiQgdv2rMRXO0YSre0A=; b=T6JCZqkIfVgLSv4otLQVdKrPTFv0hgdXXikxHioXluKEdsae3s3Ha+td THTNBj/senualqIwYnUMJs9H8jdyl6Z09waHsdCoub2LGiZI+ENcx6l/C WGmO/gpWtZv4mmPttp/mIXCeqDQ+IORDFHJUMrZMwhBWw8KUNqMf4PUl+ +jAoBgoHQei/KhQKK/bC9JZnKo/4JOh21/8IbrOXGZrhdDKWLBhxHvGJf OVWUDAesAfSFvInDnqNYJt5sz9dr5tQDEH9ba+lvQ4rokOvSAstp7HyJT nNlA+3KidFPtlHj4TDySpwLYDIPrPjSt1CQh64XP4pbds+OaM6GItiH8+ Q==; X-CSE-ConnectionGUID: GBhOJwaAQb+gB3cLdqHIJw== X-CSE-MsgGUID: sej8GNG3RhuvyOMsifhhXg== X-IronPort-AV: E=Sophos;i="6.05,226,1701100800"; d="scan'208";a="8194620" 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; 29 Jan 2024 15:52:34 +0800 IronPort-SDR: XSUjKwgdx41hI9QXji6F2Rco4JAr5yWveSX/Ml12StHwzAqcp59Mg5YGEQWJj8p3NachZQXpVr LTthGXhRYkyg== 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; 28 Jan 2024 22:56:49 -0800 IronPort-SDR: X23CH+3d3A3FF6NEzAAKeGeexyHJK2ijaqA78yg+E155A1PkvJ9a3HFhhD042eDEA3L5FpbOTj Kt5GBf8LBQfw== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Jan 2024 23:52:31 -0800 From: Johannes Thumshirn Date: Sun, 28 Jan 2024 23:52:17 -0800 Subject: [PATCH v3 2/5] dm: dm-zoned: guard blkdev_zone_mgmt with noio scope Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240128-zonefs_nofs-v3-2-ae3b7c8def61@wdc.com> References: <20240128-zonefs_nofs-v3-0-ae3b7c8def61@wdc.com> In-Reply-To: <20240128-zonefs_nofs-v3-0-ae3b7c8def61@wdc.com> To: Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , 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 X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706514743; l=1101; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=CVSDtwbfJeIFTP08Wyxu5GIZXiQgdv2rMRXO0YSre0A=; b=yRnVuaXdTnXKe1OQL8z+2PQD65t2opZ+cZ1QIFwSpziKiiFJonren+b9FfKdwqrq5iL08iJ5r oHOIOYDruwGAUlsSl5D+/sgv4o0Bwq7ylNk0fIqz52NebMmJzP0AEnu X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Guard the calls to blkdev_zone_mgmt() with a memalloc_noio scope. This helps us getting rid of the GFP_NOIO argument to blkdev_zone_mgmt(); Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Mike Snitzer --- drivers/md/dm-zoned-metadata.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index fdfe30f7b697..165996cc966c 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -1655,10 +1655,13 @@ static int dmz_reset_zone(struct dmz_metadata *zmd, struct dm_zone *zone) if (!dmz_is_empty(zone) || dmz_seq_write_err(zone)) { struct dmz_dev *dev = zone->dev; + unsigned int noio_flag; + noio_flag = memalloc_noio_save(); 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); + memalloc_noio_restore(noio_flag); if (ret) { dmz_dev_err(dev, "Reset zone %u failed %d", zone->id, ret);