lkml.org 
[lkml]   [2012]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/2] x86: Track minimum microcode revision globally v2
    On Wed, Jun 13, 2012 at 10:49:52AM +0200, Peter Zijlstra wrote:
    > On Tue, 2012-06-12 at 14:25 -0700, Andi Kleen wrote:
    > > +void update_min_microcode(struct cpuinfo_x86 *c)
    > > +{
    > > + int i;
    > > +
    > > + for_each_online_cpu (i)
    >
    > Superfluous whitespace
    >
    > > + if (cpu_data(i).microcode < c->microcode)
    > > + return;
    >
    > That needs {}

    You must be following a different code style guide than the Linux one.


    > > c->microcode = val[1];
    > >
    > > + update_min_microcode(c);
    > > return 0;
    > > }
    >
    > Doing it here means doing the for_each_cpu thing with preempt/irqs
    > disabled, that's not funny.

    Well a ucode update is a really slow operation anyways. And the loop
    gets stopped at the first mismatch. So it'll never be n^2 and in most
    cases much faster. Generally the loop should be several orders
    of magnitude less than the actual cost of the update, even on large
    systems.

    > Also this is still a O(n^2) proposition.. so how is this better than the
    > notifier thing I had?

    Simpler at least.

    I don't know why people love notifiers, they are a "COME FROM" and make
    every code who uses them a mess.

    As for CPU_STARTING don't know how complicated it would be. I suppose
    it could be done as a follow up.

    -Andi

    --
    ak@linux.intel.com -- Speaking for myself only


    \
     
     \ /
      Last update: 2012-06-13 17:21    [W:0.031 / U:0.656 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site