diff options
author | Josef Bacik <jbacik@fb.com> | 2019-07-09 17:41:29 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-07-10 11:00:57 -0400 |
commit | fd112c74652371a023f85d87b70bee7169e8f4d0 (patch) | |
tree | a9d5510bf2510496172fadae327bf20ab909b560 /block/blk-cgroup.c | |
parent | b554db147feea39617b533ab6bca247c91c6198a (diff) |
blk-cgroup: turn on psi memstall stuff
With the psi stuff in place we can use the memstall flag to indicate
pressure that happens from throttling.
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r-- | block/blk-cgroup.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 53b7bd4c7000..8afa52b0d148 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/ctype.h> | 29 | #include <linux/ctype.h> |
30 | #include <linux/blk-cgroup.h> | 30 | #include <linux/blk-cgroup.h> |
31 | #include <linux/tracehook.h> | 31 | #include <linux/tracehook.h> |
32 | #include <linux/psi.h> | ||
32 | #include "blk.h" | 33 | #include "blk.h" |
33 | 34 | ||
34 | #define MAX_KEY_LEN 100 | 35 | #define MAX_KEY_LEN 100 |
@@ -1587,6 +1588,7 @@ static void blkcg_scale_delay(struct blkcg_gq *blkg, u64 now) | |||
1587 | */ | 1588 | */ |
1588 | static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) | 1589 | static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) |
1589 | { | 1590 | { |
1591 | unsigned long pflags; | ||
1590 | u64 now = ktime_to_ns(ktime_get()); | 1592 | u64 now = ktime_to_ns(ktime_get()); |
1591 | u64 exp; | 1593 | u64 exp; |
1592 | u64 delay_nsec = 0; | 1594 | u64 delay_nsec = 0; |
@@ -1613,11 +1615,8 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) | |||
1613 | */ | 1615 | */ |
1614 | delay_nsec = min_t(u64, delay_nsec, 250 * NSEC_PER_MSEC); | 1616 | delay_nsec = min_t(u64, delay_nsec, 250 * NSEC_PER_MSEC); |
1615 | 1617 | ||
1616 | /* | 1618 | if (use_memdelay) |
1617 | * TODO: the use_memdelay flag is going to be for the upcoming psi stuff | 1619 | psi_memstall_enter(&pflags); |
1618 | * that hasn't landed upstream yet. Once that stuff is in place we need | ||
1619 | * to do a psi_memstall_enter/leave if memdelay is set. | ||
1620 | */ | ||
1621 | 1620 | ||
1622 | exp = ktime_add_ns(now, delay_nsec); | 1621 | exp = ktime_add_ns(now, delay_nsec); |
1623 | tok = io_schedule_prepare(); | 1622 | tok = io_schedule_prepare(); |
@@ -1627,6 +1626,9 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) | |||
1627 | break; | 1626 | break; |
1628 | } while (!fatal_signal_pending(current)); | 1627 | } while (!fatal_signal_pending(current)); |
1629 | io_schedule_finish(tok); | 1628 | io_schedule_finish(tok); |
1629 | |||
1630 | if (use_memdelay) | ||
1631 | psi_memstall_leave(&pflags); | ||
1630 | } | 1632 | } |
1631 | 1633 | ||
1632 | /** | 1634 | /** |