From: Bart Van Assche <bvanassche@acm.org>
To: Sumit Saxena <sumit.saxena@broadcom.com>,
martin.petersen@oracle.com, axboe@kernel.dk
Cc: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
mpi3mr-linuxdrv.pdl@broadcom.com
Subject: Re: [PATCH v2 3/3] scsi: use percpu counters for iorequest_cnt and iodone_cnt
Date: Mon, 20 Apr 2026 09:41:53 -0700 [thread overview]
Message-ID: <c6a6733e-a652-40a5-8ff3-bc69e3e80102@acm.org> (raw)
In-Reply-To: <20260420113846.1401374-4-sumit.saxena@broadcom.com>
On 4/20/26 4:38 AM, Sumit Saxena wrote:
> +#define show_sdev_iostat_percpu(field) \
> +static ssize_t \
> +show_iostat_##field(struct device *dev, struct device_attribute *attr, \
> + char *buf) \
> +{ \
> + struct scsi_device *sdev = to_scsi_device(dev); \
> + unsigned long long count = percpu_counter_sum(&sdev->field); \
Why "unsigned long long" instead of "u64"? u64 values can be formatted
with "%llx" since "u64" is a synonym for "unsigned long long".
> + return snprintf(buf, 20, "0x%llx\n", count); \
> +} \
> +static DEVICE_ATTR(field, 0444, show_iostat_##field, NULL)
Why "snprintf(buf, 20, ...)"? New code should use sysfs_emit(buf, ...),
isn't it?
Otherwise this patch looks good to me.
Thanks,
Bart.
prev parent reply other threads:[~2026-04-20 16:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 11:38 [PATCH v2 0/3] scsi/block: NUMA-local scan allocations, shared-tag path cleanup, and SCSI I/O counters Sumit Saxena
2026-04-20 11:38 ` [PATCH v2 1/3] scsi: scan: allocate sdev and starget on the NUMA node of the host adapter Sumit Saxena
2026-04-20 12:10 ` John Garry
2026-04-20 11:38 ` [PATCH v2 2/3] block: drop shared-tag fairness throttling Sumit Saxena
2026-04-20 11:38 ` [PATCH v2 3/3] scsi: use percpu counters for iorequest_cnt and iodone_cnt Sumit Saxena
2026-04-20 16:41 ` Bart Van Assche [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c6a6733e-a652-40a5-8ff3-bc69e3e80102@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpi3mr-linuxdrv.pdl@broadcom.com \
--cc=sumit.saxena@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox