提交 1417a792 编写于 作者: J Josef Bacik 提交者: Joseph Qi

blk-cgroup: turn on psi memstall stuff

commit fd112c74652371a023f85d87b70bee7169e8f4d0 upstream.

With the psi stuff in place we can use the memstall flag to indicate
pressure that happens from throttling.
Signed-off-by: NJosef Bacik <jbacik@fb.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 00bf95fe
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/blk-cgroup.h> #include <linux/blk-cgroup.h>
#include <linux/tracehook.h> #include <linux/tracehook.h>
#include <linux/psi.h>
#include "blk.h" #include "blk.h"
#define MAX_KEY_LEN 100 #define MAX_KEY_LEN 100
...@@ -1674,6 +1675,7 @@ static void blkcg_scale_delay(struct blkcg_gq *blkg, u64 now) ...@@ -1674,6 +1675,7 @@ static void blkcg_scale_delay(struct blkcg_gq *blkg, u64 now)
*/ */
static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)
{ {
unsigned long pflags;
u64 now = ktime_to_ns(ktime_get()); u64 now = ktime_to_ns(ktime_get());
u64 exp; u64 exp;
u64 delay_nsec = 0; u64 delay_nsec = 0;
...@@ -1700,11 +1702,8 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) ...@@ -1700,11 +1702,8 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)
*/ */
delay_nsec = min_t(u64, delay_nsec, 250 * NSEC_PER_MSEC); delay_nsec = min_t(u64, delay_nsec, 250 * NSEC_PER_MSEC);
/* if (use_memdelay)
* TODO: the use_memdelay flag is going to be for the upcoming psi stuff psi_memstall_enter(&pflags);
* that hasn't landed upstream yet. Once that stuff is in place we need
* to do a psi_memstall_enter/leave if memdelay is set.
*/
exp = ktime_add_ns(now, delay_nsec); exp = ktime_add_ns(now, delay_nsec);
tok = io_schedule_prepare(); tok = io_schedule_prepare();
...@@ -1714,6 +1713,9 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) ...@@ -1714,6 +1713,9 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)
break; break;
} while (!fatal_signal_pending(current)); } while (!fatal_signal_pending(current));
io_schedule_finish(tok); io_schedule_finish(tok);
if (use_memdelay)
psi_memstall_leave(&pflags);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册