ANDROID: block: Make sub_page_limit_queues available in debugfs
This new debugfs attribute makes it easier to verify the code that tracks how many queues require limits below the page size. Bug: 308663717 Bug: 319125789 Change-Id: I2ee54a9e4544866e71b505ae9296b68039d5ca82 Signed-off-by: Bart Van Assche <bvanassche@acm.org> [jyescas@google.com: Wrap #include "blk-mq-debugfs.h" with #ifndef __GENKSYSM__ to avoid ABI CRC changes.] Signed-off-by: Juan Yescas <jyescas@google.com>
This commit is contained in:
parent
4fd9a46455
commit
c5b8696597
@ -45,6 +45,9 @@
|
|||||||
#include <trace/events/block.h>
|
#include <trace/events/block.h>
|
||||||
|
|
||||||
#include "blk.h"
|
#include "blk.h"
|
||||||
|
#ifndef __GENKSYMS__
|
||||||
|
#include "blk-mq-debugfs.h"
|
||||||
|
#endif
|
||||||
#include "blk-mq-sched.h"
|
#include "blk-mq-sched.h"
|
||||||
#include "blk-pm.h"
|
#include "blk-pm.h"
|
||||||
#include "blk-cgroup.h"
|
#include "blk-cgroup.h"
|
||||||
@ -1213,6 +1216,7 @@ int __init blk_dev_init(void)
|
|||||||
sizeof(struct srcu_struct), 0, SLAB_PANIC, NULL);
|
sizeof(struct srcu_struct), 0, SLAB_PANIC, NULL);
|
||||||
|
|
||||||
blk_debugfs_root = debugfs_create_dir("block", NULL);
|
blk_debugfs_root = debugfs_create_dir("block", NULL);
|
||||||
|
blk_mq_debugfs_init();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -874,3 +874,12 @@ void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
|
|||||||
debugfs_remove_recursive(hctx->sched_debugfs_dir);
|
debugfs_remove_recursive(hctx->sched_debugfs_dir);
|
||||||
hctx->sched_debugfs_dir = NULL;
|
hctx->sched_debugfs_dir = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_DEBUGFS_ATTRIBUTE(blk_sub_page_limit_queues_fops,
|
||||||
|
blk_sub_page_limit_queues_get, NULL, "%llu\n");
|
||||||
|
|
||||||
|
void blk_mq_debugfs_init(void)
|
||||||
|
{
|
||||||
|
debugfs_create_file("sub_page_limit_queues", 0400, blk_debugfs_root,
|
||||||
|
NULL, &blk_sub_page_limit_queues_fops);
|
||||||
|
}
|
||||||
|
@ -17,6 +17,8 @@ struct blk_mq_debugfs_attr {
|
|||||||
const struct seq_operations *seq_ops;
|
const struct seq_operations *seq_ops;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void blk_mq_debugfs_init(void);
|
||||||
|
|
||||||
int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq);
|
int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq);
|
||||||
int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
|
int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
|
||||||
|
|
||||||
@ -36,6 +38,10 @@ void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
|
|||||||
void blk_mq_debugfs_register_rqos(struct rq_qos *rqos);
|
void blk_mq_debugfs_register_rqos(struct rq_qos *rqos);
|
||||||
void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos);
|
void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos);
|
||||||
#else
|
#else
|
||||||
|
static inline void blk_mq_debugfs_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static inline void blk_mq_debugfs_register(struct request_queue *q)
|
static inline void blk_mq_debugfs_register(struct request_queue *q)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,14 @@ void blk_queue_bounce_limit(struct request_queue *q, enum blk_bounce bounce)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(blk_queue_bounce_limit);
|
EXPORT_SYMBOL(blk_queue_bounce_limit);
|
||||||
|
|
||||||
|
/* For debugfs. */
|
||||||
|
int blk_sub_page_limit_queues_get(void *data, u64 *val)
|
||||||
|
{
|
||||||
|
*val = READ_ONCE(blk_nr_sub_page_limit_queues);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* blk_enable_sub_page_limits - enable support for limits below the page size
|
* blk_enable_sub_page_limits - enable support for limits below the page size
|
||||||
* @lim: request queue limits for which to enable support of these features.
|
* @lim: request queue limits for which to enable support of these features.
|
||||||
|
@ -44,6 +44,7 @@ static inline bool blk_queue_sub_page_limits(const struct queue_limits *lim)
|
|||||||
lim->sub_page_limits;
|
lim->sub_page_limits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int blk_sub_page_limit_queues_get(void *data, u64 *val);
|
||||||
void blk_disable_sub_page_limits(struct queue_limits *q);
|
void blk_disable_sub_page_limits(struct queue_limits *q);
|
||||||
|
|
||||||
void blk_freeze_queue(struct request_queue *q);
|
void blk_freeze_queue(struct request_queue *q);
|
||||||
|
Loading…
Reference in New Issue
Block a user