All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	boris.ostrovsky@oracle.com, keir@xen.org,
	Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v3] x86: correct socket_cpumask allocation
Date: Mon, 13 Jul 2015 11:19:44 +0800	[thread overview]
Message-ID: <20150713031944.GJ3333@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <1436544234.22672.438.camel@citrix.com>

On Fri, Jul 10, 2015 at 06:03:54PM +0200, Dario Faggioli wrote:
> On Fri, 2015-07-10 at 16:25 +0100, Jan Beulich wrote:
> > >>> On 10.07.15 at 17:13, <JBeulich@suse.com> wrote:
> 
> > > cpu_down()
> > >   stop_machine_run(take_cpu_down, ...)
> > >     notifier_call_chain(&cpu_chain, CPU_DYING, ...)
> > >     __cpu_disable()
> > >       remove_siblinginfo()
> > >   __cpu_die()
> > > notifier_call_chain(&cpu_chain, CPU_DEAD, ...)
> > >   cpu_smpboot_free()
> > > 
> > > I.e. a clear use-after-invalidate.
> > 
> > And I can't see a reason why we shouldn't be able to defer invoking
> > remove_siblinginfo() until cpu_smpboot_free(): Other than its
> > counterpart (set_cpu_sibling_map()) it doesn't require to be run on
> > the subject CPU (that function itself doesn't appear to depend on
> > that either, but it depends on identify_cpu() having run). Which
> > would at once allow reducing code: The clearing of
> > cpu_{core,sibling}_mask then becomes redundant with the freeing
> > of these masks.
> > 
> > Of course there may be hidden dependencies, so maybe a safer
> > approach would be to just move the zapping of the three IDs
> > (and maybe the clearing of the CPU's cpu_sibling_setup_map bit)
> > into cpu_smpboot_free().
> > cpu_smpboot_free
> FWIW, I've tried the patch below (call remove_siblinginfo() from
> cpu_smpboot_free()), and it works for me.
> 
> I've tested both shutdown and ACPI S3 suspend.
> 
> I've got to go now, so I guess I'm leaving it to Chao whether to pick it
> up, or go with the other approach Jan suggested (or something else).

I have no problem if Jan agreed and perhaps especially the OSS test can
pass that (as it already looks tricky for this part of code).

I can pick this change and send a patch, with the additional change of
moving "cpumask_clear_cpu(cpu, socket_cpumask[cpu_to_socket(cpu)])"
from remove_siblinginfo() to cpu_smpboot_free().

Chao

  reply	other threads:[~2015-07-13  3:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 14:23 [PATCH v3] x86: correct socket_cpumask allocation Chao Peng
2015-07-09 15:16 ` Andrew Cooper
2015-07-09 15:36   ` Boris Ostrovsky
2015-07-10 14:29 ` Dario Faggioli
2015-07-10 14:47   ` Andrew Cooper
2015-07-10 14:57     ` Dario Faggioli
2015-07-10 15:13       ` Jan Beulich
2015-07-10 15:25         ` Jan Beulich
2015-07-10 16:03           ` Dario Faggioli
2015-07-13  3:19             ` Chao Peng [this message]
2015-07-10 15:33         ` Dario Faggioli

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=20150713031944.GJ3333@pengc-linux.bj.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dario.faggioli@citrix.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.