lkml.org 
[lkml]   [2014]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] x86: Add cpu_detect_cache_sizes() to init_intel(), add Quark to legacy_cache()
On 06/10/14 10:55, Thomas Gleixner wrote:
>> + */
>> + if (c->x86_cache_size == 0)
>> + l2 = init_intel_cacheinfo(c);
>> + else
>> + l2 = c->x86_cache_size;
>
> Looking a bit deeper. This wont work because cpu_detect_cache_sizes()
> will set c->x86_cache_size for all cpus with extended_cpuid_level >=
> 0x80000005, which is the case for everything modern. So this results
> in init_intel_cacheinfo() not being called anymore.

True.

Missed that one.

> So we might need the following conditional:
>
> l2 = init_intel_cacheinfo(c);
> + if (!c->x86_cache_size) {
> + cpu_detect_cache_sizes(c);
> + l2 = c->x86_cache_size;
> + }

Yes - that'll work better.

Also - it only forces a conditional branch - so fewer extra cycles for
everybody !Quark and !Tualatin - which is preferential. Will incorporate.


Best,
Bryan


\
 
 \ /
  Last update: 2014-10-06 12:41    [W:0.031 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site