[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120613144907.GA32604@tassilo.jf.intel.com>
Date: Wed, 13 Jun 2012 07:49:07 -0700
From: Andi Kleen <ak@...ux.intel.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Andi Kleen <andi@...stfloor.org>, x86@...nel.org, hpa@...or.com,
eranian@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [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@...ux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists