aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-03-05 16:15:17 -0500
committerJens Axboe <axboe@kernel.dk>2012-03-06 15:27:23 -0500
commitc1768268f9424410761da57ea71107acae7b03cc (patch)
treebe6a534b1a15ab9df9f23e585b039776c5a5e498 /block/blk-cgroup.h
parent549d3aa872cd1aec1ee540fd93afd9611faa0def (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.h80
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
338void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg); 338void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
339 struct blkio_policy_type *pol);
339void blkiocg_update_dequeue_stats(struct blkio_group *blkg, 340void blkiocg_update_dequeue_stats(struct blkio_group *blkg,
340 unsigned long dequeue); 341 struct blkio_policy_type *pol,
341void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg); 342 unsigned long dequeue);
342void blkiocg_update_idle_time_stats(struct blkio_group *blkg); 343void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
343void blkiocg_set_start_empty_time(struct blkio_group *blkg); 344 struct blkio_policy_type *pol);
345void blkiocg_update_idle_time_stats(struct blkio_group *blkg,
346 struct blkio_policy_type *pol);
347void 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) \
346static inline void blkio_mark_blkg_##name( \ 351static inline void blkio_mark_blkg_##name( \
@@ -363,14 +368,16 @@ BLKG_FLAG_FNS(idling)
363BLKG_FLAG_FNS(empty) 368BLKG_FLAG_FNS(empty)
364#undef BLKG_FLAG_FNS 369#undef BLKG_FLAG_FNS
365#else 370#else
366static inline void blkiocg_update_avg_queue_size_stats( 371static inline void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
367 struct blkio_group *blkg) {} 372 struct blkio_policy_type *pol) { }
368static inline void blkiocg_update_dequeue_stats(struct blkio_group *blkg, 373static inline void blkiocg_update_dequeue_stats(struct blkio_group *blkg,
369 unsigned long dequeue) {} 374 struct blkio_policy_type *pol, unsigned long dequeue) { }
370static inline void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg) 375static inline void blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
371{} 376 struct blkio_policy_type *pol) { }
372static inline void blkiocg_update_idle_time_stats(struct blkio_group *blkg) {} 377static inline void blkiocg_update_idle_time_stats(struct blkio_group *blkg,
373static inline void blkiocg_set_start_empty_time(struct blkio_group *blkg) {} 378 struct blkio_policy_type *pol) { }
379static 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);
388void blkiocg_update_timeslice_used(struct blkio_group *blkg, 395void 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,
391void blkiocg_update_dispatch_stats(struct blkio_group *blkg, uint64_t bytes, 398 unsigned long unaccounted_time);
392 bool direction, bool sync); 399void blkiocg_update_dispatch_stats(struct blkio_group *blkg,
400 struct blkio_policy_type *pol,
401 uint64_t bytes, bool direction, bool sync);
393void blkiocg_update_completion_stats(struct blkio_group *blkg, 402void 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,
395void 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);
407void blkiocg_update_io_merged_stats(struct blkio_group *blkg,
408 struct blkio_policy_type *pol,
409 bool direction, bool sync);
397void blkiocg_update_io_add_stats(struct blkio_group *blkg, 410void 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);
399void blkiocg_update_io_remove_stats(struct blkio_group *blkg, 414void 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
402struct cgroup; 418struct cgroup;
403static inline struct blkio_cgroup * 419static inline struct blkio_cgroup *
@@ -411,19 +427,23 @@ blkiocg_del_blkio_group(struct blkio_group *blkg) { return 0; }
411static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, 427static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg,
412 void *key) { return NULL; } 428 void *key) { return NULL; }
413static inline void blkiocg_update_timeslice_used(struct blkio_group *blkg, 429static 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{}
417static inline void blkiocg_update_dispatch_stats(struct blkio_group *blkg, 432static 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) { }
419static inline void blkiocg_update_completion_stats(struct blkio_group *blkg, 435static 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) { }
422static inline void blkiocg_update_io_merged_stats(struct blkio_group *blkg, 438static 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) { }
424static inline void blkiocg_update_io_add_stats(struct blkio_group *blkg, 441static 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) { }
426static inline void blkiocg_update_io_remove_stats(struct blkio_group *blkg, 445static 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 */