forked from clearlinux-pkgs/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0113-print-fsync-count-for-bootchart.patch
52 lines (45 loc) · 1.46 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 9dce692e25a2..2b492efcfecd 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1086,6 +1086,9 @@ blk_qc_t submit_bio(struct bio *bio)
count_vm_events(PGPGIN, count);
}
+ if (bio->bi_opf & REQ_PREFLUSH)
+ current->fsync_count++;
+
if (unlikely(block_dump)) {
char b[BDEVNAME_SIZE];
printk(KERN_DEBUG "%s(%d): %s block %Lu on %s (%u sectors)\n",
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 32813c345115..170f9787d13b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -961,6 +961,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 f8c94bebd17d..540fcbbe8bd2 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -951,6 +951,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