Skip to content

Commit

Permalink
block: include discard requests in IO accounting
Browse files Browse the repository at this point in the history
We currently don't do merging on discard requests, but we potentially
could. If we do, then we need to include discard requests in the IO
accounting, or merging would end up decrementing in_flight IO counters
for an IO which never incremented them.

So enable accounting for discard requests.

Problem found by Nikanth Karthikesan <knikanth@suse.de>

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Apr 28, 2009
1 parent c2553b5 commit c69d485
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ static inline int blk_cpu_to_group(int cpu)
*/
static inline int blk_do_io_stat(struct request *rq)
{
return rq->rq_disk && blk_rq_io_stat(rq) && blk_fs_request(rq);
return rq->rq_disk && blk_rq_io_stat(rq) && blk_fs_request(rq) &&
blk_discard_rq(rq);
}

#endif

0 comments on commit c69d485

Please sign in to comment.