From nobody Mon Nov 23 22:28:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1794414088; cv=none; d=zohomail.com; s=zohoarc; b=IIfQ+GlatUO9KA0ooSOYn4xrjF2/or6pPZTSl1LhF8meOvVdM1xLJMSALOfH9lHZKi/wRyXhVToa/AnQKe3bWnT/SswEq0agTzEUQOog9VYEZNTMhYbL8FQ+MlKBXvgRo9+wWlfbnYG7kEw7jDgBXYN/AB/sz7B4O6IkO917UDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794414088; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FxBAbV0izYrRrCVmV/Lhrk7G0zfUxlgRLfpCEF5MJuI=; b=BzcoKXhfhmdRwf+F0GuAmesu1mpE4OIxzXbn5q5fsx2bz9xr+iE+1B/KN5k0vwLre4EJmjUcyAfKXd9FqkVSooAE0NxSi1jg/At+dNpVJEM3IYH670znOCYt6Ig9igDhjOJTy2D/4QDzjWLcXquGJdu1LyMDTgzOyMs3McRUOa0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1794414088680647.7769174194985; Wed, 11 Nov 2026 08:21:28 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1484373.1687712 (Exim 4.92) (envelope-from ) id 1xRB4P-0006Um-2N; Wed, 11 Nov 2026 16:21:09 +0000 Received: by outflank-mailman (output) from mailman id 1484373.1687712; Wed, 11 Nov 2026 16:21:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xRB4O-0006Ud-W2; Wed, 11 Nov 2026 16:21:08 +0000 Received: by outflank-mailman (input) for mailman id 1484373; Wed, 11 Nov 2026 16:21:07 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xRB4N-0006UC-JN for xen-devel@lists.xenproject.org; Wed, 11 Nov 2026 16:21:07 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xRB4M-000R5p-Vk for xen-devel@lists.xenproject.org; Wed, 11 Nov 2026 17:21:06 +0100 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6af495e3-bab6-0a2a0a5309dd-0a2a4508c8d6-42 for ; Wed, 11 Nov 2026 17:21:06 +0100 Received: from [195.135.223.130] (helo=smtp-out1.suse.de) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6af495f2-f659-0a2a45080019-c387df82e28c-3 for ; Wed, 11 Nov 2026 17:21:06 +0100 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-out1.suse.de (Postfix) with ESMTPS id 66E5F21E20; Wed, 11 Nov 2026 16:21:06 +0000 (UTC) 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 108C3134E5; Wed, 11 Nov 2026 16:21:06 +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 jphANPGV9GoGAwAAD6G6ig (envelope-from ); Wed, 11 Nov 2026 16:21:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1794414066; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FxBAbV0izYrRrCVmV/Lhrk7G0zfUxlgRLfpCEF5MJuI=; b=M7quML3H12c0bAAZGKdWgSNbhHrMX2cQ/KIUENvcQab+UQKzNMfDyWewk5hUbNAzZhN6qB 7VltbfEk/wurt5lRzDCS27Py5BPsW62Gf7iFeGICy1N4FZboyjoet7qp3k+Kx+6LrFtpHn 0UF+MrmkeJ7mmzCp3I5zFh08uoy47NE= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=M7quML3H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1794414066; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FxBAbV0izYrRrCVmV/Lhrk7G0zfUxlgRLfpCEF5MJuI=; b=M7quML3H12c0bAAZGKdWgSNbhHrMX2cQ/KIUENvcQab+UQKzNMfDyWewk5hUbNAzZhN6qB 7VltbfEk/wurt5lRzDCS27Py5BPsW62Gf7iFeGICy1N4FZboyjoet7qp3k+Kx+6LrFtpHn 0UF+MrmkeJ7mmzCp3I5zFh08uoy47NE= From: Juergen Gross To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Cc: Juergen Gross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jens Axboe , xen-devel@lists.xenproject.org Subject: [PATCH 1/3] xen-blkback: Remove statistics logging on console Date: Wed, 11 Nov 2026 17:20:56 +0100 Message-ID: <20261111162058.804033-2-jgross@suse.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261111162058.804033-1-jgross@suse.com> References: <20261111162058.804033-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 66E5F21E20 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Flag: NO X-Spamd-Result: default: False [-12.01 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.com:+] X-Spam-Score: -12.01 X-purgate-ID: tlsNG-c1860d/1794414066-DFAD487B-092975DE/35/110847 X-purgate-type: clean X-purgate-size: 3163 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1794414090051158500 Content-Type: text/plain; charset="utf-8" The xen-blkback can print I/O statistics data to the console every 10 seconds. This functionality has been present since the introduction of xen-blkback, but retrieving the data is possible via sysfs, too. So remove the console logging, as there is no need to have the same functionality twice. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- drivers/block/xen-blkback/blkback.c | 25 ------------------------- drivers/block/xen-blkback/common.h | 1 - drivers/block/xen-blkback/xenbus.c | 1 - 3 files changed, 27 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkbac= k/blkback.c index 88526e349ce1..f3a8f3eae86b 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -126,10 +126,6 @@ MODULE_PARM_DESC(max_ring_page_order, "Maximum order o= f pages to be used for the */ #define LRU_PERCENT_CLEAN 5 =20 -/* Run-time switchable: /sys/module/blkback/parameters/ */ -static unsigned int log_stats; -module_param(log_stats, int, 0644); - #define BLKBACK_INVALID_HANDLE (~0) =20 static inline bool persistent_gnt_timeout(struct persistent_gnt *persisten= t_gnt) @@ -536,21 +532,6 @@ irqreturn_t xen_blkif_be_int(int irq, void *dev_id) * SCHEDULER FUNCTIONS */ =20 -static void print_stats(struct xen_blkif_ring *ring) -{ - pr_info("(%s): oo %3llu | rd %4llu | wr %4llu | f %4llu" - " | ds %4llu | pg: %4u/%4d\n", - current->comm, ring->st_oo_req, - ring->st_rd_req, ring->st_wr_req, - ring->st_f_req, ring->st_ds_req, - ring->persistent_gnt_c, max_pgrants); - ring->st_print =3D jiffies + secs_to_jiffies(10); - ring->st_rd_req =3D 0; - ring->st_wr_req =3D 0; - ring->st_oo_req =3D 0; - ring->st_ds_req =3D 0; -} - int xen_blkif_schedule(void *arg) { struct xen_blkif_ring *ring =3D arg; @@ -614,17 +595,11 @@ int xen_blkif_schedule(void *arg) else gnttab_page_cache_shrink(&ring->free_pages, max_buffer_pages); - - if (log_stats && time_after(jiffies, ring->st_print)) - print_stats(ring); } =20 /* Drain pending purge work */ flush_work(&ring->persistent_purge_work); =20 - if (log_stats) - print_stats(ring); - ring->xenblkd =3D NULL; =20 return 0; diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback= /common.h index f5890b3f1df9..0a60e29a7cc3 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -277,7 +277,6 @@ struct xen_blkif_ring { unsigned long next_lru; =20 /* Statistics. */ - unsigned long st_print; unsigned long long st_rd_req; unsigned long long st_wr_req; unsigned long long st_oo_req; diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback= /xenbus.c index 8d0ff8fcac22..62e3bad4ab0e 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -158,7 +158,6 @@ static int xen_blkif_alloc_rings(struct xen_blkif *blki= f, init_waitqueue_head(&ring->pending_free_wq); init_waitqueue_head(&ring->shutdown_wq); ring->blkif =3D blkif; - ring->st_print =3D jiffies; ring->active =3D true; } =20 --=20 2.56.0 From nobody Mon Nov 23 22:28:37 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794414074; b=wuTxglNm6mtc8T5c7iLKMQzS8eCCysW4HeoorDzMcl5PzS6yMTfHRR0TxVNzDKFdaVd9 m10T4PiV0UUEarVI8znhKvpbtQmlFoW12oC7XPw3SJbPcGMDp2ugRESdp9poZC4k7JOpl IejWUyws5Cmc0kdISPbUgc+wrMcUj2V1k3JykZ9LhKTdcYbsxB8wgCX+j8n6BOo4eqQwc 1Fseog1IpzsmjATI/YvCjsx6FG9FtJjjusiSKrr1yxXtRS1LkVZYUqmYzntzZoUYnr/BY P9SSP6dBZaJz9iGpnYxxtTTznj9E+HvnT8yU3AAPYZthScs/u+00IvjNzMKnjrwc11g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794414074; h=DMARC-Filter:Received:DKIM-Signature:DKIM-Signature:Received: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:X-Spam-Flag: X-Spam-Level:X-Spamd-Result:X-Spam-Score; bh=saitawIKx4KwcKVQs3zXZcaCqHPuFnuj001Oa7m/5Wo=; b=H1+pi9kPH+SFOfxQ3ubaNKxQwzg4Xnc5HY1BrFWhffuxxBkrUoA8NDUaDEekbydnMJWN uuGQF/NWXAVBKomMq41Ot+LRrnapJDpm7tX+8zUiOTQiZyhbuJ2ITudZmTO7HiLdF2Ki5 c2+GfDP4VQ3cmZk+YRS1e+5eH9ecmqg28CdERtXhXiZJKwz48TdkWNXpMzAbgxDWRcgJ5 A39PU97Yguh3SEXtPQamqQZ/SmnENcHKi5wJFgDwWCyJ9o43N6Ivj37ux02sYjGhZELP2 2JgxLgtsyVSbBWzNYsbxfQTSD1O5pd+JvHAv5kugyN0EgYf9UFlOqOWJfOj1iSmJA+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=l3qeiwj3; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=WvTBTjvR; arc=none smtp.remote-ip=195.135.223.131 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7E86606A32A; Wed, 11 Nov 2026 16:21:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D7E86606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=l3qeiwj3; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=WvTBTjvR Received: from imap1.dmz-prg2.suse.org (unknown [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 F0D371F80D; Wed, 11 Nov 2026 16:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1794414072; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=saitawIKx4KwcKVQs3zXZcaCqHPuFnuj001Oa7m/5Wo=; b=l3qeiwj3cDHv4ZxDgABEfcpkZBwISLXe+befvEqV/ZIaO8tfrykrnGaTeeC2tXXa7wWRRy msLQ/PpAGvoqBTwzNH3CPsSbIY9Qfm+O+JxkwPiHIKM3AHNI/6c2cRds3OPd14AMeigCAe hRh7jEzL5ylny6bggBfbPkYcrVkQQC8= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1794414071; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=saitawIKx4KwcKVQs3zXZcaCqHPuFnuj001Oa7m/5Wo=; b=WvTBTjvR6xrw1dqmvdaEcXbjWYmBCvPYvCw/+t99Xxpy0jpxAMa7GgLgmeDW2mLvCY+g+7 Ri4nmoJ9XGxU4fLm+W6yiKqXoiv9JBBtUa3NZswB78SnF87mAuenipGexPBYQUNVIijIpd GWiMTNrD585fB2gcb0IMiN+R8OV0Bds= 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 A668A134E5; Wed, 11 Nov 2026 16:21:11 +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 JF4yIfeV9GoXAwAAD6G6ig (envelope-from ); Wed, 11 Nov 2026 16:21:11 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Cc: Juergen Gross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jens Axboe , xen-devel@lists.xenproject.org Subject: [PATCH 2/3] xen-blkback: move statistics data into sub-structure Date: Wed, 11 Nov 2026 17:20:57 +0100 Message-ID: <20261111162058.804033-3-jgross@suse.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261111162058.804033-1-jgross@suse.com> References: <20261111162058.804033-1-jgross@suse.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Flag: NO X-Spam-Level: X-Spamd-Result: default: False [-11.80 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.996]; MIME_GOOD(-0.10)[text/plain]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -11.80 Content-Type: text/plain; charset="utf-8" Move the statistics data into a dedicated new struct xen_blkif_stat. This is done in preparation of not losing statistics in case of disconnect/reconnect cycles. No functional change intended. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- drivers/block/xen-blkback/blkback.c | 14 +++++++------- drivers/block/xen-blkback/common.h | 19 ++++++++++++------- drivers/block/xen-blkback/xenbus.c | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkbac= k/blkback.c index f3a8f3eae86b..e2f09bd4e84e 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -958,7 +958,7 @@ static int dispatch_discard_io(struct xen_blkif_ring *r= ing, preq.sector_number + preq.nr_sects, blkif->vbd.pdevice); goto fail_response; } - ring->st_ds_req++; + ring->st.ds_req++; =20 if (blkif->vbd.discard_secure && (req->u.discard.flag & BLKIF_DISCARD_SECURE)) @@ -1198,7 +1198,7 @@ __do_block_io_op(struct xen_blkif_ring *ring, unsigne= d int *eoi_flags) =20 pending_req =3D alloc_req(ring); if (NULL =3D=3D pending_req) { - ring->st_oo_req++; + ring->st.oo_req++; more_to_do =3D 1; break; } @@ -1297,11 +1297,11 @@ static int dispatch_rw_block_io(struct xen_blkif_ri= ng *ring, =20 switch (req_operation) { case BLKIF_OP_READ: - ring->st_rd_req++; + ring->st.rd_req++; operation =3D REQ_OP_READ; break; case BLKIF_OP_WRITE: - ring->st_wr_req++; + ring->st.wr_req++; operation =3D REQ_OP_WRITE; operation_flags =3D REQ_SYNC | REQ_IDLE; break; @@ -1309,7 +1309,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring= *ring, drain =3D true; fallthrough; case BLKIF_OP_FLUSH_DISKCACHE: - ring->st_f_req++; + ring->st.f_req++; operation =3D REQ_OP_WRITE; operation_flags =3D REQ_PREFLUSH; break; @@ -1445,9 +1445,9 @@ static int dispatch_rw_block_io(struct xen_blkif_ring= *ring, blk_finish_plug(&plug); =20 if (operation =3D=3D REQ_OP_READ) - ring->st_rd_sect +=3D preq.nr_sects; + ring->st.rd_sect +=3D preq.nr_sects; else if (operation =3D=3D REQ_OP_WRITE) - ring->st_wr_sect +=3D preq.nr_sects; + ring->st.wr_sect +=3D preq.nr_sects; =20 return 0; =20 diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback= /common.h index 0a60e29a7cc3..f8385c4b9d30 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -248,6 +248,17 @@ struct persistent_gnt { struct list_head remove_node; }; =20 +/* Statistic data. */ +struct xen_blkif_stat { + unsigned long long rd_req; + unsigned long long wr_req; + unsigned long long oo_req; + unsigned long long f_req; + unsigned long long ds_req; + unsigned long long rd_sect; + unsigned long long wr_sect; +}; + /* Per-ring information. */ struct xen_blkif_ring { /* Physical parameters of the comms window. */ @@ -277,13 +288,7 @@ struct xen_blkif_ring { unsigned long next_lru; =20 /* Statistics. */ - unsigned long long st_rd_req; - unsigned long long st_wr_req; - unsigned long long st_oo_req; - unsigned long long st_f_req; - unsigned long long st_ds_req; - unsigned long long st_rd_sect; - unsigned long long st_wr_sect; + struct xen_blkif_stat st; =20 /* Used by the kworker that offload work from the persistent purge. */ struct list_head persistent_purge_list; diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback= /xenbus.c index 62e3bad4ab0e..b3ef483a92fd 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -408,7 +408,7 @@ void xen_blkif_interface_fini(void) for (i =3D 0; i < blkif->nr_rings; i++) { \ struct xen_blkif_ring *ring =3D &blkif->rings[i]; \ \ - result +=3D ring->st_##name; \ + result +=3D ring->st.name; \ } \ \ out: \ --=20 2.56.0 From nobody Mon Nov 23 22:28:37 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794414080; b=GweBq5QTt1ElM+8Oj7atqHE3Ab2klDPzgcoO6hJWTYNRByB2qPMI0LhYlgJ7bI8K/1Ra CunHt8ear6SFWe9I39C5q7WwsPUDnSNerqV0dyyyhrztpXtewtxXKjITqgO6wJ1fhnfyK X6vIsoisuzZFTI0nQ87qI7BBAN6wK1/XPnFDRP4lBJvVdneAgJvpPF6wkh/vnUg9bRNLZ CV67gDiCnZp65Li0tjDL9i3+khytKGtNDO262ibU0DkheTOLImzHTpO9kppWGqDOHHZIl ncGOEJEltWaZSerIHKJ7ePFC1qUhP2HxlRIFCocYEz7DApqSBkuLqAzxinM2HuXthjw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794414080; h=DMARC-Filter:Received:DKIM-Signature:DKIM-Signature:Received: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:X-Spamd-Result: X-Spam-Score:X-Spam-Level:X-Spam-Flag; bh=bSSv9eG1iTWrGFTeMHmS2DVPwf3MYF59DxWDnGZ5sCE=; b=G2VmcCuPA27hZ3j/G/jrIsiNXIEUulvPANyqwRA5ElzI20lGe0tk2+i2t0SWuan02SW3 9mFpujjBeJuSMGjga8DPdiFTpVOZWleD7tUwwyYfwohRTZ6IUjSI3Sn0ZUGZXzJlOYiQe ddzmqbd8GWXqYK6cnHGg47GgL22GfmkjO2BG8VPVyTtjrhr51zhS/9+r4YutWahD0Ra1B i+/EukHdvGKHv3/w6BbiAUSfsUN+CVR+iQv+mCcMaY4CBRfM7QHGnFRsoPXFcyimjtNc2 /z9AsAHEjsRa1ciyNqkFcEYRHfE8p57ljt/SU/5c5vnzMGgZC3klzs6rBVYpIWD8oog== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=tg5PpfpL; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=tg5PpfpL; arc=none smtp.remote-ip=195.135.223.130 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41265606A32E; Wed, 11 Nov 2026 16:21:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 41265606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=tg5PpfpL; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=tg5PpfpL Received: from imap1.dmz-prg2.suse.org (unknown [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-out1.suse.de (Postfix) with ESMTPS id AEAB621D93; Wed, 11 Nov 2026 16:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1794414077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bSSv9eG1iTWrGFTeMHmS2DVPwf3MYF59DxWDnGZ5sCE=; b=tg5PpfpLp/dgUzWIDV/iSAU0nguXlNp6hSiYcOS2zsUh9F8aeKmpYS2xNtgMMZj5NrJXWp j5jbkXYSPf9jx4mCvwI5gphXASoF8HgrHDrsJBSvHBRiYAqDvvTjcNlsvHVa8yvkEJw0nA esAZUn8gyTcAM46y8pDLpWjWGT4iS5k= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1794414077; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bSSv9eG1iTWrGFTeMHmS2DVPwf3MYF59DxWDnGZ5sCE=; b=tg5PpfpLp/dgUzWIDV/iSAU0nguXlNp6hSiYcOS2zsUh9F8aeKmpYS2xNtgMMZj5NrJXWp j5jbkXYSPf9jx4mCvwI5gphXASoF8HgrHDrsJBSvHBRiYAqDvvTjcNlsvHVa8yvkEJw0nA esAZUn8gyTcAM46y8pDLpWjWGT4iS5k= 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 5767C134E5; Wed, 11 Nov 2026 16:21:17 +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 AuQhCv2V9GocAwAAD6G6ig (envelope-from ); Wed, 11 Nov 2026 16:21:17 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Cc: Juergen Gross , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jens Axboe , xen-devel@lists.xenproject.org Subject: [PATCH 3/3] xen-blkback: make statistics data persistent across disconnect/connect Date: Wed, 11 Nov 2026 17:20:58 +0100 Message-ID: <20261111162058.804033-4-jgross@suse.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261111162058.804033-1-jgross@suse.com> References: <20261111162058.804033-1-jgross@suse.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-11.80 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.995]; MIME_GOOD(-0.10)[text/plain]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,imap1.dmz-prg2.suse.org:helo]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -11.80 X-Spam-Level: X-Spam-Flag: NO Content-Type: text/plain; charset="utf-8" Today the statistics data is living in struct xen_blkif_ring only. This means that a disconnect/connect cycle will reset the data, as the rings are freed and re-allocated in this case. Add a struct xen_blkif_stat in struct xen_blkif and sum up the per-ring data there when freeing the rings, and add those values to the printed statistics data. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- drivers/block/xen-blkback/common.h | 2 ++ drivers/block/xen-blkback/xenbus.c | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback= /common.h index f8385c4b9d30..c35ec207b31d 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -327,6 +327,8 @@ struct xen_blkif { unsigned int nr_rings; =20 unsigned long buffer_squeeze_end; + + struct xen_blkif_stat st; }; =20 struct seg_buf { diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback= /xenbus.c index b3ef483a92fd..f0d4cec4432a 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -346,6 +346,18 @@ static int xen_blkif_disconnect(struct xen_blkif *blki= f) */ write_lock(&blkif->rings_lock); =20 + for (r =3D 0; r < blkif->nr_rings; r++) { + struct xen_blkif_ring *ring =3D &blkif->rings[r]; + + blkif->st.rd_req +=3D ring->st.rd_req; + blkif->st.wr_req +=3D ring->st.wr_req; + blkif->st.oo_req +=3D ring->st.oo_req; + blkif->st.f_req +=3D ring->st.f_req; + blkif->st.ds_req +=3D ring->st.ds_req; + blkif->st.rd_sect +=3D ring->st.rd_sect; + blkif->st.wr_sect +=3D ring->st.wr_sect; + } + rings =3D blkif->rings; blkif->rings =3D NULL; blkif->nr_rings =3D 0; @@ -399,13 +411,14 @@ void xen_blkif_interface_fini(void) struct backend_info *be =3D dev_get_drvdata(&dev->dev); \ struct xen_blkif *blkif =3D be->blkif; \ unsigned int i; \ - unsigned long long result =3D 0; \ + unsigned long long result; \ \ read_lock(&blkif->rings_lock); \ - if (!blkif->rings) \ + result =3D blkif->st.name; \ + if (!blkif->rings) \ goto out; \ \ - for (i =3D 0; i < blkif->nr_rings; i++) { \ + for (i =3D 0; i < blkif->nr_rings; i++) { \ struct xen_blkif_ring *ring =3D &blkif->rings[i]; \ \ result +=3D ring->st.name; \ --=20 2.56.0