forked from clearlinux-pkgs/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0126-print-fsync-count-for-bootchart.patch
More file actions
52 lines (44 loc) · 1.45 KB
/
Copy path0126-print-fsync-count-for-bootchart.patch
File metadata and controls
52 lines (44 loc) · 1.45 KB
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 41e1c7869bca6e84545e265460e73b33b2e449f9 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Tue, 20 Jun 2017 20:19:08 +0000
Subject: [PATCH 126/126] 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 048be4aa6024..3ddfe5901a07 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2271,6 +2271,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 fdf74f27acf1..f4a102b249f5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -738,6 +738,7 @@ struct task_struct {
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
#endif
+ int fsync_count;
/* Process credentials: */
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 2f93e4a2d9f6..7a2f3f3ea75b 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -943,6 +943,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;
--
2.15.0