lkml.org 
[lkml]   [2020]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] memcpy_flushcache: use cache flusing for larger lengths
On Thu, Apr 16, 2020 at 1:24 AM Mikulas Patocka <mpatocka@redhat.com> wrote:
>
>
>
> On Thu, 9 Apr 2020, Mikulas Patocka wrote:
>
> > With dm-writecache on emulated pmem (with the memmap argument), we get
> >
> > With the original kernel:
> > 8508 - 11378
> > real 0m4.960s
> > user 0m0.638s
> > sys 0m4.312s
> >
> > With dm-writecache hacked to use cached writes + clflushopt:
> > 8505 - 11378
> > real 0m4.151s
> > user 0m0.560s
> > sys 0m3.582s
>
> I did some multithreaded tests:
> http://people.redhat.com/~mpatocka/testcases/pmem/microbenchmarks/pmem-multithreaded.txt
>
> And it turns out that for singlethreaded access, write+clwb performs
> better, while for multithreaded access, non-temporal stores perform
> better.
>
> 1 sequential write-nt 8 bytes 1.3 GB/s
> 2 sequential write-nt 8 bytes 2.5 GB/s
> 3 sequential write-nt 8 bytes 2.8 GB/s
> 4 sequential write-nt 8 bytes 2.8 GB/s
> 5 sequential write-nt 8 bytes 2.5 GB/s
>
> 1 sequential write 8 bytes + clwb 1.6 GB/s
> 2 sequential write 8 bytes + clwb 2.4 GB/s
> 3 sequential write 8 bytes + clwb 1.7 GB/s
> 4 sequential write 8 bytes + clwb 1.2 GB/s
> 5 sequential write 8 bytes + clwb 0.8 GB/s
>
> For one thread, we can see that write-nt 8 bytes has 1.3 GB/s and write
> 8+clwb has 1.6 GB/s, but for multiple threads, write-nt has better
> throughput.
>
> The dm-writecache target is singlethreaded (all the copying is done while
> holding the writecache lock), so it benefits from clwb.
>
> Should memcpy_flushcache be changed to write+clwb? Or are there some
> multithreaded users of memcpy_flushcache that would be hurt by this
> change?

Maybe this is asking for a specific memcpy_flushcache_inatomic()
implementation for your use case, but leave nt-writes for the general
case?

\
 
 \ /
  Last update: 2020-04-16 20:29    [W:1.503 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site