Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142032
b: refs/heads/master
c: 644b2d9
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Apr 6, 2009
1 parent 5f64dda commit 5d95771
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4194b1eaf18ddc3eee9597e8800b6d2ffdfd3614
refs/heads/master: 644b2d99b7a8677a56909a7b1fde31677eba4471
13 changes: 11 additions & 2 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,15 @@ void init_request_from_bio(struct request *req, struct bio *bio)
blk_rq_bio_prep(req->q, req, bio);
}

/*
* Only disabling plugging for non-rotational devices if it does tagging
* as well, otherwise we do need the proper merging
*/
static inline bool queue_should_plug(struct request_queue *q)
{
return !(blk_queue_nonrot(q) && blk_queue_tagged(q));
}

static int __make_request(struct request_queue *q, struct bio *bio)
{
struct request *req;
Expand Down Expand Up @@ -1242,11 +1251,11 @@ static int __make_request(struct request_queue *q, struct bio *bio)
if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) ||
bio_flagged(bio, BIO_CPU_AFFINE))
req->cpu = blk_cpu_to_group(smp_processor_id());
if (!blk_queue_nonrot(q) && elv_queue_empty(q))
if (queue_should_plug(q) && elv_queue_empty(q))
blk_plug_device(q);
add_request(q, req);
out:
if (unplug || blk_queue_nonrot(q))
if (unplug || !queue_should_plug(q))
__generic_unplug_device(q);
spin_unlock_irq(q->queue_lock);
return 0;
Expand Down

0 comments on commit 5d95771

Please sign in to comment.