Skip to content

Commit

Permalink
block: Don't count_vm_events for discard bio in submit_bio.
Browse files Browse the repository at this point in the history
In submit_bio, we count vm events by check READ/WRITE.
But actually DISCARD_NOBARRIER also has the WRITE flag set.
It looks as if in blkdev_issue_discard, we also add a
page as the payload and the bio_has_data check isn't enough.
So add another check for discard bio.

Signed-off-by: Tao Ma <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Tao Ma authored and Jens Axboe committed Jun 24, 2010
1 parent 9e495db commit 1b99973
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ void submit_bio(int rw, struct bio *bio)
* If it's a regular read/write or a barrier with data attached,
* go through the normal accounting stuff before submission.
*/
if (bio_has_data(bio)) {
if (bio_has_data(bio) && !(rw & (1 << BIO_RW_DISCARD))) {
if (rw & WRITE) {
count_vm_events(PGPGOUT, count);
} else {
Expand Down

0 comments on commit 1b99973

Please sign in to comment.