mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Milton Miller <miltonm@bga.com>,
	x86@kernel.org, Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] x86: drop false warning of empty cpumask in IPI
Date: Fri, 17 Feb 2012 13:01:46 +0100	[thread overview]
Message-ID: <20120217120146.GB25601@elte.hu> (raw)
In-Reply-To: <1329298204-5026-1-git-send-email-gilad@benyossef.com>


* Gilad Ben-Yossef <gilad@benyossef.com> wrote:

> With current generic SMP infrastructure, it is feasible
> for the target CPUs to begin processing an IPI work item
> even before we sent them the actual IPI in the case that
> an IPI from another CPU woke them first.
> 
> This can lead to generating a false warning in a valid
> state of trying to send IPI with an empty cpumask when
> multiple concurrent IPIs are being sent.
> 
> This patch was triggered by the following LKML discussion:
> https://lkml.org/lkml/2012/1/13/308
> 
> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
> CC: Thomas Gleixner <tglx@linutronix.de>
> CC: Ingo Molnar <mingo@redhat.com>
> CC: "H. Peter Anvin" <hpa@zytor.com>
> CC: Milton Miller <miltonm@bga.com>
> CC: x86@kernel.org
> ---
>  arch/x86/kernel/apic/ipi.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c
> index cce91bf..00b68a3 100644
> --- a/arch/x86/kernel/apic/ipi.c
> +++ b/arch/x86/kernel/apic/ipi.c
> @@ -106,7 +106,10 @@ void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector)
>  	unsigned long mask = cpumask_bits(cpumask)[0];
>  	unsigned long flags;
>  
> -	if (WARN_ONCE(!mask, "empty IPI mask"))
> +	if (!mask)
> +		/* The target CPUs must have already processed the
> +		 * work items due to a concurrent IPI
> +		 */
>  		return;

This could potentially hide real bugs on other callsites.

So why not do the checking at the call site? In almost every 
other scenario it's invalid to send an empty mask.

Thanks,

	Ingo

  reply	other threads:[~2012-02-17 12:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15  9:30 Gilad Ben-Yossef
2012-02-17 12:01 ` Ingo Molnar [this message]
2012-02-19  8:13   ` Gilad Ben-Yossef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120217120146.GB25601@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=gilad@benyossef.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miltonm@bga.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®