Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-24 Thread Peter Zijlstra
On Thu, Apr 24, 2014 at 05:41:20PM +, Luck, Tony wrote: > >>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

RE: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-24 Thread Luck, 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. >

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-24 Thread Peter Zijlstra
On Thu, Apr 24, 2014 at 10:59:45AM +0800, Jiang Liu wrote: > 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

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-24 Thread Peter Zijlstra
On Thu, Apr 24, 2014 at 10:59:45AM +0800, Jiang Liu wrote: 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)

RE: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-24 Thread Luck, 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. So the

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-24 Thread Peter Zijlstra
On Thu, Apr 24, 2014 at 05:41:20PM +, Luck, Tony wrote: 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

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-23 Thread Jiang Liu
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)

RE: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-23 Thread Luck, Tony
> > > 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)

RE: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-23 Thread Luck, Tony
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)

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-23 Thread Jiang Liu
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)

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Wed, Apr 23, 2014 at 07:32:13AM +0200, Peter Zijlstra wrote: > On Wed, Apr 23, 2014 at 10:45:13AM +0800, Jiang Liu wrote: > > Hi Peter, > > It's not for memoryless node, but to solve a race window > > in CPU hot-addition. The related CPU hot-addition flow is: > > 1) Handle CPU hot-addition

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Jiang Liu
On 2014/4/23 13:32, Peter Zijlstra wrote: > On Wed, Apr 23, 2014 at 10:45:13AM +0800, Jiang Liu wrote: >> Hi Peter, >> It's not for memoryless node, but to solve a race window >> in CPU hot-addition. The related CPU hot-addition flow is: >> 1) Handle CPU hot-addition event >> 1.a) gather

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Wed, Apr 23, 2014 at 10:45:13AM +0800, Jiang Liu wrote: > Hi Peter, > It's not for memoryless node, but to solve a race window > in CPU hot-addition. The related CPU hot-addition flow is: > 1) Handle CPU hot-addition event > 1.a) gather platform specific information > 1.b) associate

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Jiang Liu
On 2014/4/23 9:59, David Rientjes wrote: > On Tue, 22 Apr 2014, Peter Zijlstra wrote: > >> On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: >>> On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra >>> wrote: >>> On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: >

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Jiang Liu
Hi Peter, It's not for memoryless node, but to solve a race window in CPU hot-addition. The related CPU hot-addition flow is: 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

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Mike Galbraith
On Tue, 2014-04-22 at 22:04 +0200, Peter Zijlstra wrote: > On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: > > On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra > > wrote: > > > > > On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: > > > > When calling

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread David Rientjes
On Tue, 22 Apr 2014, Peter Zijlstra wrote: > On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: > > On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra > > wrote: > > > > > On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: > > > > When calling kzalloc_node(size, flags,

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: > On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra > wrote: > > > On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: > > > When calling kzalloc_node(size, flags, node), we should first check > > > whether node is onlined,

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Andrew Morton
On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra wrote: > On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: > > When calling kzalloc_node(size, flags, node), we should first check > > whether node is onlined, otherwise it may cause invalid memory access > > as below. > > But this is

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: > When calling kzalloc_node(size, flags, node), we should first check > whether node is onlined, otherwise it may cause invalid memory access > as below. But this is only for memory less node crap, right? -- To unsubscribe from this

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: When calling kzalloc_node(size, flags, node), we should first check whether node is onlined, otherwise it may cause invalid memory access as below. But this is only for memory less node crap, right? -- To unsubscribe from this list:

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Andrew Morton
On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra pet...@infradead.org wrote: On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: When calling kzalloc_node(size, flags, node), we should first check whether node is onlined, otherwise it may cause invalid memory access as below.

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra pet...@infradead.org wrote: On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: When calling kzalloc_node(size, flags, node), we should first check whether node is

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread David Rientjes
On Tue, 22 Apr 2014, Peter Zijlstra wrote: On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra pet...@infradead.org wrote: On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: When calling kzalloc_node(size, flags,

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Mike Galbraith
On Tue, 2014-04-22 at 22:04 +0200, Peter Zijlstra wrote: On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra pet...@infradead.org wrote: On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote: When calling

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Jiang Liu
Hi Peter, It's not for memoryless node, but to solve a race window in CPU hot-addition. The related CPU hot-addition flow is: 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

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Jiang Liu
On 2014/4/23 9:59, David Rientjes wrote: On Tue, 22 Apr 2014, Peter Zijlstra wrote: On Tue, Apr 22, 2014 at 01:01:51PM -0700, Andrew Morton wrote: On Tue, 22 Apr 2014 10:15:15 +0200 Peter Zijlstra pet...@infradead.org wrote: On Tue, Apr 22, 2014 at 01:27:15PM +0800, Jiang Liu wrote:

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Wed, Apr 23, 2014 at 10:45:13AM +0800, Jiang Liu wrote: Hi Peter, It's not for memoryless node, but to solve a race window in CPU hot-addition. The related CPU hot-addition flow is: 1) Handle CPU hot-addition event 1.a) gather platform specific information 1.b) associate hot-added

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Jiang Liu
On 2014/4/23 13:32, Peter Zijlstra wrote: On Wed, Apr 23, 2014 at 10:45:13AM +0800, Jiang Liu wrote: Hi Peter, It's not for memoryless node, but to solve a race window in CPU hot-addition. The related CPU hot-addition flow is: 1) Handle CPU hot-addition event 1.a) gather platform

Re: [Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-22 Thread Peter Zijlstra
On Wed, Apr 23, 2014 at 07:32:13AM +0200, Peter Zijlstra wrote: On Wed, Apr 23, 2014 at 10:45:13AM +0800, Jiang Liu wrote: Hi Peter, It's not for memoryless node, but to solve a race window in CPU hot-addition. The related CPU hot-addition flow is: 1) Handle CPU hot-addition event

[Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-21 Thread Jiang Liu
When calling kzalloc_node(size, flags, node), we should first check whether node is onlined, otherwise it may cause invalid memory access as below. [ 3663.324476] BUG: unable to handle kernel paging request at 1f08 [ 3663.332348] IP: [] __alloc_pages_nodemask+0xb9/0x2d0 [ 3663.339719]

[Bugfix] sched: fix possible invalid memory access caused by CPU hot-addition

2014-04-21 Thread Jiang Liu
When calling kzalloc_node(size, flags, node), we should first check whether node is onlined, otherwise it may cause invalid memory access as below. [ 3663.324476] BUG: unable to handle kernel paging request at 1f08 [ 3663.332348] IP: [81172219]