[PATCH 00/20] rcu/context-tracking: Merge RCU eqs-dynticks counter to context tracking v5

Frederic Weisbecker posted 20 patches 3 years, 10 months ago
.../RCU/Design/Requirements/Requirements.rst       |  10 +-
Documentation/RCU/stallwarn.rst                    |   6 +-
.../time/context-tracking/arch-support.txt         |   6 +-
MAINTAINERS                                        |   1 +
arch/Kconfig                                       |   8 +-
arch/arm/Kconfig                                   |   2 +-
arch/arm/kernel/entry-common.S                     |   4 +-
arch/arm/kernel/entry-header.S                     |  12 +-
arch/arm/mach-imx/cpuidle-imx6q.c                  |   5 +-
arch/arm64/Kconfig                                 |   2 +-
arch/arm64/kernel/entry-common.c                   |  14 +-
arch/csky/Kconfig                                  |   2 +-
arch/csky/kernel/entry.S                           |   8 +-
arch/loongarch/Kconfig                             |   2 +-
arch/mips/Kconfig                                  |   2 +-
arch/powerpc/Kconfig                               |   2 +-
arch/powerpc/include/asm/context_tracking.h        |   2 +-
arch/riscv/Kconfig                                 |   2 +-
arch/riscv/kernel/entry.S                          |  12 +-
arch/sparc/Kconfig                                 |   2 +-
arch/sparc/kernel/rtrap_64.S                       |   2 +-
arch/x86/Kconfig                                   |   4 +-
arch/x86/mm/fault.c                                |   2 +-
arch/xtensa/Kconfig                                |   2 +-
arch/xtensa/kernel/entry.S                         |   8 +-
drivers/acpi/processor_idle.c                      |   5 +-
drivers/cpuidle/cpuidle-psci.c                     |   8 +-
drivers/cpuidle/cpuidle-riscv-sbi.c                |   8 +-
drivers/cpuidle/cpuidle.c                          |   9 +-
include/linux/context_tracking.h                   |  95 ++--
include/linux/context_tracking_irq.h               |  21 +
include/linux/context_tracking_state.h             | 113 +++-
include/linux/entry-common.h                       |  10 +-
include/linux/hardirq.h                            |  12 +-
include/linux/rcupdate.h                           |  17 +-
include/linux/rcutiny.h                            |   6 -
include/linux/rcutree.h                            |   9 +-
include/linux/tracepoint.h                         |   4 +-
init/Kconfig                                       |   4 +-
kernel/cfi.c                                       |   4 +-
kernel/context_tracking.c                          | 617 +++++++++++++++++++--
kernel/cpu_pm.c                                    |   8 +-
kernel/entry/common.c                              |  16 +-
kernel/extable.c                                   |   4 +-
kernel/locking/lockdep.c                           |   2 +-
kernel/rcu/Kconfig                                 |   2 +
kernel/rcu/rcu.h                                   |   4 -
kernel/rcu/tree.c                                  | 476 +---------------
kernel/rcu/tree.h                                  |   8 -
kernel/rcu/tree_exp.h                              |   2 +-
kernel/rcu/tree_plugin.h                           |  38 +-
kernel/rcu/tree_stall.h                            |   8 +-
kernel/rcu/update.c                                |   2 +-
kernel/sched/core.c                                |   2 +-
kernel/sched/idle.c                                |  10 +-
kernel/sched/sched.h                               |   1 +
kernel/softirq.c                                   |   4 +-
kernel/time/Kconfig                                |  37 +-
kernel/time/tick-sched.c                           |   2 +-
kernel/trace/trace.c                               |   8 +-
60 files changed, 934 insertions(+), 764 deletions(-)
[PATCH 00/20] rcu/context-tracking: Merge RCU eqs-dynticks counter to context tracking v5
Posted by Frederic Weisbecker 3 years, 10 months ago
This is the same as rcu:ctxt.2022.06.21a (no rebase) with minimal changes
on the following patches:

* [06/20] fix missing function renames on xtensa (thanks Max Filippov, SOB added)
* [09/20] fix missing Kconfig renames on xtensa (thanks Max Filippov, SOB added)
          and also on loongarch.
