context_tracking: Exempt CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK from non-active tracking

Since a CPU may save the state of the context tracking using
exception_enter() before calling into schedule(), we need all CPUs in
the system to track user <-> kernel transitions and not just those that
really need it (nohz_full CPUs).

The following illustrates the issue that could otherwise happen:

     CPU 0 (not tracking)                       CPU 1 (tracking)
     -------------------                       --------------------
     // we are past user_enter()
     // but this CPU is always in
     // CONTEXT_KERNEL
     // because it doesn't track user <-> kernel

     ctx = exception_enter(); //ctx == CONTEXT_KERNEL
     schedule();
     ===========================================>
                                               return from schedule();
                                               exception_exit(ctx);
                                               //go to user in CONTEXT_KERNEL

However CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK doesn't play those
games because schedule() can't be called between user_enter() and
user_exit() under such config. In this situation we can spare context
tracking on the CPUs that don't need it.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Cc: Uladzislau Rezki <uladzislau.rezki@sony.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: Yu Liao<liaoyu15@huawei.com>
Cc: Phil Auld <pauld@redhat.com>
Cc: Paul Gortmaker<paul.gortmaker@windriver.com>
Cc: Alex Belits <abelits@marvell.com>
1 file changed