Re: [PATCH 2/6] block: introduce __bio_endio()

From: Jens Axboe
Date: Tue Aug 30 2011 - 15:16:16 EST


On 2011-08-28 21:47, Namhyung Kim wrote:
> Currently, bio_endio() lacks its completion tracepoint in it,
> so that the bio-based devices - except DM which inserted the
> tracepoint explicitly - cannot send us such an event when using
> blktrace. Adding the tracepoint in the function will fix this.
>
> However, bio_endio() is also used for other ways like some
> nested bio-handling path and request-based devices. Simply
> adding will result in duplicated event for those cases. Thus
> add new __bio_endio() function to do things as before but no
> tracepoint. Similarly, __bio_io_error() helper was added too.

Not crazy about this solution, it seems a little fragile. And it's hard
to know what the difference between bio_endio() and __bio_endio() is
without looking at the code.

I think it would be cleaner to mark a bio as going inflight, so that we
can check this flag on completion. If it's never been in flight, don't
trigger a completion event trace for it.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/