* [18/20] remove unecessary and buggy notrace from rcu_preempt_deferred_qs(). It's called
          after intrumentation_begin() in EQS functions.

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
	rcu/ctxt.2022.06.27

HEAD: cb0045adde39bba5ffc620a184b1685a869569d8

Thanks,
	Frederic
---

Frederic Weisbecker (19):
      context_tracking: Remove unused context_tracking_in_user()
      context_tracking: Add a note about noinstr VS unsafe context tracking functions
      context_tracking: Rename __context_tracking_enter/exit() to __ct_user_enter/exit()
      context_tracking: Rename context_tracking_user_enter/exit() to user_enter/exit_callable()
      context_tracking: Rename context_tracking_enter/exit() to ct_user_enter/exit()
      context_tracking: Rename context_tracking_cpu_set() to ct_cpu_track_user()
      context_tracking: Split user tracking Kconfig
      context_tracking: Take idle eqs entrypoints over RCU
      context_tracking: Take IRQ eqs entrypoints over RCU
      context_tracking: Take NMI eqs entrypoints over RCU
      rcu/context-tracking: Remove rcu_irq_enter/exit()
      rcu/context_tracking: Move dynticks counter to context tracking
      rcu/context_tracking: Move dynticks_nesting to context tracking
      rcu/context_tracking: Move dynticks_nmi_nesting to context tracking
      rcu/context-tracking: Move deferred nocb resched to context tracking
      rcu/context-tracking: Move RCU-dynticks internal functions to context_tracking
      rcu/context-tracking: Remove unused and/or unecessary middle functions
      context_tracking: Convert state to atomic_t
      MAINTAINERS: Add Paul as context tracking maintainer

Paul E. McKenney (1):
      context_tracking: Use arch_atomic_read() in __ct_state for KASAN


 .../RCU/Design/Requirements/Requirements.rst       |  10 +-
 Documentation/RCU/stallwarn.rst                    |   6 +-
 .../time/context-tracking/arch-support.txt         |   6 +-
 MAINTAINERS                                        |   1 +
 arch/Kconfig                                       |   8 +-
 arch/arm/Kconfig                                   |   2 +-
 arch/arm/kernel/entry-common.S                     |   4 +-
 arch/arm/kernel/entry-header.S                     |  12 +-
 arch/arm/mach-imx/cpuidle-imx6q.c                  |   5 +-
 arch/arm64/Kconfig                                 |   2 +-
 arch/arm64/kernel/entry-common.c                   |  14 +-
 arch/csky/Kconfig                                  |   2 +-
 arch/csky/kernel/entry.S                           |   8 +-
 arch/loongarch/Kconfig                             |   2 +-
 arch/mips/Kconfig                                  |   2 +-
 arch/powerpc/Kconfig                               |   2 +-
 arch/powerpc/include/asm/context_tracking.h        |   2 +-
 arch/riscv/Kconfig                                 |   2 +-
 arch/riscv/kernel/entry.S                          |  12 +-
 arch/sparc/Kconfig                                 |   2 +-
 arch/sparc/kernel/rtrap_64.S                       |   2 +-
 arch/x86/Kconfig                                   |   4 +-
 arch/x86/mm/fault.c                                |   2 +-
 arch/xtensa/Kconfig                                |   2 +-
 arch/xtensa/kernel/entry.S                         |   8 +-
 drivers/acpi/processor_idle.c                      |   5 +-
 drivers/cpuidle/cpuidle-psci.c                     |   8 +-
 drivers/cpuidle/cpuidle-riscv-sbi.c                |   8 +-
 drivers/cpuidle/cpuidle.c                          |   9 +-
 include/linux/context_tracking.h                   |  95 ++--
 include/linux/context_tracking_irq.h               |  21 +
 include/linux/context_tracking_state.h             | 113 +++-
 include/linux/entry-common.h                       |  10 +-
 include/linux/hardirq.h                            |  12 +-
 include/linux/rcupdate.h                           |  17 +-
 include/linux/rcutiny.h                            |   6 -
 include/linux/rcutree.h                            |   9 +-
 include/linux/tracepoint.h                         |   4 +-
 init/Kconfig                                       |   4 +-
 kernel/cfi.c                                       |   4 +-
 kernel/context_tracking.c                          | 617 +++++++++++++++++++--
 kernel/cpu_pm.c                                    |   8 +-
 kernel/entry/common.c                              |  16 +-
 kernel/extable.c                                   |   4 +-
 kernel/locking/lockdep.c                           |   2 +-
 kernel/rcu/Kconfig                                 |   2 +
 kernel/rcu/rcu.h                                   |   4 -
 kernel/rcu/tree.c                                  | 476 +---------------
 kernel/rcu/tree.h                                  |   8 -
 kernel/rcu/tree_exp.h                              |   2 +-
 kernel/rcu/tree_plugin.h                           |  38 +-
 kernel/rcu/tree_stall.h                            |   8 +-
 kernel/rcu/update.c                                |   2 +-
 kernel/sched/core.c                                |   2 +-
 kernel/sched/idle.c                                |  10 +-
 kernel/sched/sched.h                               |   1 +
 kernel/softirq.c                                   |   4 +-
 kernel/time/Kconfig                                |  37 +-
 kernel/time/tick-sched.c                           |   2 +-
 kernel/trace/trace.c                               |   8 +-
 60 files changed, 934 insertions(+), 764 deletions(-)
