Re: [PATCH] block: simplify I/O stat accounting

Jerome Marchand
2009-04-17T08:04:27Z

Jens Axboe wrote:
> On Thu, Apr 16 2009, Jens Axboe wrote:
>> On Thu, Apr 16 2009, Jens Axboe wrote:
>>> On Thu, Apr 16 2009, Jens Axboe wrote:
>>>> On Thu, Apr 16 2009, Jerome Marchand wrote:
>>>>> This simplifies I/O stat accounting switching code and separates it
>>>>> completely from I/O scheduler switch code.
>>>>>
>>>>> Requests are accounted according to the state of their request queue
>>>>> at the time of the request allocation. There is no need anymore to
>>>>> flush the request queue when switching I/O accounting state.
>>>> This is cleaner, I like it. I'll apply it, but I'm changing this one:
>>>>
>>>>> @@ -792,9 +792,10 @@ static struct request *get_request(struct
>>>>> request_queue *q, int rw_flags,
>>>>> if (priv)
>>>>> rl->elvpriv++;
>>>>>
>>>>> + iostat = blk_queue_io_stat(q) ? REQ_IO_STAT : 0;
>>>>> spin_unlock_irq(q->queue_lock);
>>>> to a regular if, I hate these ?: constructs. An if is much more
>>>> readable, imho.
>>> Grmbl, your patch is line wrapped. Please fix your mailer.
>> And it doesn't apply to current -git. Looks like a hand apply, but
>> please be a little more careful in the future.
>
> OK, it doesn't even compile either:
>
> +#define blk_rq_io_stat(rq) ((rq)->flags & REQ_IO_STAT)
>
> that wants to be ->cmd_flags.
>
> Please resend when you have something that at least compiles. If you
> send untested stuff my way, at least tell me.
>

Hi Jens,

I'm very sorry about this. I didn't send you a patch which does not
compiles on purpose. I was working on backporting that patch on an older
version of the kernel. It looks like I hand-edited that patch by mistake
before I sent it to you.

Jérôme