Re: [RFC PATCH v1 13/70] x86, x2apic_cluster: _FROZEN Cleanup

From: Chen, Gong
Date: Wed Jul 30 2014 - 02:55:56 EST


On Wed, Jul 23, 2014 at 10:36:28PM +0200, Borislav Petkov wrote:
> /*
> * At CPU state changes, update the x2apic cluster sibling info.
> */
> @@ -151,9 +166,14 @@ static int
> update_clusterinfo(struct notifier_block *nfb, unsigned long action, void *hcpu)
> {
> unsigned int this_cpu = (unsigned long)hcpu;
> - unsigned int cpu;
> int err = 0;
>
> + if (action & CPU_TASKS_FROZEN) {
> + if ((action & ~CPU_TASKS_FROZEN) == CPU_UP_CANCELED)
> + __update_clusterinfo(this_cpu);
> + return NOTIFY_OK;
> + }
> +
Hi, Boris

Here you assume once the action contains FROZEN flag, it will return
NOTIFY_OK. It looks like not quite comply with original logic. Once
new FROZEN logic is added, we have to update this code again. How
about using following code snippet:

+ if ((action & CPU_TASKS_FROZEN) &&
+ ((action & ~CPU_TASKS_FROZEN) == CPU_UP_CANCELED)) {
+ __update_clusterinfo(this_cpu);
+ return NOTIFY_OK;
+ }
+

Attachment: signature.asc
Description: Digital signature