[Top] [All Lists]

Re: [PATCH] smp.h: Use local_irq_{save,restore}() in !SMP version of on_

To: David Daney <>
Subject: Re: [PATCH] smp.h: Use local_irq_{save,restore}() in !SMP version of on_each_cpu().
From: Linus Torvalds <>
Date: Thu, 13 Jun 2013 22:46:02 -0700
Cc: Ralf Baechle <>, Andrew Morton <>, linux-mips <>, Linux Kernel Mailing List <>, David Daney <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Zu1tN0sLAb4AW4SwAvXRfThnUiF+DiqzsxML8l5Nr2k=; b=rg6u53OwieZnb4CGnTkLObgRNyjWAx/LTQh220HLWAHgRftw2Rl5F1dvQtqPUEi0X9 SW6RK3IwZNaRpuJ9xLAfFhllU9nykSfweTQlAzuOP9fK3mPTN5pnIaO6FGsNCOtmTmMW 7qotvKeXMuJiWWR3b9R+I+iKLpzPoE2s2FZks/G71IPFZMmST9Aja1i9GcEJgAnJD5Lf k8TALNCYBIVz/5pLd5k+YwvRMiR0rOrKFV0SO+evJDuxxCZWPvg2xDfrLQmK4Am80FTT oQ5xur14FnUcJhbYjKY+7ddbKBgRL1dE/CAyo5ffCE2Q6trNBu0RkEru9yD+q+AAC7M/ fUCg==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Zu1tN0sLAb4AW4SwAvXRfThnUiF+DiqzsxML8l5Nr2k=; b=Jn9IzOzx/j87ZcA/BO4P0UBrmWIg5Ce9T2KdU4BHEtRBOMj2WtRDdEUTU4qBgqx80f fa1Uxd44eVXYdRJv49bem37cBtXWZP/th4a7KVqstm7qxqidCipGq/jjdK5yg1KQZAC3 kufEZL7VqPigXfNqe/IzwwNbKwyW2OS6wYeos=
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <>
On Thu, Jun 13, 2013 at 6:07 PM, David Daney <> wrote:
> Suggested fix: Do what we already do in the SMP version of
> on_each_cpu(), and use local_irq_save/local_irq_restore.

I was going to apply this, but started looking a bit more.

Using "flags" as a variable name inside a macro like this is a
*really* bad idea.

Lookie here:

    [torvalds@pixel linux]$ git grep on_each_cpu.*flags
    arch/s390/kernel/perf_cpum_cf.c:        on_each_cpu(setup_pmc_cpu,
&flags, 1);
    arch/s390/kernel/perf_cpum_cf.c:        on_each_cpu(setup_pmc_cpu,
&flags, 1);

and ask yourself what happens when the "info" argument expands to
"&flags", and it all compiles perfectly fine, but the "&flags" takes
the address of the new _inner_ variable called "flags" from the macro
expansion. Not the one that the caller actually intends..


Not a good idea.

So I would suggest trivially renaming "flags" as "__flags" or
something, or perhaps even just making it a real function and avoiding
the whole namespace issue.

And rather than doing that blindly by editing the patch at after -rc5,
I'm just going to ask you to re-send a tested patch. Ok?


<Prev in Thread] Current Thread [Next in Thread>