Received: by 2002:a05:7412:b112:b0:f9:3106:f1c0 with SMTP id az18csp85700rdb; Sun, 17 Dec 2023 22:53:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVLwvY7jqrwisJqMChVVxOEBg5bu/6kCVrHTi3svRzfwGa+tfReJdwANktWV9+eHh7KOBB X-Received: by 2002:a05:6870:d250:b0:203:ceec:933c with SMTP id h16-20020a056870d25000b00203ceec933cmr695496oac.69.1702882411328; Sun, 17 Dec 2023 22:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702882411; cv=none; d=google.com; s=arc-20160816; b=o4oux1ydiiM1NmLgIszODa1osh3NvegAPXKLs3yu2+M75KF8W5VbfPQdN8c/CYWaE2 rvSEZqz1zN0js4QO4rfQ8Ynrv7vLfJFMazSNosaqY3Nm/7xdDskS8Lizu6wTB6mZePau 3iHC4AK8lGe1lI+Ju96EMhoJlS5j1FdQUeX1dQVSx9FVEFGW/Ws6g3jqKSufwOUzDxwx ppkEGYVmnHI4b/6qxMIJ8CC2yN2pb6bWg6MsWZiXQAyQoRh+ti/ez1GOci6Ui5t5O5g5 mCyAzz0iAbZGVV2geC7T/VPY8olcZoPWqykjUJGMjzLWzw/uSpPiDYrkAi/fDqo6Kiy7 bocQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=Egr0NLFekHxbvioypBIptqX4P98m9+GvwDJy/D/IsaI=; fh=Sn3CJNcpj8+a7paBalAR0Fwf0zMKqym/qE63M0TxkXo=; b=s3sy34Ja8t8PqtnI/0jsWb/nCmYomOtb8cpDtxcLkVZ4QkglqyPWqClL1lhcpwqF3k K2Nc8JIwOlBJLsHF+Qh8/Oq5cIkS+3Sx8CC2CD+ZKthLAGvthipe0FsUv+8cqu+eE639 Jhk8BfFLo+kng0wMfPf1p5H7jJmpTKNSpx/Gvgwhv2cwo9xB5aK9supSGI3pFcrDCFLq ft2hxTHIgWmY6CYTyZLUVEeWC040Ydphr2KQJThSqaiokoAAKjmVM7dU9mISB/JbZ9qk Aw4RtO+7BVcNkAfQ0W+HPtwBWfWhyo9EQjpdIxOxghfhmaCg7Cx6FSjEmxgO4gtD7Ngl YuTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=loBrPuyc; spf=pass (google.com: domain of linux-kernel+bounces-3065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3065-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bj17-20020a056a02019100b005c65ed0f688si17628158pgb.296.2023.12.17.22.53.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 22:53:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3065-linux.lists.archive=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=@kernel.org header.s=k20201202 header.b=loBrPuyc; spf=pass (google.com: domain of linux-kernel+bounces-3065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3065-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 31E54B218F3 for ; Mon, 18 Dec 2023 06:53:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B20079C0; Mon, 18 Dec 2023 06:53:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="loBrPuyc" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 534A97464; Mon, 18 Dec 2023 06:53:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ADCEC433C8; Mon, 18 Dec 2023 06:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702882389; bh=EpFEN3Jue2G6Rxerxg89hbnN15oJOVy46RhaWGQO2tw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=loBrPuycmVkyYVqG8sgfHh3oEDZfWG5B8CoIyakdwRnEweatH2xsCuIZr02Fy23+s NP6GBo2huii33qSC8iG8JeB8qFZasdKInhhYftE3Q8ChdHj8/tCwUsmKJl6c8YLKxy cVlJTOYI8GtA3yDDTwe6nVlimJa8Rz5X2BUKqoUuQwFaMSrfaStI0bPQlO9a2rflyi xT2Ps/TW6alm8uF+2a2DYLo5ROKLijEteSNVxVnWCGFPt3iup5B11HrcZF/360Z7Jf zAUZNPBt9TAyJg61SfSNPXKR06JSvPTEKJqzevSpQ10Jd357eLVI5OPHS0/Yf/Iojn MqyxR4tcyMymA== Message-ID: <190f58f7-2ed6-46f8-af59-5e167a0bddeb@kernel.org> Date: Mon, 18 Dec 2023 15:53:06 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/5] block: remove support for the host aware zone model Content-Language: en-US To: =?UTF-8?B?RWQgVHNhaSAo6JSh5a6X6LuSKQ==?= , "hch@lst.de" , "axboe@kernel.dk" Cc: "linux-kernel@vger.kernel.org" , "virtualization@lists.linux.dev" , "martin.petersen@oracle.com" , =?UTF-8?B?Q2FzcGVyIExpICjmnY7kuK3mpq4p?= , =?UTF-8?B?Q2h1bi1IdW5nIFd1ICjlt6vpp7/lro8p?= , "linux-scsi@vger.kernel.org" , "dm-devel@lists.linux.dev" , "linux-nvme@lists.infradead.org" , "pbonzini@redhat.com" , "linux-btrfs@vger.kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , "stefanha@redhat.com" References: <20231217165359.604246-1-hch@lst.de> <20231217165359.604246-4-hch@lst.de> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 2023/12/18 15:15, Ed Tsai (蔡宗軒) wrote: > Hi Christoph, > > some minor suggestions: > > On Sun, 2023-12-17 at 17:53 +0100, Christoph Hellwig wrote: >> >> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c >> index 198d38b53322c1..260b5b8f2b0d7e 100644 >> --- a/drivers/md/dm-table.c >> +++ b/drivers/md/dm-table.c >> @@ -1579,21 +1579,18 @@ bool dm_table_has_no_data_devices(struct >> dm_table *t) >> return true; >> } >> >> -static int device_not_zoned_model(struct dm_target *ti, struct >> dm_dev *dev, >> - sector_t start, sector_t len, void >> *data) >> +static int device_not_zoned(struct dm_target *ti, struct dm_dev >> *dev, >> + sector_t start, sector_t len, void *data) >> { >> - struct request_queue *q = bdev_get_queue(dev->bdev); >> - enum blk_zoned_model *zoned_model = data; >> + bool *zoned = data; >> >> - return blk_queue_zoned_model(q) != *zoned_model; >> + return bdev_is_zoned(dev->bdev) != *zoned; >> } >> >> static int device_is_zoned_model(struct dm_target *ti, struct dm_dev >> *dev, >> sector_t start, sector_t len, void >> *data) > > Seems like the word "model" should also be remove here. > >> { >> - struct request_queue *q = bdev_get_queue(dev->bdev); >> - >> - return blk_queue_zoned_model(q) != BLK_ZONED_NONE; >> + return bdev_is_zoned(dev->bdev); >> } >> >> /* >> @@ -1603,8 +1600,7 @@ static int device_is_zoned_model(struct >> dm_target *ti, struct dm_dev *dev, >> * has the DM_TARGET_MIXED_ZONED_MODEL feature set, the devices can >> have any >> * zoned model with all zoned devices having the same zone size. >> */ >> -static bool dm_table_supports_zoned_model(struct dm_table *t, >> - enum blk_zoned_model >> zoned_model) >> +static bool dm_table_supports_zoned(struct dm_table *t, bool zoned) >> { >> for (unsigned int i = 0; i < t->num_targets; i++) { >> struct dm_target *ti = dm_table_get_target(t, i); >> @@ -1623,11 +1619,11 @@ static bool >> dm_table_supports_zoned_model(struct dm_table *t, >> >> if (dm_target_supports_zoned_hm(ti->type)) { >> if (!ti->type->iterate_devices || >> - ti->type->iterate_devices(ti, >> device_not_zoned_model, >> - &zoned_model)) >> + ti->type->iterate_devices(ti, >> device_not_zoned, >> + &zoned)) >> return false; >> } else if (!dm_target_supports_mixed_zoned_model(ti- >>> type)) { >> - if (zoned_model == BLK_ZONED_HM) >> + if (zoned) >> return false; >> } >> } > > The parameter "bool zoned" is redundant. It should be removed from the > above 3 functions > > Additionally, because we no longer need to distinguish the zoned model > here, DM_TARGET_MIXED_ZONED_MODEL is meaningless. We can also clean up > its related code. Nope. The mixed thing is for mixing up non-zoned with zoned models. For the entire DM code, HM and HA are both treated as HM-like zoned. -- Damien Le Moal Western Digital Research