Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1561923

Re: [patch] block: add blktrace C events for bio-based drivers

From Jeff Moyer <jmoyer@redhat.com>
Newsgroups linux.kernel
Subject Re: [patch] block: add blktrace C events for bio-based drivers
Date 2017-01-18 17:10 +0100
Message-ID <t10Yb-6eP-41@gated-at.bofh.it> (permalink)
References <t0JXk-3Xl-17@gated-at.bofh.it> <t0K6Z-4fM-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[patch] block: add blktrace C events for bio-based drivers Jeff Moyer <jmoyer@redhat.com> - 2017-01-17 23:00 +0100
  Re: [patch] block: add blktrace C events for bio-based drivers Jens Axboe <axboe@kernel.dk> - 2017-01-17 23:10 +0100
    Re: [patch] block: add blktrace C events for bio-based drivers Jeff Moyer <jmoyer@redhat.com> - 2017-01-17 23:40 +0100
    Re: [patch] block: add blktrace C events for bio-based drivers Jeff Moyer <jmoyer@redhat.com> - 2017-01-18 17:10 +0100

csiph-web