Re: [dm-devel] [PATCH v3] block: trace completion of all bios.
From: NeilBrown
Date: Mon Mar 27 2017 - 19:42:50 EST
On Mon, Mar 27 2017, Christoph Hellwig wrote:
> On Mon, Mar 27, 2017 at 08:49:57PM +1100, NeilBrown wrote:
>> On Mon, Mar 27 2017, Christoph Hellwig wrote:
>>
>> > I don't really like the flag at all. I'd much prefer a __bio_endio
>> > with a 'bool trace' flag. Also please remove the manual tracing in
>> > dm.Ä. Once that is done I suspect we can also remove the
>> > block_bio_complete export.
>>
>> Can you say why you don't like it?
>
> It uses up a precious bit in the bio for something that should be state
> that can be determined in the caller at compile time.
I've already demonstrated that the bit is not "precious" at all. I have
shown how I could easily give you 20 unused flag bits without increasing
the size of struct bio.
Yes, the state could be determined in the caller at compiler time. That
would require developers to make the correct choice between two very
similar interfaces, where the consequences of an correct choice are not
immediately obvious.
I think that spending one bit (out of 20) to relieve developers of the
burden of choice (and to spare as all of the consequences of wrong
choice) is a price worth paying.
NeilBrown
Attachment:
signature.asc
Description: PGP signature