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


Groups > linux.kernel > #1608027

Re: [PATCH v2] block: trace completion of all bios.

From NeilBrown <neilb@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] block: trace completion of all bios.
Date 2017-03-24 01:10 +0100
Message-ID <tokXM-1Dk-11@gated-at.bofh.it> (permalink)
References <tnElP-3TW-1@gated-at.bofh.it> <tnO1Q-2wP-19@gated-at.bofh.it> <to5Fp-7vn-33@gated-at.bofh.it> <to8tB-116-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Mar 23 2017, Ming Lei wrote:

> On Thu, Mar 23, 2017 at 05:29:02PM +1100, NeilBrown wrote:
>> 
>>  /**
>> + * bio_endio_notrace - end I/O on a bio without tracing
>> + * @bio:	bio
>> + *
>> + * Description:
>> + *   bio_endio_notrace() will end I/O on the whole bio.
>> + *   bio_endio_notrace() should only be call if a completion trace
>> + *   event is not needed.  This can be the case if a request-level
>> + *   completion event has already been generated, if the bio is
>> + *   being completed early, before it was even queued.
>> + *
>> + **/
>> +void bio_endio_notrace(struct bio *bio)
>> +{
>> +again:
...
>> +
>> +	if (bio->bi_bdev)
>> +		trace_block_bio_complete(bdev_get_queue(bio->bi_bdev),
>> +					 bio, bio->bi_error);
>
> The notrace version still traces?

Ugh.  Thanks :-(

>
>> +	if (bio->bi_end_io)
>> +		bio->bi_end_io(bio);
>> +}
>> +EXPORT_SYMBOL(bio_endio_notrace);
>
> It isn't a good idea to duplicate bio_endio here, and any change on
> bio_endio() may be needed for this _notrace version too in future.

I uhmed and arhhed about that.  The function is so small....
But I've had a change of heart.  I don't think that having separate
bio_endio() and bio_endio_notrace() is such a good idea. It is too easy
to use the wrong one.  It is much better to make it automatically do the
right thing.
So following is a new patch - more thoroughly tested - which handles
more cases, and doesn't need any follow-up changes for filesystems.

Thanks,
Neilbrown

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


Thread

[PATCH] block: trace completion of all bios. NeilBrown <neilb@suse.com> - 2017-03-22 03:40 +0100
  Re: [PATCH] block: trace completion of all bios. Christoph Hellwig <hch@infradead.org> - 2017-03-22 14:00 +0100
    Re: [PATCH] block: trace completion of all bios. NeilBrown <neilb@suse.com> - 2017-03-23 08:50 +0100
    [PATCH v2] block: trace completion of all bios. NeilBrown <neilb@suse.com> - 2017-03-23 08:50 +0100
      Re: [PATCH v2] block: trace completion of all bios. Ming Lei <tom.leiming@gmail.com> - 2017-03-23 11:50 +0100
        Re: [PATCH v2] block: trace completion of all bios. NeilBrown <neilb@suse.com> - 2017-03-24 01:10 +0100
        [PATCH v3] block: trace completion of all bios. NeilBrown <neilb@suse.com> - 2017-03-24 01:10 +0100
          Re: [PATCH v3] block: trace completion of all bios. Ming Lei <tom.leiming@gmail.com> - 2017-03-24 07:50 +0100
            Re: [PATCH v3] block: trace completion of all bios. NeilBrown <neilb@suse.com> - 2017-03-27 01:30 +0200
          Re: [PATCH v3] block: trace completion of all bios. Christoph Hellwig <hch@infradead.org> - 2017-03-27 11:10 +0200
            Re: [PATCH v3] block: trace completion of all bios. NeilBrown <neilb@suse.com> - 2017-03-27 12:00 +0200

csiph-web