Re: [PATCH 00/20] rcu/context-tracking: Merge RCU eqs-dynticks counter to context tracking v5
Posted by Xiongfeng Wang 3 years, 6 months ago
Hi, Frederic

Thanks for push RCU dynticks counters to upstream. It is very useful. After it
is done, do we have plan to revive the sys-idle feature and use it to shutdown
the tick on the last housekeeping when the whole system is idle. I'm very glad
to help test it if you have some demo patches on your personal repo.

Thanks,
Xiongfeng

On 2022/6/28 21:15, Frederic Weisbecker wrote:
> This is the same as rcu:ctxt.2022.06.21a (no rebase) with minimal changes
> on the following patches:
> 
> * [06/20] fix missing function renames on xtensa (thanks Max Filippov, SOB added)
> * [09/20] fix missing Kconfig renames on xtensa (thanks Max Filippov, SOB added)
>           and also on loongarch.
> * [18/20] remove unecessary and buggy notrace from rcu_preempt_deferred_qs(). It's called
>           after intrumentation_begin() in EQS functions.
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
> 	rcu/ctxt.2022.06.27
> 
> HEAD: cb0045adde39bba5ffc620a184b1685a869569d8
> 
> Thanks,
> 	Frederic
> ---
> 
> Frederic Weisbecker (19):
>       context_tracking: Remove unused context_tracking_in_user()
>       context_tracking: Add a note about noinstr VS unsafe context tracking functions
>       context_tracking: Rename __context_tracking_enter/exit() to __ct_user_enter/exit()
>       context_tracking: Rename context_tracking_user_enter/exit() to user_enter/exit_callable()
>       context_tracking: Rename context_tracking_enter/exit() to ct_user_enter/exit()
>       context_tracking: Rename context_tracking_cpu_set() to ct_cpu_track_user()
>       context_tracking: Split user tracking Kconfig
>       context_tracking: Take idle eqs entrypoints over RCU
>       context_tracking: Take IRQ eqs entrypoints over RCU
>       context_tracking: Take NMI eqs entrypoints over RCU
>       rcu/context-tracking: Remove rcu_irq_enter/exit()
>       rcu/context_tracking: Move dynticks counter to context tracking
>       rcu/context_tracking: Move dynticks_nesting to context tracking
>       rcu/context_tracking: Move dynticks_nmi_nesting to context tracking
>       rcu/context-tracking: Move deferred nocb resched to context tracking
>       rcu/context-tracking: Move RCU-dynticks internal functions to context_tracking
>       rcu/context-tracking: Remove unused and/or unecessary middle functions
>       context_tracking: Convert state to atomic_t
>       MAINTAINERS: Add Paul as context tracking maintainer
> 
> Paul E. McKenney (1):
>       context_tracking: Use arch_atomic_read() in __ct_state for KASAN
> 
> 
>  .../RCU/Design/Requirements/Requirements.rst       |  10 +-
>  Documentation/RCU/stallwarn.rst                    |   6 +-
>  .../time/context-tracking/arch-support.txt         |   6 +-
>  MAINTAINERS                                        |   1 +
>  arch/Kconfig                                       |   8 +-
>  arch/arm/Kconfig                                   |   2 +-
>  arch/arm/kernel/entry-common.S                     |   4 +-
>  arch/arm/kernel/entry-header.S                     |  12 +-
>  arch/arm/mach-imx/cpuidle-imx6q.c                  |   5 +-
>  arch/arm64/Kconfig                                 |   2 +-
>  arch/arm64/kernel/entry-common.c                   |  14 +-
>  arch/csky/Kconfig                                  |   2 +-
>  arch/csky/kernel/entry.S                           |   8 +-
>  arch/loongarch/Kconfig                             |   2 +-
>  arch/mips/Kconfig                                  |   2 +-
>  arch/powerpc/Kconfig                               |   2 +-
>  arch/powerpc/include/asm/context_tracking.h        |   2 +-
>  arch/riscv/Kconfig                                 |   2 +-
>  arch/riscv/kernel/entry.S                          |  12 +-
>  arch/sparc/Kconfig                                 |   2 +-
>  arch/sparc/kernel/rtrap_64.S                       |   2 +-
>  arch/x86/Kconfig                                   |   4 +-
>  arch/x86/mm/fault.c                                |   2 +-
>  arch/xtensa/Kconfig                                |   2 +-
>  arch/xtensa/kernel/entry.S                         |   8 +-
>  drivers/acpi/processor_idle.c                      |   5 +-
>  drivers/cpuidle/cpuidle-psci.c                     |   8 +-
>  drivers/cpuidle/cpuidle-riscv-sbi.c                |   8 +-
>  drivers/cpuidle/cpuidle.c                          |   9 +-
>  include/linux/context_tracking.h                   |  95 ++--
>  include/linux/context_tracking_irq.h               |  21 +
>  include/linux/context_tracking_state.h             | 113 +++-
>  include/linux/entry-common.h                       |  10 +-
>  include/linux/hardirq.h                            |  12 +-
>  include/linux/rcupdate.h                           |  17 +-
>  include/linux/rcutiny.h                            |   6 -
>  include/linux/rcutree.h                            |   9 +-
>  include/linux/tracepoint.h                         |   4 +-
>  init/Kconfig                                       |   4 +-
>  kernel/cfi.c                                       |   4 +-
>  kernel/context_tracking.c                          | 617 +++++++++++++++++++--
>  kernel/cpu_pm.c                                    |   8 +-
>  kernel/entry/common.c                              |  16 +-
>  kernel/extable.c                                   |   4 +-
>  kernel/locking/lockdep.c                           |   2 +-
>  kernel/rcu/Kconfig                                 |   2 +
>  kernel/rcu/rcu.h                                   |   4 -
>  kernel/rcu/tree.c                                  | 476 +---------------
>  kernel/rcu/tree.h                                  |   8 -
>  kernel/rcu/tree_exp.h                              |   2 +-
>  kernel/rcu/tree_plugin.h                           |  38 +-
>  kernel/rcu/tree_stall.h                            |   8 +-
>  kernel/rcu/update.c                                |   2 +-
>  kernel/sched/core.c                                |   2 +-
>  kernel/sched/idle.c                                |  10 +-
>  kernel/sched/sched.h                               |   1 +
>  kernel/softirq.c                                   |   4 +-
>  kernel/time/Kconfig                                |  37 +-
>  kernel/time/tick-sched.c                           |   2 +-
>  kernel/trace/trace.c                               |   8 +-
>  60 files changed, 934 insertions(+), 764 deletions(-)
> .
>
Re: [PATCH 00/20] rcu/context-tracking: Merge RCU eqs-dynticks counter to context tracking v5
Posted by Frederic Weisbecker 3 years, 6 months ago
On Tue, Oct 11, 2022 at 07:37:48PM +0800, Xiongfeng Wang wrote:
> Hi, Frederic
> 
> Thanks for push RCU dynticks counters to upstream. It is very useful. After it
> is done, do we have plan to revive the sys-idle feature and use it to shutdown
> the tick on the last housekeeping when the whole system is idle. I'm very glad
> to help test it if you have some demo patches on your personal repo.

