lkml.org 
[lkml]   [2014]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/5] x86: initialize secondary CPU only if master CPU will wait for it

* Igor Mammedov <imammedo@redhat.com> wrote:

> /*
> + * wait for ACK from master CPU before continuing
> + * with AP initialization
> + */
> + cpumask_set_cpu(cpu, cpu_initialized_mask);
> + while (!cpumask_test_cpu(cpu, cpu_callout_mask))
> + cpu_relax();

> + /*
> + * wait for ACK from master CPU before continuing
> + * with AP initialization
> + */
> + cpumask_set_cpu(cpu, cpu_initialized_mask);
> + while (!cpumask_test_cpu(cpu, cpu_callout_mask))
> + cpu_relax();

That repetitive pattern could be stuck into a properly named helper
inline function.

(Also, before the cpumask_set_cpu() we should probably do a WARN_ON()
if the bit is already set.)

Thanks,

Ingo


\
 
 \ /
  Last update: 2014-04-14 11:41    [W:1.399 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site