From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5968C606A326 for ; Sun, 8 Nov 2026 20:48:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=dFNkN7EC; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=CuTd5rkN 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: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=aLBSphUPpkQSmk/BQU8w4WnHJtgwOWRaiwq4m3R70Zc=; b=dFNkN7ECAxw8sZ nCBlXMYutCLwdclrr3Pux2t3cEYT1d8Oly85uPYNGt8eyS1bLAGCZMDCFDPOEvbYw7X671bTPevUx EScZWY7HRp3O1iZPueWDdPNtepH1GdS0Y7Kmki+yL6FhpFlEKkuIFp3enqoFnzVAUPM5HzgjwOwKA NUO934+YrdcQLEprtjxKEz5a7IMM70ANp5dIfOUkPth7OeZRv8nLJLz62MClCEGbAnCyToQK9wKUU hewEFdh2Iri1qZTYPAyA4uS7RzGFsUazS92ojRFn3gwC/R5DGfUBbiDaNEESxyJ4BxRhRGpx6w88t OIOOYhrTFo93TMF9JJVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xQ9oe-0000000Gd0y-2UQM; Sun, 08 Nov 2026 20:48:40 +0000 Received: from out-212.mta0.migadu.com ([2001:41d0:1004:224b::d4] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xQ9oS-0000000GcR0-01yM for linux-nvme@lists.infradead.org; Sun, 08 Nov 2026 20:48:38 +0000 X-Envelope-To: linux-nvme@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=yUyDco5Tbx6PoduIOfYi9iHiRgOj0lG9rUJG6HkMHEY=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1794170906; v=1; x=1794775706; b=CuTd5rkNsbW27Id7uZBFk7XgMqScOKbnoGAu7ZTJ1i8d3IwtTjQcEBSRZF/H5PRAafYOBKeM DpAataKvwRUoeSPFfJ2MmuQRaTtAPwKYJExNrI3K/BmZ2naPhy1q3jS/NLuNdGnNTC7RZ/684hF i7ZnqS3BmMmF3c2x+cv6ohYk= X-Envelope-To: linux-nvme@lists.infradead.org Received: by mta10.migadu.com with ESMTPS id 37ce54ce466a1928; Sun, 08 Nov 2026 20:48:25 +0000 X-Mizu-Trace-ID: 37ce54ce466a1928 X-Migadu-Flow: FLOW_OUT From: John Garry To: james.bottomley@hansenpartnership.com, mkp@kernel.org Cc: hare@suse.com, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, snitzer@kernel.org, jmeneghi@redhat.com, bmarzins@redhat.com, dm-devel@lists.linux.dev, hch@lst.de, michael.christie@oracle.com, John Garry Subject: [PATCH v9 28/29] scsi: sd: add mpath_numa_nodes dev attribute Date: Sun, 8 Nov 2026 20:47:32 +0000 Message-ID: <20261108204733.557995-29-john.garry@linux.dev> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261108204733.557995-1-john.garry@linux.dev> References: <20261108204733.557995-1-john.garry@linux.dev> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261108_124828_279433_BDCD2B14 X-CRM114-Status: UNSURE ( 8.15 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Add an attribute to show multipath NUMA node per-path (scsi_disk). The following is an example of reading the file: $ cat /sys/devices/platform/host8/session1/target8:0:0/8:0:0:0/block/sdc:0/numa_ mpath_numa_nodes 0-3 $ cat /sys/devices/platform/host9/session2/target9:0:0/9:0:0:0/block/sdc:1/numa_ mpath_numa_nodes $ Signed-off-by: John Garry --- drivers/scsi/sd.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8469feb9ba5f..5ea604c4bbb0 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -4165,8 +4165,22 @@ static ssize_t sd_mpath_dev_show(struct device *dev, } static DEVICE_ATTR(mpath_dev, 0444, sd_mpath_dev_show, NULL); +static ssize_t sd_mpath_numa_nodes_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct gendisk *gd = dev_to_disk(dev); + struct scsi_disk *sdkp = gd->private_data; + struct scsi_device *sdev = sdkp->device; + struct scsi_mpath_device *scsi_mpath_dev = sdev->scsi_mpath_dev; + struct mpath_device *mpath_device = &scsi_mpath_dev->mpath_device; + + return mpath_numa_nodes_show(mpath_device, buf); +} +static DEVICE_ATTR(mpath_numa_nodes, 0444, sd_mpath_numa_nodes_show, NULL); + static struct attribute *sd_mpath_dev_attrs[] = { &dev_attr_mpath_dev.attr, + &dev_attr_mpath_numa_nodes.attr, NULL }; -- 2.43.0