|
@@ -1469,15 +1469,15 @@ static void add_acct_request(struct request_queue *q, struct request *rq,
|
|
__elv_add_request(q, rq, where);
|
|
__elv_add_request(q, rq, where);
|
|
}
|
|
}
|
|
|
|
|
|
-static void part_round_stats_single(int cpu, struct hd_struct *part,
|
|
|
|
- unsigned long now)
|
|
|
|
|
|
+static void part_round_stats_single(struct request_queue *q, int cpu,
|
|
|
|
+ struct hd_struct *part, unsigned long now)
|
|
{
|
|
{
|
|
int inflight;
|
|
int inflight;
|
|
|
|
|
|
if (now == part->stamp)
|
|
if (now == part->stamp)
|
|
return;
|
|
return;
|
|
|
|
|
|
- inflight = part_in_flight(part);
|
|
|
|
|
|
+ inflight = part_in_flight(q, part);
|
|
if (inflight) {
|
|
if (inflight) {
|
|
__part_stat_add(cpu, part, time_in_queue,
|
|
__part_stat_add(cpu, part, time_in_queue,
|
|
inflight * (now - part->stamp));
|
|
inflight * (now - part->stamp));
|
|
@@ -1488,6 +1488,7 @@ static void part_round_stats_single(int cpu, struct hd_struct *part,
|
|
|
|
|
|
/**
|
|
/**
|
|
* part_round_stats() - Round off the performance stats on a struct disk_stats.
|
|
* part_round_stats() - Round off the performance stats on a struct disk_stats.
|
|
|
|
+ * @q: target block queue
|
|
* @cpu: cpu number for stats access
|
|
* @cpu: cpu number for stats access
|
|
* @part: target partition
|
|
* @part: target partition
|
|
*
|
|
*
|
|
@@ -1502,13 +1503,14 @@ static void part_round_stats_single(int cpu, struct hd_struct *part,
|
|
* /proc/diskstats. This accounts immediately for all queue usage up to
|
|
* /proc/diskstats. This accounts immediately for all queue usage up to
|
|
* the current jiffies and restarts the counters again.
|
|
* the current jiffies and restarts the counters again.
|
|
*/
|
|
*/
|
|
-void part_round_stats(int cpu, struct hd_struct *part)
|
|
|
|
|
|
+void part_round_stats(struct request_queue *q, int cpu, struct hd_struct *part)
|
|
{
|
|
{
|
|
unsigned long now = jiffies;
|
|
unsigned long now = jiffies;
|
|
|
|
|
|
if (part->partno)
|
|
if (part->partno)
|
|
- part_round_stats_single(cpu, &part_to_disk(part)->part0, now);
|
|
|
|
- part_round_stats_single(cpu, part, now);
|
|
|
|
|
|
+ part_round_stats_single(q, cpu, &part_to_disk(part)->part0,
|
|
|
|
+ now);
|
|
|
|
+ part_round_stats_single(q, cpu, part, now);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(part_round_stats);
|
|
EXPORT_SYMBOL_GPL(part_round_stats);
|
|
|
|
|
|
@@ -2431,8 +2433,8 @@ void blk_account_io_done(struct request *req)
|
|
|
|
|
|
part_stat_inc(cpu, part, ios[rw]);
|
|
part_stat_inc(cpu, part, ios[rw]);
|
|
part_stat_add(cpu, part, ticks[rw], duration);
|
|
part_stat_add(cpu, part, ticks[rw], duration);
|
|
- part_round_stats(cpu, part);
|
|
|
|
- part_dec_in_flight(part, rw);
|
|
|
|
|
|
+ part_round_stats(req->q, cpu, part);
|
|
|
|
+ part_dec_in_flight(req->q, part, rw);
|
|
|
|
|
|
hd_struct_put(part);
|
|
hd_struct_put(part);
|
|
part_stat_unlock();
|
|
part_stat_unlock();
|
|
@@ -2489,8 +2491,8 @@ void blk_account_io_start(struct request *rq, bool new_io)
|
|
part = &rq->rq_disk->part0;
|
|
part = &rq->rq_disk->part0;
|
|
hd_struct_get(part);
|
|
hd_struct_get(part);
|
|
}
|
|
}
|
|
- part_round_stats(cpu, part);
|
|
|
|
- part_inc_in_flight(part, rw);
|
|
|
|
|
|
+ part_round_stats(rq->q, cpu, part);
|
|
|
|
+ part_inc_in_flight(rq->q, part, rw);
|
|
rq->part = part;
|
|
rq->part = part;
|
|
}
|
|
}
|
|
|
|
|