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 4062FCCFA04 for ; Wed, 5 Nov 2025 07:09:24 +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:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S8/T7RiFHI1VVVixCs0zWFLgYXmKOqjKf8eYz8wcHcA=; b=pkRjAAcLJG1kQhJSH11//xAqTi r5ch7ZiAHSc2fY5uhQ6EqR82YIfEy76zfl2r5a42s8SQSp/tlgY0F2SQCJkxrCSkJxblkpoMHnmnD mjEVGu3/KEsqIUHkkx9CGUq823USRr0AkH7Z+7kJS/8FF+FMReP3OJ3n2iBbHCGfPCPfpaWHuni02 lPJqEOZx06RocFD9xds10jJ3HEC9G9tJquKsSpCqPLYVVHKl1ZSDVKWlv91neEsQ7Ui86cOCWJqQ4 RyVEJ2AQW6OclGKH7kDMI6EO8KCpOUFeWIQ0TmgbdruLgcisVSdJfTcb9scmPJoctU6Jzfuz3ICuo NhQowNpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGXdy-0000000D94K-1tok; Wed, 05 Nov 2025 07:09:22 +0000 Received: from smtp-out2.suse.de ([195.135.223.131]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGXdv-0000000D93G-1HOP for linux-nvme@lists.infradead.org; Wed, 05 Nov 2025 07:09:21 +0000 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4EC841F394; Wed, 5 Nov 2025 07:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1762326557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S8/T7RiFHI1VVVixCs0zWFLgYXmKOqjKf8eYz8wcHcA=; b=o1pBQe1QHfu4BlBIKcLfDc2GNzLpLisP2TC4E7VaKNSezNfYvU8Nfs2iVbe6Bsbn6Wig4q Mva3bTOLOR975yn68r++GIHtmLg8zJrjMDeqhrWH2yu62c889PsnSNI6/UYUuZwjXNa8rQ 2AlCy0Js7OcQJ4iTEYSGL8iVoWJZf+s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1762326557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S8/T7RiFHI1VVVixCs0zWFLgYXmKOqjKf8eYz8wcHcA=; b=6SkfPJ++NBct6x/ay8R5aLj01Oh96d9Z5IzYVTo0wfjkx1RLW0qXR4BzGS68k+y0qwm0+M 32bczFVp6cmo35Dw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=o1pBQe1Q; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=6SkfPJ++ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1762326557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S8/T7RiFHI1VVVixCs0zWFLgYXmKOqjKf8eYz8wcHcA=; b=o1pBQe1QHfu4BlBIKcLfDc2GNzLpLisP2TC4E7VaKNSezNfYvU8Nfs2iVbe6Bsbn6Wig4q Mva3bTOLOR975yn68r++GIHtmLg8zJrjMDeqhrWH2yu62c889PsnSNI6/UYUuZwjXNa8rQ 2AlCy0Js7OcQJ4iTEYSGL8iVoWJZf+s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1762326557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S8/T7RiFHI1VVVixCs0zWFLgYXmKOqjKf8eYz8wcHcA=; b=6SkfPJ++NBct6x/ay8R5aLj01Oh96d9Z5IzYVTo0wfjkx1RLW0qXR4BzGS68k+y0qwm0+M 32bczFVp6cmo35Dw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 07799132DD; Wed, 5 Nov 2025 07:09:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id YqBEOxv4CmneEgAAD6G6ig (envelope-from ); Wed, 05 Nov 2025 07:09:15 +0000 Message-ID: Date: Wed, 5 Nov 2025 08:09:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 09/15] block: introduce blkdev_get_zone_info() To: Damien Le Moal , Jens Axboe , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Keith Busch , Christoph Hellwig , dm-devel@lists.linux.dev, Mike Snitzer , Mikulas Patocka , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-xfs@vger.kernel.org, Carlos Maiolino , linux-btrfs@vger.kernel.org, David Sterba References: <20251104013147.913802-1-dlemoal@kernel.org> <20251104013147.913802-10-dlemoal@kernel.org> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20251104013147.913802-10-dlemoal@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EC841F394 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[15]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[lst.de:email,wdc.com:email,suse.de:email,suse.de:mid,suse.de:dkim]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from] X-Rspamd-Action: no action X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251104_230919_495901_29C3EFBA X-CRM114-Status: GOOD ( 20.30 ) 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 11/4/25 02:31, Damien Le Moal wrote: > Introduce the function blkdev_get_zone_info() to obtain a single zone > information from cached zone data, that is, either from the zone write > plug for the target zone if it exists and from the disk zones_cond > array otherwise. > > Since sequential zones that do not have a zone write plug are either > full, empty or in a bad state (read-only or offline), the zone write > pointer can be inferred from the zone condition cached in the disk > zones_cond array. For sequential zones that have a zone write plug, the > zone condition and zone write pointer are obtained from the condition > and write pointer offset managed with the zone write plug. This allows > obtaining the information for a zone much more quickly than having to > execute a report zones command on the device. > > blkdev_get_zone_info() falls back to using a regular zone report if the > target zone is flagged as needing an update with the > BLK_ZONE_WPLUG_NEED_WP_UPDATE flag, or if the target device does not > use zone write plugs (i.e. a device mapper device). In this case, the > new function blkdev_report_zone_fallback() is used and the zone > condition is reported consistantly with the cahced report, that is, the > BLK_ZONE_COND_ACTIVE condition is used in place of the implicit open, > explicit open and closed conditions. This is achieved by adding the > .report_active field to struct blk_report_zones_args and by having > disk_report_zone() sets the correct zone condition if .report_active is > true. > > In preparation for using blkdev_get_zone_info() in upcoming file systems > changes, also export this function as a GPL symbol. > > Signed-off-by: Damien Le Moal > Reviewed-by: Christoph Hellwig > Reviewed-by: Johannes Thumshirn > --- > block/blk-zoned.c | 141 +++++++++++++++++++++++++++++++++++++++++ > include/linux/blkdev.h | 3 + > 2 files changed, 144 insertions(+) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich