blkcg: associate a blkg for pages being evicted by swap

A prior patch in this series added blkg association to bios issued by
cgroups. There are two other paths that we want to attribute work back
to the appropriate cgroup: swap and writeback. Here we modify the way
swap tags bios to include the blkg. Writeback will be tackle in the next
patch.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Dennis Zhou 2018-12-05 12:10:33 -05:00 committed by Jens Axboe
parent e439bedf6b
commit 6a7f6d86a5
3 changed files with 42 additions and 28 deletions

View file

@ -505,10 +505,10 @@ do { \
disk_devt((bio)->bi_disk)
#if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP)
int bio_associate_blkcg_from_page(struct bio *bio, struct page *page);
void bio_associate_blkg_from_page(struct bio *bio, struct page *page);
#else
static inline int bio_associate_blkcg_from_page(struct bio *bio,
struct page *page) { return 0; }
static inline void bio_associate_blkg_from_page(struct bio *bio,
struct page *page) { }
#endif
#ifdef CONFIG_BLK_CGROUP