aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-10-04 15:04:38 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-10-04 15:04:38 -0400
commit0f78ab9899e9d6acb09d5465def618704255963b (patch)
treeb92832da61ae4f4d712a33ae524c482e979be5ba /drivers
parente00c54c36ac2024c3a8a37432e2e2698ff849594 (diff)
Revert "Seperate read and write statistics of in_flight requests"
This reverts commit a9327cac440be4d8333bba975cbbf76045096275. Corrado Zoccolo <czoccolo@gmail.com> reports: "with 2.6.32-rc1 I started getting the following strange output from "iostat -kx 2": Linux 2.6.31bisect (et2) 04/10/2009 _i686_ (2 CPU) avg-cpu: %user %nice %system %iowait %steal %idle 10,70 0,00 3,16 15,75 0,00 70,38 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util sda 18,22 0,00 0,67 0,01 14,77 0,02 43,94 0,01 10,53 39043915,03 2629219,87 sdb 60,89 9,68 50,79 3,04 1724,43 50,52 65,95 0,70 13,06 488437,47 2629219,87 avg-cpu: %user %nice %system %iowait %steal %idle 2,72 0,00 0,74 0,00 0,00 96,53 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util sda 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 100,00 sdb 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 100,00 avg-cpu: %user %nice %system %iowait %steal %idle 6,68 0,00 0,99 0,00 0,00 92,33 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util sda 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 100,00 sdb 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 100,00 avg-cpu: %user %nice %system %iowait %steal %idle 4,40 0,00 0,73 1,47 0,00 93,40 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util sda 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 0,00 100,00 sdb 0,00 4,00 0,00 3,00 0,00 28,00 18,67 0,06 19,50 333,33 100,00 Global values for service time and utilization are garbage. For interval values, utilization is always 100%, and service time is higher than normal. I bisected it down to: [a9327cac440be4d8333bba975cbbf76045096275] Seperate read and write statistics of in_flight requests and verified that reverting just that commit indeed solves the issue on 2.6.32-rc1." So until this is debugged, revert the bad commit. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 376f1ab48a24..23e76fe0d359 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -130,7 +130,7 @@ struct mapped_device {
130 /* 130 /*
131 * A list of ios that arrived while we were suspended. 131 * A list of ios that arrived while we were suspended.
132 */ 132 */
133 atomic_t pending[2]; 133 atomic_t pending;
134 wait_queue_head_t wait; 134 wait_queue_head_t wait;
135 struct work_struct work; 135 struct work_struct work;
136 struct bio_list deferred; 136 struct bio_list deferred;
@@ -453,14 +453,13 @@ static void start_io_acct(struct dm_io *io)
453{ 453{
454 struct mapped_device *md = io->md; 454 struct mapped_device *md = io->md;
455 int cpu; 455 int cpu;
456 int rw = bio_data_dir(io->bio);
457 456
458 io->start_time = jiffies; 457 io->start_time = jiffies;
459 458
460 cpu = part_stat_lock(); 459 cpu = part_stat_lock();
461 part_round_stats(cpu, &dm_disk(md)->part0); 460 part_round_stats(cpu, &dm_disk(md)->part0);
462 part_stat_unlock(); 461 part_stat_unlock();
463 dm_disk(md)->part0.in_flight[rw] = atomic_inc_return(&md->pending[rw]); 462 dm_disk(md)->part0.in_flight = atomic_inc_return(&md->pending);
464} 463}
465 464
466static void end_io_acct(struct dm_io *io) 465static void end_io_acct(struct dm_io *io)
@@ -480,9 +479,8 @@ static void end_io_acct(struct dm_io *io)
480 * After this is decremented the bio must not be touched if it is 479 * After this is decremented the bio must not be touched if it is
481 * a barrier. 480 * a barrier.
482 */ 481 */
483 dm_disk(md)->part0.in_flight[rw] = pending = 482 dm_disk(md)->part0.in_flight = pending =
484 atomic_dec_return(&md->pending[rw]); 483 atomic_dec_return(&md->pending);
485 pending += atomic_read(&md->pending[rw^0x1]);
486 484
487 /* nudge anyone waiting on suspend queue */ 485 /* nudge anyone waiting on suspend queue */
488 if (!pending) 486 if (!pending)
@@ -1787,8 +1785,7 @@ static struct mapped_device *alloc_dev(int minor)
1787 if (!md->disk) 1785 if (!md->disk)
1788 goto bad_disk; 1786 goto bad_disk;
1789 1787
1790 atomic_set(&md->pending[0], 0); 1788 atomic_set(&md->pending, 0);
1791 atomic_set(&md->pending[1], 0);
1792 init_waitqueue_head(&md->wait); 1789 init_waitqueue_head(&md->wait);
1793 INIT_WORK(&md->work, dm_wq_work); 1790 INIT_WORK(&md->work, dm_wq_work);
1794 init_waitqueue_head(&md->eventq); 1791 init_waitqueue_head(&md->eventq);
@@ -2091,8 +2088,7 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible)
2091 break; 2088 break;
2092 } 2089 }
2093 spin_unlock_irqrestore(q->queue_lock, flags); 2090 spin_unlock_irqrestore(q->queue_lock, flags);
2094 } else if (!atomic_read(&md->pending[0]) && 2091 } else if (!atomic_read(&md->pending))
2095 !atomic_read(&md->pending[1]))
2096 break; 2092 break;
2097 2093
2098 if (interruptible == TASK_INTERRUPTIBLE && 2094 if (interruptible == TASK_INTERRUPTIBLE &&