Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8D0C21CC58 for ; Wed, 10 Jun 2026 06:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781072474; cv=none; b=YL2icxF3lCYZ06NxWCs3s9xVBY8eVn3sOnKWeB2HsH2gifu1JhdYsJyOWu5+WkmLkI5RNjyuPGa/tdESZlb9gxoHENF/CR88ksGbboLk5twv0jKiL29YG/NumH5sZBDVLxPTCAQrJImanlqBW+IJX6sChscg3vLH3NkPd2XJ3Zk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781072474; c=relaxed/simple; bh=b15syD9XJVTyKHxDm4QFDt0FJsK3/KebWv6z20t7bNE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cJpRwdYiYcWF0bR41h05pXLIPpjBzW5YxYnHBhmxLdsxzHHGAPNxdiRHOG3qQul3CPTKDdsC2wfxYGtq8zKjcd6pZFEBHiCstg5VA9oUqdi6upBFI2tppg7l1F8gT7T+UXZHZHjv4jB/ypgQjGWSqI1CzUAf5B3Pb7KgGnrTCyE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=waHJe4W/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=U6EAtjYv; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=waHJe4W/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=U6EAtjYv; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="waHJe4W/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="U6EAtjYv"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="waHJe4W/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="U6EAtjYv" 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 CA2156AB65; Wed, 10 Jun 2026 06:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781072470; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WbCQ0d3zTQZ6CGG+6Az/23i9L/arq92TNEcy3sEelj0=; b=waHJe4W/QB/axCJtQRgAST3/L1ZffdvaSfCdsCopUjv8covGVV5Mu6HHQ5ZlTpiH9EpD9Q zRFQa5HcZmyHm4tz927PKTsOEuhqSbWWv79hnw/iiQtLMoT8Yx5PxmoLIYnQrbZ7E69uds o9AhwRFbIjTMQJ64sGTeky5eMDj3n/c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781072470; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WbCQ0d3zTQZ6CGG+6Az/23i9L/arq92TNEcy3sEelj0=; b=U6EAtjYvBU2LDrzfCGj83Db9o2/YQoljDhw02wO4Suo5f/iMj8UC41aU4G/FsxU6Rl43RT YPgghOAwmqZuiBCQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1781072470; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WbCQ0d3zTQZ6CGG+6Az/23i9L/arq92TNEcy3sEelj0=; b=waHJe4W/QB/axCJtQRgAST3/L1ZffdvaSfCdsCopUjv8covGVV5Mu6HHQ5ZlTpiH9EpD9Q zRFQa5HcZmyHm4tz927PKTsOEuhqSbWWv79hnw/iiQtLMoT8Yx5PxmoLIYnQrbZ7E69uds o9AhwRFbIjTMQJ64sGTeky5eMDj3n/c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1781072470; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WbCQ0d3zTQZ6CGG+6Az/23i9L/arq92TNEcy3sEelj0=; b=U6EAtjYvBU2LDrzfCGj83Db9o2/YQoljDhw02wO4Suo5f/iMj8UC41aU4G/FsxU6Rl43RT YPgghOAwmqZuiBCQ== 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 35718779A7; Wed, 10 Jun 2026 06:21:08 +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 cGvRC1QCKWqkfwAAD6G6ig (envelope-from ); Wed, 10 Jun 2026 06:21:08 +0000 Message-ID: Date: Wed, 10 Jun 2026 08:21:07 +0200 Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/4] scsi: use percpu counters for iostat counters in struct scsi_device To: Sumit Saxena , "Martin K . Petersen" , Jens Axboe Cc: "James E . J . Bottomley" , linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, Adam Radford , Khalid Aziz , Adaptec OEM Raid Solutions , Matthew Wilcox , Hannes Reinecke , "Juergen E . Fischer" , Russell King , linux-arm-kernel@lists.infradead.org, Finn Thain , Michael Schmitz , Anil Gurumurthy , Sudarsana Kalluru , Oliver Neukum , Ali Akcaagac , Jamie Lenehan , Ram Vegesna , target-devel@vger.kernel.org, Bradley Grove , Satish Kharat , Sesidhar Baddela , Karan Tilak Kumar , Yihang Li , Don Brace , storagedev@microchip.com, HighPoint Linux Team , Tyrel Datwyler , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, Brian King , Lee Duncan , Chris Leech , Mike Christie , open-iscsi@googlegroups.com, Justin Tee , Paul Ely , Kashyap Desai , Shivasharan S , Chandrakanth Patil , megaraidlinux.pdl@broadcom.com, Sathya Prakash Veerichetty , Sreekanth Reddy , mpi3mr-linuxdrv.pdl@broadcom.com, Suganath Prabu Subramani , Ranjan Kumar , MPT-FusionLinux.pdl@broadcom.com, Daniel Palmer , GOTO Masanori , YOKOTA Hiroshi , Jack Wang , Geoff Levand , Michael Reed , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, Narsimhulu Musini , "K . Y . Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , linux-hyperv@vger.kernel.org, "Michael S . Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Eugenio Perez , virtualization@lists.linux.dev, Vishal Bhakta , bcm-kernel-feedback-list@broadcom.com, Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org, John Garry References: <20260609121806.2121755-1-sumit.saxena@broadcom.com> <20260609121806.2121755-5-sumit.saxena@broadcom.com> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20260609121806.2121755-5-sumit.saxena@broadcom.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_MATCH_FROM(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[web.de]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_GT_50(0.00)[82]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[HansenPartnership.com,vger.kernel.org,gmail.com,gonehiking.org,microsemi.com,infradead.org,suse.com,norbit.de,armlinux.org.uk,lists.infradead.org,linux-m68k.org,qlogic.com,neukum.org,web.de,twibble.org,broadcom.com,attotech.com,cisco.com,h-partners.com,microchip.com,highpoint-tech.com,linux.ibm.com,ellerman.id.au,kernel.org,lists.ozlabs.org,us.ibm.com,redhat.com,oracle.com,googlegroups.com,thingy.jp,debian.or.jp,netlab.is.tsukuba.ac.jp,cloud.ionos.com,sgi.com,marvell.com,microsoft.com,lists.linux.dev,epam.com,lists.xenproject.org]; R_RATELIMIT(0.00)[to_ip_from(RLe7mkytzjcetcarxr9hjfjrzi)]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[broadcom.com:email,imap1.dmz-prg2.suse.org:helo,suse.de:email,suse.de:mid] X-Spam-Level: X-Spam-Score: -4.30 On 6/9/26 14:18, Sumit Saxena wrote: > iorequest_cnt and iodone_cnt are updated on every command dispatch and > completion, often from different CPUs on high queue depth workloads. > Using adjacent atomic_t fields causes cache line contention between the > submission and completion paths. > > Extend the same treatment to ioerr_cnt and iotmo_cnt so all four iostat > counters in struct scsi_device use struct percpu_counter. > > Suggested-by: John Garry > Signed-off-by: Sumit Saxena > --- > drivers/scsi/scsi_error.c | 4 ++-- > drivers/scsi/scsi_lib.c | 10 +++++----- > drivers/scsi/scsi_scan.c | 8 ++++++++ > drivers/scsi/scsi_sysfs.c | 23 ++++++++++++++--------- > drivers/scsi/sd.c | 2 +- > include/scsi/scsi_device.h | 9 +++++---- > 6 files changed, 35 insertions(+), 21 deletions(-) > Good idea. 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