From: Bart Van Assche <bvanassche@acm.org>
To: Dongliang Cui <dongliang.cui@unisoc.com>,
axboe@kernel.dk, rostedt@goodmis.org, mhiramat@kernel.org,
mathieu.desnoyers@efficios.com, ebiggers@kernel.org
Cc: ke.wang@unisoc.com, hongyu.jin.cn@gmail.com,
niuzhiguo84@gmail.com, hao_hao.wang@unisoc.com,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
akailash@google.com, cuidongliang390@gmail.com,
Damien Le Moal <dlemoal@kernel.org>
Subject: Re: [PATCH v3] block: Add ioprio to block_rq tracepoint
Date: Wed, 22 May 2024 09:51:16 -0700 [thread overview]
Message-ID: <b2e4a072-a339-444e-abea-29388dcbfee6@acm.org> (raw)
In-Reply-To: <20240522090104.1751148-1-dongliang.cui@unisoc.com>
On 5/22/24 02:01, Dongliang Cui wrote:
> +#define IOPRIO_CLASS_STRINGS \
> + { IOPRIO_CLASS_NONE, "none" }, \
> + { IOPRIO_CLASS_RT, "rt" }, \
> + { IOPRIO_CLASS_BE, "be" }, \
> + { IOPRIO_CLASS_IDLE, "idle" }, \
> + { IOPRIO_CLASS_INVALID, "invalid"}
> +
> #ifdef CONFIG_BUFFER_HEAD
> DECLARE_EVENT_CLASS(block_buffer,
>
> @@ -82,6 +90,8 @@ TRACE_EVENT(block_rq_requeue,
> __field( dev_t, dev )
> __field( sector_t, sector )
> __field( unsigned int, nr_sector )
> + __field( unsigned int, ioprio_class )
> + __field( unsigned int, ioprio_value )
> __array( char, rwbs, RWBS_LEN )
> __dynamic_array( char, cmd, 1 )
> ),
> @@ -90,16 +100,19 @@ TRACE_EVENT(block_rq_requeue,
> __entry->dev = rq->q->disk ? disk_devt(rq->q->disk) : 0;
> __entry->sector = blk_rq_trace_sector(rq);
> __entry->nr_sector = blk_rq_trace_nr_sectors(rq);
> + __entry->ioprio_class = rq->ioprio >> IOPRIO_CLASS_SHIFT & 0x3;
> + __entry->ioprio_value = rq->ioprio & 0xff;
Why to split the I/O priority field when storing it in __entry instead of when
the values are printed? Combined the ioprio bitfields occupy 16 bits. The above
patch reserves 64 bits in __entry. I think that's overkill. Additionally, some
bits of the I/O priority bits are discarded by the above code before I/O
priority information is reported.
Please split the I/O priority information into the three fields defined in
include/uapi/linux/ioprio.h (class, hint, prio) and use the macros from that
header file for splitting I/O priority information.
Thanks,
Bart.
prev parent reply other threads:[~2024-05-22 16:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 9:01 Dongliang Cui
2024-05-22 16:51 ` 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=b2e4a072-a339-444e-abea-29388dcbfee6@acm.org \
--to=bvanassche@acm.org \
--cc=akailash@google.com \
--cc=axboe@kernel.dk \
--cc=cuidongliang390@gmail.com \
--cc=dlemoal@kernel.org \
--cc=dongliang.cui@unisoc.com \
--cc=ebiggers@kernel.org \
--cc=hao_hao.wang@unisoc.com \
--cc=hongyu.jin.cn@gmail.com \
--cc=ke.wang@unisoc.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=niuzhiguo84@gmail.com \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®