Re: [PATCH] sched/core: remove get_cpu() from sched_fork()

2018-07-09 Thread Peter Zijlstra
On Fri, Jul 06, 2018 at 03:32:00PM +0200, Sebastian Andrzej Siewior wrote: > On 2018-07-06 15:18:08 [+0200], Peter Zijlstra wrote: > > On Fri, Jul 06, 2018 at 03:06:15PM +0200, Sebastian Andrzej Siewior wrote: > > > Based on this it is possible to remove get_cpu() and use > > > smp_processor_id() f

Re: [PATCH] sched/core: remove get_cpu() from sched_fork()

2018-07-06 Thread Sebastian Andrzej Siewior
On 2018-07-06 15:18:08 [+0200], Peter Zijlstra wrote: > On Fri, Jul 06, 2018 at 03:06:15PM +0200, Sebastian Andrzej Siewior wrote: > > Based on this it is possible to remove get_cpu() and use > > smp_processor_id() for the `cpu' variable without breaking anything. > > Almost.. I think, see init_ta

Re: [PATCH] sched/core: remove get_cpu() from sched_fork()

2018-07-06 Thread Peter Zijlstra
On Fri, Jul 06, 2018 at 03:06:15PM +0200, Sebastian Andrzej Siewior wrote: > Based on this it is possible to remove get_cpu() and use > smp_processor_id() for the `cpu' variable without breaking anything. Almost.. I think, see init_task_preempt_count().

[PATCH] sched/core: remove get_cpu() from sched_fork()

2018-07-06 Thread Sebastian Andrzej Siewior
get_cpu() disables preemption for the entire sched_fork() function. This get_cpu() was introduced in commit dd41f596cda0 ("sched: cfs core code") which also invoked sched_balance_self() and this function required preemption do be off. Today, sched_balance_self() seems to be moved to ->task_fork cal