1 |
Author: mpagano |
2 |
Date: 2009-03-26 16:42:19 +0000 (Thu, 26 Mar 2009) |
3 |
New Revision: 1536 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/2.6.28/1920_write-sync-regression-fix.patch |
7 |
Modified: |
8 |
genpatches-2.6/trunk/2.6.28/0000_README |
9 |
Log: |
10 |
Fix for performance regression when WRITE_SYNC writes and writes submitted without sync flag caused excession idling in IO scheduler |
11 |
|
12 |
Modified: genpatches-2.6/trunk/2.6.28/0000_README |
13 |
=================================================================== |
14 |
--- genpatches-2.6/trunk/2.6.28/0000_README 2009-03-24 23:58:01 UTC (rev 1535) |
15 |
+++ genpatches-2.6/trunk/2.6.28/0000_README 2009-03-26 16:42:19 UTC (rev 1536) |
16 |
@@ -99,6 +99,10 @@ |
17 |
From: Aneesh Kumar K.V <aneesh.kumar@××××××××××××××.com> |
18 |
Desc: ext4: Fix discard of inode prealloc space with delayed allocation |
19 |
|
20 |
+Patch: 1920_write-sync-regression-fix.patch |
21 |
+From: http://bugs.gentoo.org/show_bug.cgi?id=263870 |
22 |
+Desc: Fix for performance regression when WRITE_SYNC writes and writes submitted without sync flag caused excession idling in IO scheduler |
23 |
+ |
24 |
Patch 2300_ppc-legacymem-anon-memory.patch |
25 |
From: https://bugs.gentoo.org/253149 |
26 |
Desc: Fix launching of X.org on some PPC platforms |
27 |
|
28 |
Added: genpatches-2.6/trunk/2.6.28/1920_write-sync-regression-fix.patch |
29 |
=================================================================== |
30 |
--- genpatches-2.6/trunk/2.6.28/1920_write-sync-regression-fix.patch (rev 0) |
31 |
+++ genpatches-2.6/trunk/2.6.28/1920_write-sync-regression-fix.patch 2009-03-26 16:42:19 UTC (rev 1536) |
32 |
@@ -0,0 +1,68 @@ |
33 |
+From: Jens Axboe <jens.axboe@××××××.com> |
34 |
+Date: Tue, 17 Feb 2009 12:59:08 +0000 (+0100) |
35 |
+Subject: block: revert part of 18ce3751ccd488c78d3827e9f6bf54e6322676fb |
36 |
+X-Git-Tag: v2.6.29-rc6~40^2~2 |
37 |
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=78f707bfc723552e8309b7c38a8d0cc51012e813 |
38 |
+ |
39 |
+block: revert part of 18ce3751ccd488c78d3827e9f6bf54e6322676fb |
40 |
+ |
41 |
+The above commit added WRITE_SYNC and switched various places to using |
42 |
+that for committing writes that will be waited upon immediately after |
43 |
+submission. However, this causes a performance regression with AS and CFQ |
44 |
+for ext3 at least, since sync_dirty_buffer() will submit some writes with |
45 |
+WRITE_SYNC while ext3 has sumitted others dependent writes without the sync |
46 |
+flag set. This causes excessive anticipation/idling in the IO scheduler |
47 |
+because sync and async writes get interleaved, causing a big performance |
48 |
+regression for the below test case (which is meant to simulate sqlite |
49 |
+like behaviour). |
50 |
+ |
51 |
+---- test case ---- |
52 |
+ |
53 |
+int main(int argc, char **argv) |
54 |
+{ |
55 |
+ |
56 |
+ int fdes, i; |
57 |
+ FILE *fp; |
58 |
+ struct timeval start; |
59 |
+ struct timeval end; |
60 |
+ struct timeval res; |
61 |
+ |
62 |
+ gettimeofday(&start, NULL); |
63 |
+ for (i=0; i<ROWS; i++) { |
64 |
+ fp = fopen("test_file", "a"); |
65 |
+ fprintf(fp, "Some Text Data\n"); |
66 |
+ fdes = fileno(fp); |
67 |
+ fsync(fdes); |
68 |
+ fclose(fp); |
69 |
+ } |
70 |
+ gettimeofday(&end, NULL); |
71 |
+ |
72 |
+ timersub(&end, &start, &res); |
73 |
+ fprintf(stdout, "time to write %d lines is %ld(msec)\n", ROWS, |
74 |
+ (res.tv_sec*1000000 + res.tv_usec)/1000); |
75 |
+ |
76 |
+ return 0; |
77 |
+} |
78 |
+ |
79 |
+------------------- |
80 |
+ |
81 |
+Thanks to Sean.White@××××.com for tracking down this performance |
82 |
+regression and providing a test case. |
83 |
+ |
84 |
+Signed-off-by: Jens Axboe <jens.axboe@××××××.com> |
85 |
+--- |
86 |
+ |
87 |
+diff --git a/fs/buffer.c b/fs/buffer.c |
88 |
+index 665d446..62b57e3 100644 |
89 |
+--- a/fs/buffer.c |
90 |
++++ b/fs/buffer.c |
91 |
+@@ -3108,7 +3108,7 @@ int sync_dirty_buffer(struct buffer_head *bh) |
92 |
+ if (test_clear_buffer_dirty(bh)) { |
93 |
+ get_bh(bh); |
94 |
+ bh->b_end_io = end_buffer_write_sync; |
95 |
+- ret = submit_bh(WRITE_SYNC, bh); |
96 |
++ ret = submit_bh(WRITE, bh); |
97 |
+ wait_on_buffer(bh); |
98 |
+ if (buffer_eopnotsupp(bh)) { |
99 |
+ clear_buffer_eopnotsupp(bh); |
100 |
+ |