lkml.org 
[lkml]   [2015]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 6/6] arch, x86: pmem api for ensuring durability of persistent memory updates
On Wed, 17 Jun 2015, Andy Lutomirski wrote:
> On Thu, Jun 11, 2015 at 2:19 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> > +static inline void arch_sync_pmem(void)
> > +{
> > + wmb();
> > + pcommit_sfence();
> > +}
>
> This function is non-intuitive to me. It's really "arch-specific sync
> pmem after one or more copies using arch_memcpy_to_pmem". If normal
> stores or memcpy to non-WC memory is used instead, then it's
> insufficient if the memory is WB and it's unnecessarily slow if the
> memory is WT or UC (the first sfence isn't needed).
>
> I would change the name and add documentation. I'd also add a comment
> about the wmb() being an SFENCE to flush pending non-temporal writes.

Not "I'd also add ...".

Documentation of memory barriers are mandatory.

Thanks,

tglx


\
 
 \ /
  Last update: 2015-06-17 17:21    [W:0.069 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site