Re: [PATCH v4] context_tracking: Add comments on interface and internals

Andrew Morton
2013-01-16T22:06:52Z

On Wed, 16 Jan 2013 16:49:21 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 2013-01-16 at 13:18 -0800, Andrew Morton wrote:
> > On Wed, 16 Jan 2013 17:16:37 +0100
>
> > I still don't understand NOHZ's role in this whole thing :(
>
> It's not for idle NOHZ, but "process" NOHZ.
>
> That is if we have only one task running on a CPU, we don't want a tick
> interrupt to bother it. This is because there's lots of users out there
> that want an uninterrupted task. A task that doesn't ever get bothered
> by the kernel. If it's in userspace, it stays in userspace (no
> interrupts), until it calls into the kernel itself (syscall). Even when
> its in the kernel, we still don't need the tick interrupt if its the
> only task.

oh, is that what TIF_NOHZ does ;)

> But the scheduler isn't the only thing that uses this tick. To remove
> the tick, we need to satisfy all the other users (printk, delayed work,
> u/s-times).
>
> To still keep up the stats of user and kernel times for the task, we
> need to record when the task switches from user to kernel and back
> again. Hence the context tracking code.
>
> Makes more sense?

yup thanks.