blk: introduce REQ_SWAP

Just like REQ_META, it's important to know the IO coming down is swap
in order to guard against potential IO priority inversion issues with
cgroups.  Add REQ_SWAP and use it for all swap IO, and add it to our
bio_issue_as_root_blkg helper.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Josef Bacik 2018-07-03 11:14:53 -04:00 committed by Jens Axboe
parent 903d23f0a3
commit 0d1e0c7cd5
3 changed files with 4 additions and 3 deletions

View file

@ -254,7 +254,7 @@ static inline struct blkcg *bio_blkcg(struct bio *bio)
*/
static inline bool bio_issue_as_root_blkg(struct bio *bio)
{
return (bio->bi_opf & REQ_META);
return (bio->bi_opf & (REQ_META | REQ_SWAP)) != 0;
}
/**