There is no plan yet but some other people seem to be interested. Would you
like to try to revive it yourself? Otherwise I may do it someday but I 
have quite some work to complete first (ie: making CPU isolation tunable through
cpusets).

Thanks.
Re: [PATCH 00/20] rcu/context-tracking: Merge RCU eqs-dynticks counter to context tracking v5
Posted by Xiongfeng Wang 3 years, 6 months ago
Hi, Frederic

On 2022/10/12 3:12, Frederic Weisbecker wrote:
> On Tue, Oct 11, 2022 at 07:37:48PM +0800, Xiongfeng Wang wrote:
>> Hi, Frederic
>>
>> Thanks for push RCU dynticks counters to upstream. It is very useful. After it
>> is done, do we have plan to revive the sys-idle feature and use it to shutdown
>> the tick on the last housekeeping when the whole system is idle. I'm very glad
>> to help test it if you have some demo patches on your personal repo.
> 
> There is no plan yet but some other people seem to be interested. Would you
> like to try to revive it yourself? Otherwise I may do it someday but I 

Thanks for your reply ! I would like to give it a try. But I'm not sure if I can
make it because I'm not so familiar with the RCU subsystem.

Thanks,
Xiongfeng

> have quite some work to complete first (ie: making CPU isolation tunable through
> cpusets).
> 
> Thanks.
> .
>
Re: [PATCH 00/20] rcu/context-tracking: Merge RCU eqs-dynticks counter to context tracking v5
Posted by Paul E. McKenney 3 years, 10 months ago
On Tue, Jun 28, 2022 at 03:15:59PM +0200, Frederic Weisbecker wrote:
> This is the same as rcu:ctxt.2022.06.21a (no rebase) with minimal changes
> on the following patches:
> 
> * [06/20] fix missing function renames on xtensa (thanks Max Filippov, SOB added)
> * [09/20] fix missing Kconfig renames on xtensa (thanks Max Filippov, SOB added)
>           and also on loongarch.
> * [18/20] remove unecessary and buggy notrace from rcu_preempt_deferred_qs(). It's called
>           after intrumentation_begin() in EQS functions.
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
> 	rcu/ctxt.2022.06.27
> 
> HEAD: cb0045adde39bba5ffc620a184b1685a869569d8

