lkml.org 
[lkml]   [2015]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 6/6] arch, x86: pmem api for ensuring durability of persistent memory updates
On Wed, Jun 17, 2015 at 7:54 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Wed, Jun 17, 2015 at 4:31 AM, Christoph Hellwig <hch@lst.de> wrote:
>> This mess with arch_ methods and an ops vecor is almost unreadable.
>>
>> What's the problem with having something like:
>>
>> pmem_foo()
>> {
>> if (arch_has_pmem) // or sync_pmem
>> arch_pmem_foo();
>> generic_pmem_foo();
>> }
>>
>> This adds a branch at runtime, but that shoudn't really be any slower
>> than an indirect call on architectures that matter.
>
> No doubt it's premature optimization, but it bothered me that we'll
> end up calling cpuid perhaps multiple times every i/o. If it's just a
> readability concern I could wrap it in helpers. Getting it upstream
> is my primary concern at this point so I have no strong attachment to
> the indirect calls if that's all that is preventing an ack.

A cpuid per i/o would be a killer, but the cpufeature code is way
smarter than that.

You want static_cpu_has, though -- it's even faster, since it gets
patched at boot time.

--Andy


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