Merge tag 'x86_cache_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2024 00:29:55 +0000 (17:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2024 00:29:55 +0000 (17:29 -0700)
Pull resource control updates from Borislav Petkov:

 - Rework different aspects of the resctrl code like adding
   arch-specific accessors and splitting the locking, in order to
   accomodate ARM's MPAM implementation of hw resource control and be
   able to use the same filesystem control interface like on x86. Work
   by James Morse

 - Improve the memory bandwidth throttling heuristic to handle workloads
   with not too regular load levels which end up penalized unnecessarily

 - Use CPUID to detect the memory bandwidth enforcement limit on AMD

 - The usual set of fixes

* tag 'x86_cache_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits)
  x86/resctrl: Remove lockdep annotation that triggers false positive
  x86/resctrl: Separate arch and fs resctrl locks
  x86/resctrl: Move domain helper migration into resctrl_offline_cpu()
  x86/resctrl: Add CPU offline callback for resctrl work
  x86/resctrl: Allow overflow/limbo handlers to be scheduled on any-but CPU
  x86/resctrl: Add CPU online callback for resctrl work
  x86/resctrl: Add helpers for system wide mon/alloc capable
  x86/resctrl: Make rdt_enable_key the arch's decision to switch
  x86/resctrl: Move alloc/mon static keys into helpers
  x86/resctrl: Make resctrl_mounted checks explicit
  x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read()
  x86/resctrl: Allow resctrl_arch_rmid_read() to sleep
  x86/resctrl: Queue mon_event_read() instead of sending an IPI
  x86/resctrl: Add cpumask_any_housekeeping() for limbo/overflow
  x86/resctrl: Move CLOSID/RMID matching and setting to use helpers
  x86/resctrl: Allocate the cleanest CLOSID by searching closid_num_dirty_rmid
  x86/resctrl: Use __set_bit()/__clear_bit() instead of open coding
  x86/resctrl: Track the number of dirty RMID a CLOSID has
  x86/resctrl: Allow RMID allocation to be scoped by CLOSID
  x86/resctrl: Access per-rmid structures by index
  ...

1  2 
include/linux/tick.h

diff --combined include/linux/tick.h
index 44fddfa93e18c86582c3cb767e210f4202b4083b,0fb903838dfb655cedfd7d6be9e33dbf67309c5e..70dc884054f659c88b5ee957f348582e326e20b4
@@@ -19,22 -19,16 +19,22 @@@ extern void __init tick_init(void)
  extern void tick_suspend_local(void);
  /* Should be core only, but XEN resume magic and ARM BL switcher require it */
  extern void tick_resume_local(void);
 -extern void tick_handover_do_timer(void);
  extern void tick_cleanup_dead_cpu(int cpu);
  #else /* CONFIG_GENERIC_CLOCKEVENTS */
  static inline void tick_init(void) { }
  static inline void tick_suspend_local(void) { }
  static inline void tick_resume_local(void) { }
 -static inline void tick_handover_do_timer(void) { }
  static inline void tick_cleanup_dead_cpu(int cpu) { }
  #endif /* !CONFIG_GENERIC_CLOCKEVENTS */
  
 +#if defined(CONFIG_GENERIC_CLOCKEVENTS) && defined(CONFIG_HOTPLUG_CPU)
 +extern int tick_cpu_dying(unsigned int cpu);
 +extern void tick_assert_timekeeping_handover(void);
 +#else
 +#define tick_cpu_dying        NULL
 +static inline void tick_assert_timekeeping_handover(void) { }
 +#endif
 +
  #if defined(CONFIG_GENERIC_CLOCKEVENTS) && defined(CONFIG_SUSPEND)
  extern void tick_freeze(void);
  extern void tick_unfreeze(void);
@@@ -75,6 -69,12 +75,6 @@@ extern void tick_broadcast_control(enu
  static inline void tick_broadcast_control(enum tick_broadcast_mode mode) { }
  #endif /* BROADCAST */
  
 -#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_HOTPLUG_CPU)
 -extern void tick_offline_cpu(unsigned int cpu);
 -#else
 -static inline void tick_offline_cpu(unsigned int cpu) { }
 -#endif
 -
  #ifdef CONFIG_GENERIC_CLOCKEVENTS
  extern int tick_broadcast_oneshot_control(enum tick_broadcast_state state);
  #else
@@@ -164,9 -164,16 +164,16 @@@ static inline u64 get_cpu_idle_time_us(
  static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
  #endif /* !CONFIG_NO_HZ_COMMON */
  
+ /*
+  * Mask of CPUs that are nohz_full.
+  *
+  * Users should be guarded by CONFIG_NO_HZ_FULL or a tick_nohz_full_cpu()
+  * check.
+  */
+ extern cpumask_var_t tick_nohz_full_mask;
  #ifdef CONFIG_NO_HZ_FULL
  extern bool tick_nohz_full_running;
- extern cpumask_var_t tick_nohz_full_mask;
  
  static inline bool tick_nohz_full_enabled(void)
  {