block: revert part of 18ce3751ccd488c78d3827e9f6bf54e6322676fb
authorJens Axboe <jens.axboe@oracle.com>
Tue, 17 Feb 2009 12:59:08 +0000 (13:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:24:38 +0000 (10:24 -0700)
commitca66c0da0992f6bc96c80d10b446b57849669663
tree89999c997221b48aea852eb629f42a5406fd07f4
parente2627e220fe64f2a7e501b512719e7b7be73466b
block: revert part of 18ce3751ccd488c78d3827e9f6bf54e6322676fb

commit 78f707bfc723552e8309b7c38a8d0cc51012e813 upstream.

The above commit added WRITE_SYNC and switched various places to using
that for committing writes that will be waited upon immediately after
submission. However, this causes a performance regression with AS and CFQ
for ext3 at least, since sync_dirty_buffer() will submit some writes with
WRITE_SYNC while ext3 has sumitted others dependent writes without the sync
flag set. This causes excessive anticipation/idling in the IO scheduler
because sync and async writes get interleaved, causing a big performance
regression for the below test case (which is meant to simulate sqlite
like behaviour).

---- test case ----

int main(int argc, char **argv)
{

int fdes, i;
FILE *fp;
struct timeval start;
struct timeval end;
struct timeval res;

gettimeofday(&start, NULL);
for (i=0; i<ROWS; i++) {
fp = fopen("test_file", "a");
fprintf(fp, "Some Text Data\n");
fdes = fileno(fp);
fsync(fdes);
fclose(fp);
}
gettimeofday(&end, NULL);

timersub(&end, &start, &res);
fprintf(stdout, "time to write %d lines is %ld(msec)\n", ROWS,
(res.tv_sec*1000000 + res.tv_usec)/1000);

return 0;
}

-------------------

Thanks to Sean.White@APCC.com for tracking down this performance
regression and providing a test case.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/buffer.c