-
Notifications
You must be signed in to change notification settings - Fork 59
/
0113-print-fsync-count-for-bootchart.patch
52 lines (45 loc) · 1.39 KB
/
0113-print-fsync-count-for-bootchart.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Tue, 20 Jun 2017 20:19:08 +0000
Subject: [PATCH] print fsync count for bootchart
---
block/blk-core.c | 3 +++
include/linux/sched.h | 1 +
kernel/sched/debug.c | 1 +
3 files changed, 5 insertions(+)
diff --git a/block/blk-core.c b/block/blk-core.c
index 779b4a1f66ac..f1a4da52b511 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -945,6 +945,9 @@ void submit_bio(struct bio *bio)
task_io_account_read(bio->bi_iter.bi_size);
count_vm_events(PGPGIN, count);
}
+
+ if (bio->bi_opf & REQ_PREFLUSH)
+ current->fsync_count++;
}
/*
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4b4cc633b266..094875ea5388 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1046,6 +1046,7 @@ struct task_struct {
/* Cached requested key. */
struct key *cached_requested_key;
#endif
+ int fsync_count;
/*
* executable name, excluding path.
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 102d6f70e84d..cc06e81a9e61 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -960,6 +960,7 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
PN(se.exec_start);
PN(se.vruntime);
PN(se.sum_exec_runtime);
+ P(fsync_count);
nr_switches = p->nvcsw + p->nivcsw;
--
https://clearlinux.org