mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: msb@chromium.org, mingo@kernel.org, linux-kernel@vger.kernel.org,
	shaohua.li@intel.com, yinghai@kernel.org, tglx@linutronix.de,
	hpa@zytor.com, x86@kernel.org, tj@kernel.org,
	akpm@linux-foundation.org, sfr@canb.auug.org.au, cl@gentwo.org,
	olofj@chromium.org, paulmck@linux.vnet.ibm.com,
	Alex Shi <alex.shi@intel.com>,
	Conny Seidel <conny.seidel@amd.com>
Subject: Re: [PATCH] x86, mm: Send tlb flush IPIs to online cpus only
Date: Thu, 19 Jul 2012 15:32:29 +0200	[thread overview]
Message-ID: <20120719133229.GB10073@x1.osrc.amd.com> (raw)
In-Reply-To: <20120719125643.30033.58913.stgit@srivatsabhat.in.ibm.com>

On Thu, Jul 19, 2012 at 06:27:33PM +0530, Srivatsa S. Bhat wrote:

[ … ]
 
> So we are sending an IPI to a cpu which is now offline. Once a cpu is offline,
> it will no longer respond to IPIs. This explains the softlockup.
> 
> A cpu in the mm_cpumask could go offline before we send the invalidate
> IPI causing us to wait forever. Avoid this by sending the IPI to only the
> online cpus.
> 
> [Since flush_tlb_others_ipi() is always called with preempt disabled, it is
> not possible for a CPU to go offline once we enter this function, because
> CPU offline goes through the stop_machine() stuff (which cannot proceed until
> all preempt disabled sections are exited). So we don't have to worry about
> any race between CPU offline and the target cpumask calculation in
> flush_tlb_others_ipi().]
> 
> Addresses http://crosbug.com/31737
> 
> Reported-and-debugged-by: Mandeep Singh Baines <msb@chromium.org>
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
> Acked-by: Mandeep Singh Baines <msb@chromium.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: Christoph Lameter <cl@gentwo.org>
> Cc: Olof Johansson <olofj@chromium.org>
> ---
> 
>  arch/x86/mm/tlb.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
> index 5e57e11..9d387a9 100644
> --- a/arch/x86/mm/tlb.c
> +++ b/arch/x86/mm/tlb.c
> @@ -186,7 +186,11 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
>  
>  	f->flush_mm = mm;
>  	f->flush_va = va;
> -	if (cpumask_andnot(to_cpumask(f->flush_cpumask), cpumask, cpumask_of(smp_processor_id()))) {
> +
> +	cpumask_and(to_cpumask(f->flush_cpumask), cpumask, cpu_online_mask);
> +	cpumask_clear_cpu(smp_processor_id(), to_cpumask(f->flush_cpumask));
> +
> +	if (!cpumask_empty(to_cpumask(f->flush_cpumask))) {

FWIW, there's code in tip/x86/mm which reworks all that and
flush_tlb_others_ipi along with the 32 TLB flush vectors are being
removed in favor of a smp_call_function_many thing. And it should be
hotplug-safe since it must be called with preemption disabled anyway.

-- 
Regards/Gruss,
Boris.

  reply	other threads:[~2012-07-19 13:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 12:57 Srivatsa S. Bhat
2012-07-19 13:32 ` Borislav Petkov [this message]
2012-07-19 13:35   ` Srivatsa S. Bhat
2012-07-19 13:39     ` Borislav Petkov

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=20120719133229.GB10073@x1.osrc.amd.com \
    --to=bp@alien8.de \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@intel.com \
    --cc=cl@gentwo.org \
    --cc=conny.seidel@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=msb@chromium.org \
    --cc=olofj@chromium.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=shaohua.li@intel.com \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    --cc=yinghai@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

Powered by JetHome