Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-08-04 Thread Paul E. McKenney
On Sat, Aug 02, 2014 at 07:30:24PM +0200, Oleg Nesterov wrote: > On 07/31, Frederic Weisbecker wrote: > > > > On Thu, Jul 31, 2014 at 08:12:30PM +0200, Oleg Nesterov wrote: > > > > > > > > > > Yes sure. But context_tracking_cpu_set() is called by init task with > > > > > PID 1, not > > > > > by "s

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-08-02 Thread Oleg Nesterov
On 07/31, Frederic Weisbecker wrote: > > On Thu, Jul 31, 2014 at 08:12:30PM +0200, Oleg Nesterov wrote: > > > > > > > > Yes sure. But context_tracking_cpu_set() is called by init task with > > > > PID 1, not > > > > by "swapper". > > > > > > Are you sure? It's called from start_kernel() which is i

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-31 Thread Oleg Nesterov
On 07/31, Frederic Weisbecker wrote: > > 2014-07-31 20:47 GMT+02:00 Frederic Weisbecker : > > On Thu, Jul 31, 2014 at 08:12:30PM +0200, Oleg Nesterov wrote: > >> On 07/31, Frederic Weisbecker wrote: > > No, because preempt_schedule_irq() does the ctx_state save and restore with > > exception_enter/

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-31 Thread Frederic Weisbecker
2014-07-31 20:47 GMT+02:00 Frederic Weisbecker : > On Thu, Jul 31, 2014 at 08:12:30PM +0200, Oleg Nesterov wrote: >> On 07/31, Frederic Weisbecker wrote: > No, because preempt_schedule_irq() does the ctx_state save and restore with > exception_enter/exception_exit. Similar thing happens with sched

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-31 Thread Frederic Weisbecker
On Thu, Jul 31, 2014 at 08:12:30PM +0200, Oleg Nesterov wrote: > On 07/31, Frederic Weisbecker wrote: > > > > On Thu, Jul 31, 2014 at 06:03:53PM +0200, Oleg Nesterov wrote: > > > On 07/31, Frederic Weisbecker wrote: > > > > > > > > I was convinced that the very first kernel init task is PID 0 then

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-31 Thread Oleg Nesterov
On 07/31, Frederic Weisbecker wrote: > > On Thu, Jul 31, 2014 at 06:03:53PM +0200, Oleg Nesterov wrote: > > On 07/31, Frederic Weisbecker wrote: > > > > > > I was convinced that the very first kernel init task is PID 0 then > > > it forks on rest_init() to launch the userspace init with PID 1. Then

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-31 Thread Frederic Weisbecker
On Thu, Jul 31, 2014 at 06:03:53PM +0200, Oleg Nesterov wrote: > On 07/31, Frederic Weisbecker wrote: > > > > On Wed, Jul 30, 2014 at 07:46:30PM +0200, Oleg Nesterov wrote: > > > On 07/30, Frederic Weisbecker wrote: > > > > > > > > On Tue, Jul 29, 2014 at 07:54:14PM +0200, Oleg Nesterov wrote: > >

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-31 Thread Oleg Nesterov
On 07/31, Frederic Weisbecker wrote: > > On Wed, Jul 30, 2014 at 07:46:30PM +0200, Oleg Nesterov wrote: > > On 07/30, Frederic Weisbecker wrote: > > > > > > On Tue, Jul 29, 2014 at 07:54:14PM +0200, Oleg Nesterov wrote: > > > > > > > > > > > Looks like, we can kill context_tracking_task_switch() an

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-30 Thread Frederic Weisbecker
On Wed, Jul 30, 2014 at 07:46:30PM +0200, Oleg Nesterov wrote: > On 07/30, Frederic Weisbecker wrote: > > > > On Tue, Jul 29, 2014 at 07:54:14PM +0200, Oleg Nesterov wrote: > > > > > > > > Looks like, we can kill context_tracking_task_switch() and simply change > > > the > > > "__init" callers of

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-30 Thread Oleg Nesterov
On 07/30, Frederic Weisbecker wrote: > > On Tue, Jul 29, 2014 at 07:54:14PM +0200, Oleg Nesterov wrote: > > > > > Looks like, we can kill context_tracking_task_switch() and simply change the > > "__init" callers of context_tracking_cpu_set() to do > > set_thread_flag(TIF_NOHZ) ? > > Then this flag

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-30 Thread Frederic Weisbecker
On Tue, Jul 29, 2014 at 07:54:14PM +0200, Oleg Nesterov wrote: > Thanks Frederic for your explanations. Yes, I was confused. But cough, now I > am > even more confused. > > I didn't even try to read this code, perhaps I'll try later, but let me ask > another question while you are here ;) > > Th

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-29 Thread Oleg Nesterov
On 07/28, Frederic Weisbecker wrote: > > On Mon, Jul 28, 2014 at 08:58:03PM +0200, Oleg Nesterov wrote: > > > > Frederic, don't we need the patch below? In fact clear_() can be moved > > under "if ()" too. and probably copy_process() should clear this flag... > > > > Or. __context_tracking_task_swi

Re: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-28 Thread Frederic Weisbecker
On Mon, Jul 28, 2014 at 08:58:03PM +0200, Oleg Nesterov wrote: > Off-topic, but... > > On 07/28, Oleg Nesterov wrote: > > > > But we should always call user_exit() unconditionally? > > Frederic, don't we need the patch below? In fact clear_() can be moved > under "if ()" too. and probably copy_pr

TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases)

2014-07-28 Thread Oleg Nesterov
Off-topic, but... On 07/28, Oleg Nesterov wrote: > > But we should always call user_exit() unconditionally? Frederic, don't we need the patch below? In fact clear_() can be moved under "if ()" too. and probably copy_process() should clear this flag... Or. __context_tracking_task_switch() can sim