From: Jeff Moyer <jmoyer@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-raid@vger.kernel.org, snitzer@redhat.com,
linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
dm-devel@redhat.com, shli@kernel.org, hch@lst.de, agk@redhat.com
Subject: Re: [patch] block: add blktrace C events for bio-based drivers
Date: Wed, 18 Jan 2017 11:01:46 -0500 [thread overview]
Message-ID: <x49ziiol5lh.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <f3044f42-3134-c577-068f-bd2750528b32@kernel.dk> (Jens Axboe's message of "Tue, 17 Jan 2017 14:07:32 -0800")
Hi, Jens,
Jens Axboe <axboe@kernel.dk> writes:
> I like the change, hate the naming. I'd prefer one of two things:
>
> - Add bio_endio_complete() instead. That name sucks too, the
> important part is flipping the __name() to have a trace
> version instead.
ITYM a notrace version. By default, we want tracing for bio_endio. The
only callers that need the inverse of that are in the request-based
path, and there are only 2 of them.
> - Mark the bio as trace completed, and keep the naming. Since
> it's only off the completion path, that can be just marking
> the bi_flags non-atomically.
One issue with this is in generic_make_request_checks, where we can call
bio_endio without having called trace_block_bio_queue (so you could get
a C event with no corresponding Q). To address that, we could make the
flag indicate that trace_block_bio_queue was performed, and clear it in
bio_complete, like so:
if (test_and_clear_bit(BIO_QUEUE_TRACED, &bio->bi_flags))
trace_block_bio_complete(...);
That would solve the problem of duplicate completions, but requires
setting the flag in the submission path and clearing it in the
completion path. I think the former can be done with just a
bio_set_flag (i.e. non-atomic), right? Of course, where to stick that
bio_set_flag call is another bike-shedding discussion waiting to happen
(i.e. does it go in the tracepoint itself?).
Alternatively, we could set the trace_completed flag in the paths where
we end I/O without having done the trace_block_bio_queue, but that seems
way uglier to me.
Can you think of any other options? If we're choosing from the above,
my preference is for adding the bio_endio_notrace(), since it's so much
simpler.
Cheers,
Jeff
prev parent reply other threads:[~2017-01-18 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 21:57 [patch] block: add blktrace C events for bio-based drivers Jeff Moyer
2017-01-17 22:07 ` Jens Axboe
2017-01-17 22:39 ` Jeff Moyer
2017-01-18 16:01 ` Jeff Moyer [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=x49ziiol5lh.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=shli@kernel.org \
--cc=snitzer@redhat.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;
as well as URLs for NNTP newsgroup(s).