Thank you!  I have pulled this into -rcu as branch ctxt.2022.06.29a.
If testing goes well, I will re-merge it into branch "dev".

The diffs from the earlier version are indeed small, as promised.

I did reword the authorship of 06/20 and 09/20 because this looked to
me to be feedback rather than authorship.  I credited Max like this:

[ frederic: Apply Max Filippov feedback. ]

If you feel strongly about Max having authorship, please set this up
using the Co-developed-by rules shown in submitting-patches.rst and send
me an update.

							Thanx, Paul

> Thanks,
> 	Frederic
> ---
> 
> Frederic Weisbecker (19):
>       context_tracking: Remove unused context_tracking_in_user()
>       context_tracking: Add a note about noinstr VS unsafe context tracking functions
>       context_tracking: Rename __context_tracking_enter/exit() to __ct_user_enter/exit()
>       context_tracking: Rename context_tracking_user_enter/exit() to user_enter/exit_callable()
>       context_tracking: Rename context_tracking_enter/exit() to ct_user_enter/exit()
>       context_tracking: Rename context_tracking_cpu_set() to ct_cpu_track_user()
>       context_tracking: Split user tracking Kconfig
>       context_tracking: Take idle eqs entrypoints over RCU
>       context_tracking: Take IRQ eqs entrypoints over RCU
>       context_tracking: Take NMI eqs entrypoints over RCU
>       rcu/context-tracking: Remove rcu_irq_enter/exit()
>       rcu/context_tracking: Move dynticks counter to context tracking
>       rcu/context_tracking: Move dynticks_nesting to context tracking
>       rcu/context_tracking: Move dynticks_nmi_nesting to context tracking
>       rcu/context-tracking: Move deferred nocb resched to context tracking
>       rcu/context-tracking: Move RCU-dynticks internal functions to context_tracking
>       rcu/context-tracking: Remove unused and/or unecessary middle functions
>       context_tracking: Convert state to atomic_t
>       MAINTAINERS: Add Paul as context tracking maintainer
> 
> Paul E. McKenney (1):
>       context_tracking: Use arch_atomic_read() in __ct_state for KASAN
> 
> 
>  .../RCU/Design/Requirements/Requirements.rst       |  10 +-
>  Documentation/RCU/stallwarn.rst                    |   6 +-
>  .../time/context-tracking/arch-support.txt         |   6 +-
>  MAINTAINERS                                        |   1 +
>  arch/Kconfig                                       |   8 +-
>  arch/arm/Kconfig                                   |   2 +-
>  arch/arm/kernel/entry-common.S                     |   4 +-
>  arch/arm/kernel/entry-header.S                     |  12 +-
>  arch/arm/mach-imx/cpuidle-imx6q.c                  |   5 +-
>  arch/arm64/Kconfig                                 |   2 +-
>  arch/arm64/kernel/entry-common.c                   |  14 +-
>  arch/csky/Kconfig                                  |   2 +-
>  arch/csky/kernel/entry.S                           |   8 +-
>  arch/loongarch/Kconfig                             |   2 +-
>  arch/mips/Kconfig                                  |   2 +-
>  arch/powerpc/Kconfig                               |   2 +-
>  arch/powerpc/include/asm/context_tracking.h        |   2 +-
>  arch/riscv/Kconfig                                 |   2 +-
>  arch/riscv/kernel/entry.S                          |  12 +-
>  arch/sparc/Kconfig                                 |   2 +-
>  arch/sparc/kernel/rtrap_64.S                       |   2 +-
>  arch/x86/Kconfig                                   |   4 +-
>  arch/x86/mm/fault.c                                |   2 +-
>  arch/xtensa/Kconfig                                |   2 +-
>  arch/xtensa/kernel/entry.S                         |   8 +-
>  drivers/acpi/processor_idle.c                      |   5 +-
>  drivers/cpuidle/cpuidle-psci.c                     |   8 +-
>  drivers/cpuidle/cpuidle-riscv-sbi.c                |   8 +-
>  drivers/cpuidle/cpuidle.c                          |   9 +-
>  include/linux/context_tracking.h                   |  95 ++--
>  include/linux/context_tracking_irq.h               |  21 +
>  include/linux/context_tracking_state.h             | 113 +++-
>  include/linux/entry-common.h                       |  10 +-
>  include/linux/hardirq.h                            |  12 +-
>  include/linux/rcupdate.h                           |  17 +-
>  include/linux/rcutiny.h                            |   6 -
>  include/linux/rcutree.h                            |   9 +-
>  include/linux/tracepoint.h                         |   4 +-
>  init/Kconfig                                       |   4 +-
>  kernel/cfi.c                                       |   4 +-
>  kernel/context_tracking.c                          | 617 +++++++++++++++++++--
>  kernel/cpu_pm.c                                    |   8 +-
>  kernel/entry/common.c                              |  16 +-
>  kernel/extable.c                                   |   4 +-
>  kernel/locking/lockdep.c                           |   2 +-
>  kernel/rcu/Kconfig                                 |   2 +
>  kernel/rcu/rcu.h                                   |   4 -
>  kernel/rcu/tree.c                                  | 476 +---------------
>  kernel/rcu/tree.h                                  |   8 -
>  kernel/rcu/tree_exp.h                              |   2 +-
>  kernel/rcu/tree_plugin.h                           |  38 +-
>  kernel/rcu/tree_stall.h                            |   8 +-
>  kernel/rcu/update.c                                |   2 +-
>  kernel/sched/core.c                                |   2 +-
>  kernel/sched/idle.c                                |  10 +-
>  kernel/sched/sched.h                               |   1 +
>  kernel/softirq.c                                   |   4 +-
>  kernel/time/Kconfig                                |  37 +-
>  kernel/time/tick-sched.c                           |   2 +-
>  kernel/trace/trace.c                               |   8 +-
>  60 files changed, 934 insertions(+), 764 deletions(-)