mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
kyber: covert to use request_queue->async_depth
Instead of the internal async_depth, remove kqd->async_depth and related helpers. Noted elevator attribute async_depth is now removed, queue attribute with the same name is used instead. Signed-off-by: Yu Kuai <yukuai@fnnas.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -47,9 +47,8 @@ enum {
|
|||||||
* asynchronous requests, we reserve 25% of requests for synchronous
|
* asynchronous requests, we reserve 25% of requests for synchronous
|
||||||
* operations.
|
* operations.
|
||||||
*/
|
*/
|
||||||
KYBER_ASYNC_PERCENT = 75,
|
KYBER_DEFAULT_ASYNC_PERCENT = 75,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum device-wide depth for each scheduling domain.
|
* Maximum device-wide depth for each scheduling domain.
|
||||||
*
|
*
|
||||||
@@ -157,9 +156,6 @@ struct kyber_queue_data {
|
|||||||
*/
|
*/
|
||||||
struct sbitmap_queue domain_tokens[KYBER_NUM_DOMAINS];
|
struct sbitmap_queue domain_tokens[KYBER_NUM_DOMAINS];
|
||||||
|
|
||||||
/* Number of allowed async requests. */
|
|
||||||
unsigned int async_depth;
|
|
||||||
|
|
||||||
struct kyber_cpu_latency __percpu *cpu_latency;
|
struct kyber_cpu_latency __percpu *cpu_latency;
|
||||||
|
|
||||||
/* Timer for stats aggregation and adjusting domain tokens. */
|
/* Timer for stats aggregation and adjusting domain tokens. */
|
||||||
@@ -401,10 +397,7 @@ err:
|
|||||||
|
|
||||||
static void kyber_depth_updated(struct request_queue *q)
|
static void kyber_depth_updated(struct request_queue *q)
|
||||||
{
|
{
|
||||||
struct kyber_queue_data *kqd = q->elevator->elevator_data;
|
blk_mq_set_min_shallow_depth(q, q->async_depth);
|
||||||
|
|
||||||
kqd->async_depth = q->nr_requests * KYBER_ASYNC_PERCENT / 100U;
|
|
||||||
blk_mq_set_min_shallow_depth(q, kqd->async_depth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int kyber_init_sched(struct request_queue *q, struct elevator_queue *eq)
|
static int kyber_init_sched(struct request_queue *q, struct elevator_queue *eq)
|
||||||
@@ -414,6 +407,7 @@ static int kyber_init_sched(struct request_queue *q, struct elevator_queue *eq)
|
|||||||
blk_queue_flag_clear(QUEUE_FLAG_SQ_SCHED, q);
|
blk_queue_flag_clear(QUEUE_FLAG_SQ_SCHED, q);
|
||||||
|
|
||||||
q->elevator = eq;
|
q->elevator = eq;
|
||||||
|
q->async_depth = q->nr_requests * KYBER_DEFAULT_ASYNC_PERCENT / 100;
|
||||||
kyber_depth_updated(q);
|
kyber_depth_updated(q);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -552,15 +546,8 @@ static void rq_clear_domain_token(struct kyber_queue_data *kqd,
|
|||||||
|
|
||||||
static void kyber_limit_depth(blk_opf_t opf, struct blk_mq_alloc_data *data)
|
static void kyber_limit_depth(blk_opf_t opf, struct blk_mq_alloc_data *data)
|
||||||
{
|
{
|
||||||
/*
|
if (!blk_mq_is_sync_read(opf))
|
||||||
* We use the scheduler tags as per-hardware queue queueing tokens.
|
data->shallow_depth = data->q->async_depth;
|
||||||
* Async requests can be limited at this stage.
|
|
||||||
*/
|
|
||||||
if (!blk_mq_is_sync_read(opf)) {
|
|
||||||
struct kyber_queue_data *kqd = data->q->elevator->elevator_data;
|
|
||||||
|
|
||||||
data->shallow_depth = kqd->async_depth;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool kyber_bio_merge(struct request_queue *q, struct bio *bio,
|
static bool kyber_bio_merge(struct request_queue *q, struct bio *bio,
|
||||||
@@ -956,15 +943,6 @@ KYBER_DEBUGFS_DOMAIN_ATTRS(KYBER_DISCARD, discard)
|
|||||||
KYBER_DEBUGFS_DOMAIN_ATTRS(KYBER_OTHER, other)
|
KYBER_DEBUGFS_DOMAIN_ATTRS(KYBER_OTHER, other)
|
||||||
#undef KYBER_DEBUGFS_DOMAIN_ATTRS
|
#undef KYBER_DEBUGFS_DOMAIN_ATTRS
|
||||||
|
|
||||||
static int kyber_async_depth_show(void *data, struct seq_file *m)
|
|
||||||
{
|
|
||||||
struct request_queue *q = data;
|
|
||||||
struct kyber_queue_data *kqd = q->elevator->elevator_data;
|
|
||||||
|
|
||||||
seq_printf(m, "%u\n", kqd->async_depth);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int kyber_cur_domain_show(void *data, struct seq_file *m)
|
static int kyber_cur_domain_show(void *data, struct seq_file *m)
|
||||||
{
|
{
|
||||||
struct blk_mq_hw_ctx *hctx = data;
|
struct blk_mq_hw_ctx *hctx = data;
|
||||||
@@ -990,7 +968,6 @@ static const struct blk_mq_debugfs_attr kyber_queue_debugfs_attrs[] = {
|
|||||||
KYBER_QUEUE_DOMAIN_ATTRS(write),
|
KYBER_QUEUE_DOMAIN_ATTRS(write),
|
||||||
KYBER_QUEUE_DOMAIN_ATTRS(discard),
|
KYBER_QUEUE_DOMAIN_ATTRS(discard),
|
||||||
KYBER_QUEUE_DOMAIN_ATTRS(other),
|
KYBER_QUEUE_DOMAIN_ATTRS(other),
|
||||||
{"async_depth", 0400, kyber_async_depth_show},
|
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
#undef KYBER_QUEUE_DOMAIN_ATTRS
|
#undef KYBER_QUEUE_DOMAIN_ATTRS
|
||||||
|
|||||||
Reference in New Issue
Block a user