From: Sedat Dilek <sedat.dilek@gmail.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
Samuel Neves <sneves@dei.uc.pt>, Jens Axboe <axboe@kernel.dk>,
Matthew Wilcox <willy@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
linux-fsdevel@vger.kernel.org, x86@kernel.org,
Hugh Dickins <hughd@google.com>
Subject: Re: [RFC] what to do with IOCB_DSYNC?
Date: Sat, 28 May 2022 22:38:25 +0200 [thread overview]
Message-ID: <CA+icZUWf4ww4gXRxnR9P4FTK4ZiAgANQgh+QDK2sAzJx+C4LGQ@mail.gmail.com> (raw)
In-Reply-To: <YpCnMaT823RM3qU5@gmail.com>
On Sat, May 28, 2022 at 9:57 PM Ingo Molnar <mingo@kernel.org> wrote:
>
>
> * Ingo Molnar <mingo@kernel.org> wrote:
>
> >
> > * Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> >
> > > On Mon, May 23, 2022 at 10:03:45AM -0600, Jens Axboe wrote:
> > > > clear_user()
> > > > 32 ~96MB/sec
> > > > 64 195MB/sec
> > > > 128 386MB/sec
> > > > 1k 2.7GB/sec
> > > > 4k 7.8GB/sec
> > > > 16k 14.8GB/sec
> > > >
> > > > copy_from_zero_page()
> > > > 32 ~96MB/sec
> > > > 64 193MB/sec
> > > > 128 383MB/sec
> > > > 1k 2.9GB/sec
> > > > 4k 9.8GB/sec
> > > > 16k 21.8GB/sec
> > >
> > > Just FYI, on x86, Samuel Neves proposed some nice clear_user()
> > > performance improvements that were forgotten about:
> > >
> > > https://lore.kernel.org/lkml/20210523180423.108087-1-sneves@dei.uc.pt/
> > > https://lore.kernel.org/lkml/Yk9yBcj78mpXOOLL@zx2c4.com/
> > >
> > > Hoping somebody picks this up at some point...
> >
> > Those ~2x speedup numbers are indeed looking very nice:
> >
> > | After this patch, on a Skylake CPU, these are the
> > | before/after figures:
> > |
> > | $ dd if=/dev/zero of=/dev/null bs=1024k status=progress
> > | 94402248704 bytes (94 GB, 88 GiB) copied, 6 s, 15.7 GB/s
> > |
> > | $ dd if=/dev/zero of=/dev/null bs=1024k status=progress
> > | 446476320768 bytes (446 GB, 416 GiB) copied, 15 s, 29.8 GB/s
> >
> > Patch fell through the cracks & it doesn't apply anymore:
> >
> > checking file arch/x86/lib/usercopy_64.c
> > Hunk #2 FAILED at 17.
> > 1 out of 2 hunks FAILED
> >
> > Would be nice to re-send it.
>
> Turns out Boris just sent a competing optimization to clear_user() 3 days ago:
>
> https://lore.kernel.org/r/YozQZMyQ0NDdD8cH@zn.tnic
>
> Thanks,
>
[ CC Hugh ]
I hope I adapted both patches from Hugh and Samuel against Linux v5.18
correctly.
As I have no "modern CPU" meaning Intel Sandy-Bridge, the patch of
Hugh was not predestined for me (see numbers).
Samuel's patch gave me 15% of speedup with running Hugh's dd test-case
(cannot say if this is a real benchmark for testing).
Patches and latest linux-config attached.
*** Without patch
root# cat /proc/version
Linux version 5.18.0-3-amd64-clang14-lto (sedat.dilek@gmail.com@iniza)
(dileks clang version 14.0.4 (https://github.com/llvm/llvm-project.git
29f1039a7285a5c3a9c353d05
4140bf2556d4c4d), LLD 14.0.4) #3~bookworm+dileks1 SMP PREEMPT_DYNAMIC 2022-05-27
root# dd if=/dev/zero of=/dev/null bs=1M count=1M
1048576+0 Datensätze ein
1048576+0 Datensätze aus
1099511627776 Bytes (1,1 TB, 1,0 TiB) kopiert, 97,18 s, 11,3 GB/s
*** With hughd patch
Patch: 0001-x86-usercopy-Use-alternatives-for-clear_user.patch
Link: https://lore.kernel.org/lkml/2f5ca5e4-e250-a41c-11fb-a7f4ebc7e1c9@google.com/
root# cat /proc/version
Linux version 5.18.0-4-amd64-clang14-lto (sedat.dilek@gmail.com@iniza)
(dileks clang version 14.0.4 (https://github.com/llvm/llvm-project.git
29f1039a7285a5c3a9c35>
root# dd if=/dev/zero of=/dev/null bs=1M count=1M
1048576+0 Datensätze ein
1048576+0 Datensätze aus
1099511627776 Bytes (1,1 TB, 1,0 TiB) kopiert, 588,053 s, 1,9 GB/s
root# cat /proc/version
Linux version 5.18.0-4-amd64-clang14-lto (sedat.dilek@gmail.com@iniza)
(dileks clang version 14.0.4 (https://github.com/llvm/llvm-project.git
29f1039a7285a5c3a9c353d05
4140bf2556d4c4d), LLD 14.0.4) #4~bookworm+dileks1 SMP PREEMPT_DYNAMIC 2022-05-28
*** With sneves patch
Patch: 0001-x86-usercopy-speed-up-64-bit-__clear_user-with-stos-.patch
Link: https://lore.kernel.org/lkml/20210523180423.108087-1-sneves@dei.uc.pt/
root# cat /proc/version
Linux version 5.18.0-5-amd64-clang14-lto (sedat.dilek@gmail.com@iniza)
(dileks clang version 14.0.4 (https://github.com/llvm/llvm-project.git
29f1039a7285a5c3a9c353d05
4140bf2556d4c4d), LLD 14.0.4) #5~bookworm+dileks1 SMP PREEMPT_DYNAMIC 2022-05-28
root# dd if=/dev/zero of=/dev/null bs=1M count=1M
1048576+0 Datensätze ein
1048576+0 Datensätze aus
1099511627776 Bytes (1,1 TB, 1,0 TiB) kopiert, 82,697 s, 13,3 GB/s
-dileks // 28-May-2022
next prev parent reply other threads:[~2022-05-28 20:39 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 0:46 [RFC] what to do with IOCB_DSYNC? Al Viro
2021-06-21 13:59 ` Christoph Hellwig
2021-06-21 14:03 ` Matthew Wilcox
2021-06-21 14:09 ` Christoph Hellwig
2021-06-21 14:16 ` Matthew Wilcox
2021-06-21 14:22 ` Christoph Hellwig
2021-06-21 14:32 ` Al Viro
2021-06-21 14:35 ` Christoph Hellwig
2021-06-21 15:22 ` Jens Axboe
2022-05-21 17:48 ` Al Viro
2022-05-21 19:03 ` Jens Axboe
2022-05-21 22:14 ` Jens Axboe
2022-05-22 7:45 ` Christoph Hellwig
2022-05-22 10:23 ` Matthew Wilcox
2022-05-22 10:36 ` Al Viro
2022-05-22 11:15 ` Matthew Wilcox
2022-05-22 11:45 ` Christoph Hellwig
2022-05-22 12:39 ` Jens Axboe
2022-05-22 12:48 ` Al Viro
2022-05-22 13:02 ` Jens Axboe
2022-05-22 13:07 ` Al Viro
2022-05-22 13:09 ` Jens Axboe
2022-05-22 18:06 ` Jens Axboe
2022-05-22 18:25 ` Al Viro
2022-05-22 18:29 ` Jens Axboe
2022-05-22 18:39 ` Al Viro
2022-05-22 18:48 ` Jens Axboe
2022-05-22 19:04 ` Al Viro
2022-05-22 20:03 ` Jens Axboe
2022-05-23 0:42 ` Al Viro
2022-05-23 1:22 ` Jens Axboe
2022-05-23 1:28 ` Jens Axboe
2022-05-23 1:50 ` Jens Axboe
2022-05-23 2:43 ` Jens Axboe
2022-05-23 14:22 ` Al Viro
2022-05-23 14:34 ` Jens Axboe
2022-05-23 14:47 ` Al Viro
2022-05-23 15:12 ` Jens Axboe
2022-05-23 15:44 ` Jens Axboe
2022-05-23 15:49 ` Matthew Wilcox
2022-05-23 15:55 ` Jens Axboe
2022-05-23 16:03 ` Jens Axboe
2022-05-26 14:46 ` Jason A. Donenfeld
2022-05-27 10:09 ` Ingo Molnar
2022-05-27 10:15 ` Jason A. Donenfeld
2022-05-27 14:45 ` Samuel Neves
2022-05-27 10:25 ` Ingo Molnar
2022-05-27 10:36 ` Borislav Petkov
2022-05-28 20:54 ` Sedat Dilek
2022-05-28 20:38 ` Sedat Dilek [this message]
2022-05-28 20:39 ` Sedat Dilek
2022-05-23 16:15 ` Al Viro
2022-05-25 14:34 ` Matthew Wilcox
2022-05-26 23:19 ` Al Viro
2022-05-27 14:51 ` Jens Axboe
2022-05-22 12:21 ` Al Viro
2022-05-22 7:43 ` Christoph Hellwig
2022-05-22 12:41 ` Al Viro
2022-05-22 12:51 ` Christoph Hellwig
2021-06-21 14:22 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+icZUWf4ww4gXRxnR9P4FTK4ZiAgANQgh+QDK2sAzJx+C4LGQ@mail.gmail.com \
--to=sedat.dilek@gmail.com \
--cc=Jason@zx2c4.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=hughd@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=sneves@dei.uc.pt \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).