]> git.baikalelectronics.ru Git - kernel.git/commit
x86: fix performance regression in write() syscall
authorSalman Qazi <sqazi@google.com>
Tue, 24 Feb 2009 02:03:04 +0000 (18:03 -0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 24 Feb 2009 16:16:36 +0000 (17:16 +0100)
commitd3c70074e98ef99fe0442697fbb952d0b4e4c3f7
treebc17d39779914b4dcf7a7d7b9e08d8b020cbf0b6
parent0669726a0f1355138736ed0badc6850817eaad1a
x86: fix performance regression in write() syscall

While the introduction of __copy_from_user_nocache (see commit:
f0c76e137c334efdd0c70f84aa47d25a687ff472) may have been an improvement
for sufficiently large writes, there is evidence to show that it is
deterimental for small writes.  Unixbench's fstime test gives the
following results for 256 byte writes with MAX_BLOCK of 2000:

    2.6.29-rc6 ( 5 samples, each in KB/sec ):
    283750, 295200, 294500, 293000, 293300

    2.6.29-rc6 + this patch (5 samples, each in KB/sec):
    313050, 3106750, 293350, 306300, 307900

    2.6.18
    395700, 342000, 399100, 366050, 359850

    See w_test() in src/fstime.c in unixbench version 4.1.0.  Basically, the above test
    consists of counting how much we can write in this manner:

    alarm(10);
    while (!sigalarm) {
            for (f_blocks = 0; f_blocks < 2000; ++f_blocks) {
                   write(f, buf, 256);
            }
            lseek(f, 0L, 0);
    }

Note, there are other components to the write syscall regression
that are not addressed here.

Signed-off-by: Salman Qazi <sqazi@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/uaccess_64.h