Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
On Tue, Jan 3, 2017 at 5:59 PM, Al Viro wrote: > On Tue, Jan 03, 2017 at 05:38:54PM -0800, Dan Williams wrote: >> > 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() >> > having only used movnt; it does not attempt clwb at all. >> >> Yes, and there was

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
On Tue, Jan 3, 2017 at 5:59 PM, Al Viro wrote: > On Tue, Jan 03, 2017 at 05:38:54PM -0800, Dan Williams wrote: >> > 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() >> > having only used movnt; it does not attempt clwb at all. >> >> Yes, and there was a fix a while back to

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Al Viro
On Tue, Jan 03, 2017 at 05:38:54PM -0800, Dan Williams wrote: > > 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() > > having only used movnt; it does not attempt clwb at all. > > Yes, and there was a fix a while back to make sure it always used > movnt so clwb after the fact

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Al Viro
On Tue, Jan 03, 2017 at 05:38:54PM -0800, Dan Williams wrote: > > 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() > > having only used movnt; it does not attempt clwb at all. > > Yes, and there was a fix a while back to make sure it always used > movnt so clwb after the fact

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
On Tue, Jan 3, 2017 at 3:22 PM, Al Viro wrote: > On Tue, Jan 03, 2017 at 01:14:11PM -0800, Dan Williams wrote: > >> Robert was describing the overall flow / mechanics, but I think it is >> easier to visualize the sfence as a flush command sent to a disk >> device with a

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
On Tue, Jan 3, 2017 at 3:22 PM, Al Viro wrote: > On Tue, Jan 03, 2017 at 01:14:11PM -0800, Dan Williams wrote: > >> Robert was describing the overall flow / mechanics, but I think it is >> easier to visualize the sfence as a flush command sent to a disk >> device with a volatile cache. In fact,

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
On Tue, Jan 3, 2017 at 3:46 PM, Linus Torvalds wrote: > On Tue, Jan 3, 2017 at 3:22 PM, Al Viro wrote: >> >> 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() >> having only used movnt; it does not attempt clwb at all.

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
On Tue, Jan 3, 2017 at 3:46 PM, Linus Torvalds wrote: > On Tue, Jan 3, 2017 at 3:22 PM, Al Viro wrote: >> >> 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() >> having only used movnt; it does not attempt clwb at all. >> >> 2) __copy_from_user_nocache() for short copies does

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Linus Torvalds
On Tue, Jan 3, 2017 at 3:22 PM, Al Viro wrote: > > 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() > having only used movnt; it does not attempt clwb at all. > > 2) __copy_from_user_nocache() for short copies does not use movnt at all. > In that case

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Linus Torvalds
On Tue, Jan 3, 2017 at 3:22 PM, Al Viro wrote: > > 1) memcpy_to_pmem() seems to rely upon the __copy_from_user_nocache() > having only used movnt; it does not attempt clwb at all. > > 2) __copy_from_user_nocache() for short copies does not use movnt at all. > In that case neither sfence nor clwb

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Al Viro
On Tue, Jan 03, 2017 at 01:14:11PM -0800, Dan Williams wrote: > Robert was describing the overall flow / mechanics, but I think it is > easier to visualize the sfence as a flush command sent to a disk > device with a volatile cache. In fact, that's how we implemented it in > the pmem block device

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Al Viro
On Tue, Jan 03, 2017 at 01:14:11PM -0800, Dan Williams wrote: > Robert was describing the overall flow / mechanics, but I think it is > easier to visualize the sfence as a flush command sent to a disk > device with a volatile cache. In fact, that's how we implemented it in > the pmem block device

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
el- >> > ow...@vger.kernel.org] On Behalf Of Al Viro >> > Sent: Friday, December 30, 2016 8:26 PM >> > Subject: [RFC] memcpy_nocache() and memcpy_writethrough() >> > >> ... >> > Why does pmem need writethrough warranties, anyway? >> >> U

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-03 Thread Dan Williams
g] On Behalf Of Al Viro >> > Sent: Friday, December 30, 2016 8:26 PM >> > Subject: [RFC] memcpy_nocache() and memcpy_writethrough() >> > >> ... >> > Why does pmem need writethrough warranties, anyway? >> >> Using either >> * nontemporal st

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-01 Thread Al Viro
:26 PM > > Subject: [RFC] memcpy_nocache() and memcpy_writethrough() > > > ... > > Why does pmem need writethrough warranties, anyway? > > Using either > * nontemporal store instructions; or > * following regular store instructions with a sequence of cache flush

Re: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-01 Thread Al Viro
:26 PM > > Subject: [RFC] memcpy_nocache() and memcpy_writethrough() > > > ... > > Why does pmem need writethrough warranties, anyway? > > Using either > * nontemporal store instructions; or > * following regular store instructions with a sequence of cache flush

RE: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-01 Thread Elliott, Robert (Persistent Memory)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- > ow...@vger.kernel.org] On Behalf Of Al Viro > Sent: Friday, December 30, 2016 8:26 PM > Subject: [RFC] memcpy_nocache() and memcpy_writethrough() > ... > Why does pmem need wr

RE: [RFC] memcpy_nocache() and memcpy_writethrough()

2017-01-01 Thread Elliott, Robert (Persistent Memory)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- > ow...@vger.kernel.org] On Behalf Of Al Viro > Sent: Friday, December 30, 2016 8:26 PM > Subject: [RFC] memcpy_nocache() and memcpy_writethrough() > ... > Why does pmem need wr

[RFC] memcpy_nocache() and memcpy_writethrough()

2016-12-30 Thread Al Viro
On Thu, Dec 29, 2016 at 08:56:13PM -0800, Dan Williams wrote: > > Um... Then we do have a problem - nocache variant of uaccess primitives > > does *not* guarantee that clwb is redundant. > > > > What about the requirements of e.g. tcp_sendmsg() with its use of > > skb_add_data_nocache()? What

[RFC] memcpy_nocache() and memcpy_writethrough()

2016-12-30 Thread Al Viro
On Thu, Dec 29, 2016 at 08:56:13PM -0800, Dan Williams wrote: > > Um... Then we do have a problem - nocache variant of uaccess primitives > > does *not* guarantee that clwb is redundant. > > > > What about the requirements of e.g. tcp_sendmsg() with its use of > > skb_add_data_nocache()? What