From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 73237C0219D for ; Fri, 7 Feb 2025 22:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5JQYDZ5jzno7rrMD91/odghBo6lSgHHkIDBVq0SzOmo=; b=3NpZonuty0xUyXRWourbrkXeWw JVLSfvAC83owvL2Lu70hexjy7BeeO9h29BRLL661d6uZ6Ya6P7glMQ7EYijxhgn0m/2+lOVYyDLEt sfTOmJ9FKa/+FCrgvjFhMNqLtORDT1plOOFXnPazaNDb+vyx8/D3WkFEIqZqifnqwGIavVDm1cDrM +s4hl1SDoP1/1Nyl1mfeU37Mu+mWXleltV9HhhVSQ865+MH8X6cdBvmjOYLdP6B3PNNfwRqrkyt/S juZC/K2Gh2k7axTOxowsS26rA1/2Th72HQ3lXOBRhPfo2V/lfRLQa7/kl0OpFB8sXmbuNu2kJ8X+c MCg8Py0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgWdr-0000000BMdE-1Iso; Fri, 07 Feb 2025 22:16:07 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgWdn-0000000BMco-2ifM for linux-nvme@lists.infradead.org; Fri, 07 Feb 2025 22:16:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738966561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5JQYDZ5jzno7rrMD91/odghBo6lSgHHkIDBVq0SzOmo=; b=B28nG35AK5Tzgv42O5E3fhoAUoU5IXs5pqgG3idw6dmIZkSi6kvjEvUKA+tI/mm1meivKO 2073VFBUhitwuEi+gJFp9EhVREj4ZDI+4HGLR8S+arhisHUVhNxXD5anRRKvG51cLvdrlG z/+G360H1BHDWPO5sV6hxy2LttvR4BM= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-QyO-n5Z1MT68fscLH0adPg-1; Fri, 07 Feb 2025 17:14:19 -0500 X-MC-Unique: QyO-n5Z1MT68fscLH0adPg-1 X-Mimecast-MFC-AGG-ID: QyO-n5Z1MT68fscLH0adPg Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 437711956095; Fri, 7 Feb 2025 22:14:16 +0000 (UTC) Received: from bmarzins-01.fast.eng.rdu2.dc.redhat.com (unknown [10.6.23.247]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 56BCE1800360; Fri, 7 Feb 2025 22:14:14 +0000 (UTC) Received: from bmarzins-01.fast.eng.rdu2.dc.redhat.com (localhost [127.0.0.1]) by bmarzins-01.fast.eng.rdu2.dc.redhat.com (8.18.1/8.17.1) with ESMTPS id 517MEDga725105 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 7 Feb 2025 17:14:13 -0500 Received: (from bmarzins@localhost) by bmarzins-01.fast.eng.rdu2.dc.redhat.com (8.18.1/8.18.1/Submit) id 517MECmM725090; Fri, 7 Feb 2025 17:14:12 -0500 Date: Fri, 7 Feb 2025 17:14:12 -0500 From: Benjamin Marzinski To: Zhang Yi Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-block@vger.kernel.org, dm-devel@lists.linux.dev, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hch@lst.de, tytso@mit.edu, djwong@kernel.org, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com, yangerkun@huawei.com Subject: Re: [RFC PATCH v2 4/8] dm: add BLK_FEAT_WRITE_ZEROES_UNMAP support Message-ID: References: <20250115114637.2705887-1-yi.zhang@huaweicloud.com> <20250115114637.2705887-5-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250115114637.2705887-5-yi.zhang@huaweicloud.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250207_141603_813739_94F3D12F X-CRM114-Status: GOOD ( 18.37 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Wed, Jan 15, 2025 at 07:46:33PM +0800, Zhang Yi wrote: > From: Zhang Yi > > Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by > default. This feature shall be disabled if any underlying device does > not support it. > > Signed-off-by: Zhang Yi > --- > drivers/md/dm-table.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c > index bd8b796ae683..58cce31bcc1e 100644 > --- a/drivers/md/dm-table.c > +++ b/drivers/md/dm-table.c > @@ -598,7 +598,8 @@ int dm_split_args(int *argc, char ***argvp, char *input) > static void dm_set_stacking_limits(struct queue_limits *limits) > { > blk_set_stacking_limits(limits); > - limits->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL; > + limits->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL | > + BLK_FEAT_WRITE_ZEROES_UNMAP; > } > dm_table_set_restrictions() can set limits->max_write_zeroes_sectors to 0, and it's called after dm_calculate_queue_limits(), which calls blk_stack_limits(). Just to avoid having the BLK_FEAT_WRITE_ZEROES_UNMAP still set while a device's max_write_zeroes_sectors is 0, it seems like you would want to clear it as well if dm_table_set_restrictions() sets limits->max_write_zeroes_sectors to 0. -Ben > /* > -- > 2.39.2 >