diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-05 16:15:17 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-06 15:27:23 -0500 |
commit | c1768268f9424410761da57ea71107acae7b03cc (patch) | |
tree | be6a534b1a15ab9df9f23e585b039776c5a5e498 /block/blk-cgroup.h | |
parent | 549d3aa872cd1aec1ee540fd93afd9611faa0def (diff) |
blkcg: don't use blkg->plid in stat related functions
blkg is scheduled to be unified for all policies and thus there won't
be one-to-one mapping from blkg to policy. Update stat related
functions to take explicit @pol or @plid arguments and not use
blkg->plid.
This is painful for now but most of specific stat interface functions
will be replaced with a handful of generic helpers.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 80 |
1 files changed, 50 insertions, 30 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 5dffd436f30d..60e96b4be4ce 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -335,12 +335,17 @@ static inline void blkg_put(struct blkio_group *blkg) { } | |||
335 | #define BLKIO_WEIGHT_DEFAULT 500 | 335 | #define BLKIO_WEIGHT_DEFAULT 500 |
336 | 336 | ||
337 | #ifdef CONFIG_DEBUG_BLK_CGROUP | 337 | #ifdef CONFIG_DEBUG_BLK_CGROUP |
338 | void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg); | 338 | void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg, |
339 | struct blkio_policy_type *pol); | ||
339 | void blkiocg_update_dequeue_stats(struct blkio_group *blkg, | 340 | void blkiocg_update_dequeue_stats(struct blkio_group *blkg, |
340 | unsigned long dequeue); | 341 | struct blkio_policy_type *pol, |
341 | void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg); | 342 | unsigned long dequeue); |
342 | void blkiocg_update_idle_time_stats(struct blkio_group *blkg); | 343 | void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg, |
343 | void blkiocg_set_start_empty_time(struct blkio_group *blkg); | 344 | struct blkio_policy_type *pol); |
345 | void blkiocg_update_idle_time_stats(struct blkio_group *blkg, | ||
346 | struct blkio_policy_type *pol); | ||
347 | void blkiocg_set_start_empty_time(struct blkio_group *blkg, | ||
348 | struct blkio_policy_type *pol); | ||
344 | 349 | ||
345 | #define BLKG_FLAG_FNS(name) \ | 350 | #define BLKG_FLAG_FNS(name) \ |
346 | static inline void blkio_mark_blkg_##name( \ | 351 | static inline void blkio_mark_blkg_##name( \ |
@@ -363,14 +368,16 @@ BLKG_FLAG_FNS(idling) | |||
363 | BLKG_FLAG_FNS(empty) | 368 | BLKG_FLAG_FNS(empty) |
364 | #undef BLKG_FLAG_FNS | 369 | #undef BLKG_FLAG_FNS |
365 | #else | 370 | #else |
366 | static inline void blkiocg_update_avg_queue_size_stats( | 371 | static inline void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg, |
367 | struct blkio_group *blkg) {} | 372 | struct blkio_policy_type *pol) { } |
368 | static inline void blkiocg_update_dequeue_stats(struct blkio_group *blkg, | 373 | static inline void blkiocg_update_dequeue_stats(struct blkio_group *blkg, |
369 | unsigned long dequeue) {} | 374 | struct blkio_policy_type *pol, unsigned long dequeue) { } |
370 | static inline void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg) | 375 | static inline void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg, |
371 | {} | 376 | struct blkio_policy_type *pol) { } |
372 | static inline void blkiocg_update_idle_time_stats(struct blkio_group *blkg) {} | 377 | static inline void blkiocg_update_idle_time_stats(struct blkio_group *blkg, |
373 | static inline void blkiocg_set_start_empty_time(struct blkio_group *blkg) {} | 378 | struct blkio_policy_type *pol) { } |
379 | static inline void blkiocg_set_start_empty_time(struct blkio_group *blkg, | ||
380 | struct blkio_policy_type *pol) { } | ||
374 | #endif | 381 | #endif |
375 | 382 | ||
376 | #ifdef CONFIG_BLK_CGROUP | 383 | #ifdef CONFIG_BLK_CGROUP |
@@ -386,18 +393,27 @@ struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg, | |||
386 | enum blkio_policy_id plid, | 393 | enum blkio_policy_id plid, |
387 | bool for_root); | 394 | bool for_root); |
388 | void blkiocg_update_timeslice_used(struct blkio_group *blkg, | 395 | void blkiocg_update_timeslice_used(struct blkio_group *blkg, |
389 | unsigned long time, | 396 | struct blkio_policy_type *pol, |
390 | unsigned long unaccounted_time); | 397 | unsigned long time, |
391 | void blkiocg_update_dispatch_stats(struct blkio_group *blkg, uint64_t bytes, | 398 | unsigned long unaccounted_time); |
392 | bool direction, bool sync); | 399 | void blkiocg_update_dispatch_stats(struct blkio_group *blkg, |
400 | struct blkio_policy_type *pol, | ||
401 | uint64_t bytes, bool direction, bool sync); | ||
393 | void blkiocg_update_completion_stats(struct blkio_group *blkg, | 402 | void blkiocg_update_completion_stats(struct blkio_group *blkg, |
394 | uint64_t start_time, uint64_t io_start_time, bool direction, bool sync); | 403 | struct blkio_policy_type *pol, |
395 | void blkiocg_update_io_merged_stats(struct blkio_group *blkg, bool direction, | 404 | uint64_t start_time, |
396 | bool sync); | 405 | uint64_t io_start_time, bool direction, |
406 | bool sync); | ||
407 | void blkiocg_update_io_merged_stats(struct blkio_group *blkg, | ||
408 | struct blkio_policy_type *pol, | ||
409 | bool direction, bool sync); | ||
397 | void blkiocg_update_io_add_stats(struct blkio_group *blkg, | 410 | void blkiocg_update_io_add_stats(struct blkio_group *blkg, |
398 | struct blkio_group *curr_blkg, bool direction, bool sync); | 411 | struct blkio_policy_type *pol, |
412 | struct blkio_group *curr_blkg, bool direction, | ||
413 | bool sync); | ||
399 | void blkiocg_update_io_remove_stats(struct blkio_group *blkg, | 414 | void blkiocg_update_io_remove_stats(struct blkio_group *blkg, |
400 | bool direction, bool sync); | 415 | struct blkio_policy_type *pol, |
416 | bool direction, bool sync); | ||
401 | #else | 417 | #else |
402 | struct cgroup; | 418 | struct cgroup; |
403 | static inline struct blkio_cgroup * | 419 | static inline struct blkio_cgroup * |
@@ -411,19 +427,23 @@ blkiocg_del_blkio_group(struct blkio_group *blkg) { return 0; } | |||
411 | static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, | 427 | static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, |
412 | void *key) { return NULL; } | 428 | void *key) { return NULL; } |
413 | static inline void blkiocg_update_timeslice_used(struct blkio_group *blkg, | 429 | static inline void blkiocg_update_timeslice_used(struct blkio_group *blkg, |
414 | unsigned long time, | 430 | struct blkio_policy_type *pol, unsigned long time, |
415 | unsigned long unaccounted_time) | 431 | unsigned long unaccounted_time) { } |
416 | {} | ||
417 | static inline void blkiocg_update_dispatch_stats(struct blkio_group *blkg, | 432 | static inline void blkiocg_update_dispatch_stats(struct blkio_group *blkg, |
418 | uint64_t bytes, bool direction, bool sync) {} | 433 | struct blkio_policy_type *pol, uint64_t bytes, |
434 | bool direction, bool sync) { } | ||
419 | static inline void blkiocg_update_completion_stats(struct blkio_group *blkg, | 435 | static inline void blkiocg_update_completion_stats(struct blkio_group *blkg, |
420 | uint64_t start_time, uint64_t io_start_time, bool direction, | 436 | struct blkio_policy_type *pol, uint64_t start_time, |
421 | bool sync) {} | 437 | uint64_t io_start_time, bool direction, bool sync) { } |
422 | static inline void blkiocg_update_io_merged_stats(struct blkio_group *blkg, | 438 | static inline void blkiocg_update_io_merged_stats(struct blkio_group *blkg, |
423 | bool direction, bool sync) {} | 439 | struct blkio_policy_type *pol, bool direction, |
440 | bool sync) { } | ||
424 | static inline void blkiocg_update_io_add_stats(struct blkio_group *blkg, | 441 | static inline void blkiocg_update_io_add_stats(struct blkio_group *blkg, |
425 | struct blkio_group *curr_blkg, bool direction, bool sync) {} | 442 | struct blkio_policy_type *pol, |
443 | struct blkio_group *curr_blkg, bool direction, | ||
444 | bool sync) { } | ||
426 | static inline void blkiocg_update_io_remove_stats(struct blkio_group *blkg, | 445 | static inline void blkiocg_update_io_remove_stats(struct blkio_group *blkg, |
427 | bool direction, bool sync) {} | 446 | struct blkio_policy_type *pol, bool direction, |
447 | bool sync) { } | ||
428 | #endif | 448 | #endif |
429 | #endif /* _BLK_CGROUP_H */ | 449 | #endif /* _BLK_CGROUP_H */ |