Re: Interface for enabling context tracking

From: Paul E. McKenney
Date: Thu Apr 10 2025 - 15:10:28 EST


On Thu, Apr 10, 2025 at 01:51:39PM -0500, Junxuan Liao wrote:
> Hi all,
>
> From what I can tell, tracepoints context_tracking:user_enter and
> user_exit might be useful for performance analysis. e.g. Figuring out how
> much time is spent handling page faults or in system calls. However
> context tracking is by default inactive and the only way to enable it is
> to turn on nohz_full for some CPUs.
>
> Is it a good idea to support turning on and off context tracking through
> some interface accessible from the userspace?

There is some in-kernel support for turning the rcu_nocbs portion
of nohz_full on and off on a per-CPU basis, but a given CPU must be
offline in order to do this transition. Last I heard, there are still
issues preventing this support from being generalized to cover all of
the nohz_full functionality, and I doubt that it would be exposed to
user level until all of nohz_full is supported.

The rcu_nocbs in-kernel functionality is tested regularly.

Are you interested in working on joining the noble quest of getting the
rest of the nohz_full support in place? (Full disclosure: This stuff
is non-trivial.)

Thanx, Paul