mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2025-04-19 20:58:31 +09:00
bcachefs: Separate running/runnable in wp stats
We've got per-writepoint statistics to see how well the writepoint index update threads are pipelining; this separates running vs. runnable so we can see at a glance if they're blocking. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
78c9c6f6cd
commit
999cc1bb68
@ -90,6 +90,7 @@ struct dev_stripe_state {
|
||||
x(stopped) \
|
||||
x(waiting_io) \
|
||||
x(waiting_work) \
|
||||
x(runnable) \
|
||||
x(running)
|
||||
|
||||
enum write_point_state {
|
||||
@ -125,6 +126,7 @@ struct write_point {
|
||||
enum write_point_state state;
|
||||
u64 last_state_change;
|
||||
u64 time[WRITE_POINT_STATE_NR];
|
||||
u64 last_runtime;
|
||||
} __aligned(SMP_CACHE_BYTES);
|
||||
};
|
||||
|
||||
|
@ -587,7 +587,15 @@ err:
|
||||
static inline void __wp_update_state(struct write_point *wp, enum write_point_state state)
|
||||
{
|
||||
if (state != wp->state) {
|
||||
struct task_struct *p = current;
|
||||
u64 now = ktime_get_ns();
|
||||
u64 runtime = p->se.sum_exec_runtime +
|
||||
(now - p->se.exec_start);
|
||||
|
||||
if (state == WRITE_POINT_runnable)
|
||||
wp->last_runtime = runtime;
|
||||
else if (wp->state == WRITE_POINT_runnable)
|
||||
wp->time[WRITE_POINT_running] += runtime - wp->last_runtime;
|
||||
|
||||
if (wp->last_state_change &&
|
||||
time_after64(now, wp->last_state_change))
|
||||
@ -601,7 +609,7 @@ static inline void wp_update_state(struct write_point *wp, bool running)
|
||||
{
|
||||
enum write_point_state state;
|
||||
|
||||
state = running ? WRITE_POINT_running :
|
||||
state = running ? WRITE_POINT_runnable:
|
||||
!list_empty(&wp->writes) ? WRITE_POINT_waiting_io
|
||||
: WRITE_POINT_stopped;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user