From: Jiang Liu <jiang.liu@linux.intel.com>
To: "Luck, Tony" <tony.luck@intel.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>, Ingo Molnar <mingo@redhat.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition
Date: Thu, 24 Apr 2014 10:59:45 +0800 [thread overview]
Message-ID: <53587E21.5070507@linux.intel.com> (raw)
In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F327EB605@ORSMSX114.amr.corp.intel.com>
On 2014/4/24 1:46, Luck, Tony wrote:
>>>> 1) Handle CPU hot-addition event
>>>> 1.a) gather platform specific information
>>>> 1.b) associate hot-added CPU with a node
>>>> 1.c) create CPU device
>>>> 2) User online hot-added CPUs through sysfs:
>>>> 2.a) cpu_up()
>>>> 2.b) ->try_online_node()
>>>> 2.c) ->hotadd_new_pgdat()
>>>> 2.d) ->node_set_online()
>>>>
>>>> So between 1.b and 2.c, kmalloc_node(nid) may cause invalid
>>>> memory access without the node_online(nid) check.
>>>
>>> Any why was all this not in the Changelog?
>>
>> Also, do explain what kind of hardware you needed to trigger this. This
>> code has been like this for a good while.
>
> With your proposed fix in place the allocations will succeed - but they
> will be done from other nodes ... and this cpu will have to do a remote
> NUMA access for the rest of time.
>
> It would be better to switch the order above - add the memory first,
> then add the cpus. Is that possible?
Hi Tony,
The BIOS always sends CPU hot-addition events before memory
hot-addition events, so it's hard to change the order.
And we couldn't completely solve this performance penalty because the
affected code tries to allocate memory for all possible
CPUs instead of onlined CPUs.
Best Regards!
Gerry
next prev parent reply other threads:[~2014-04-24 3:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 5:27 [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition Jiang Liu
2014-04-22 8:15 ` Peter Zijlstra
2014-04-22 20:01 ` Andrew Morton
2014-04-22 20:04 ` Peter Zijlstra
2014-04-23 1:59 ` David Rientjes
2014-04-23 4:53 ` Jiang Liu
2014-04-23 2:05 ` Mike Galbraith
2014-04-23 2:45 ` Jiang Liu
2014-04-23 5:32 ` Peter Zijlstra
2014-04-23 5:45 ` Jiang Liu
2014-04-23 5:51 ` Peter Zijlstra
2014-04-23 17:46 ` Luck, Tony
2014-04-24 2:59 ` Jiang Liu [this message]
2014-04-24 7:47 ` Peter Zijlstra
2014-04-24 17:41 ` Luck, Tony
2014-04-24 19:09 ` Peter Zijlstra
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=53587E21.5070507@linux.intel.com \
--to=jiang.liu@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tony.luck@intel.com \
/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