Commit d42e504a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'timers-core-2025-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer core updates from Thomas Gleixner:

 - Prevent a thundering herd problem when the timekeeper CPU is delayed
   and a large number of CPUs compete to acquire jiffies_lock to do the
   update. Limit it to one CPU with a separate "uncontended" atomic
   variable.

 - A set of improvements for the timer migration mechanism:

     - Support imbalanced NUMA trees correctly

     - Support dynamic exclusion of CPUs from the migrator duty to allow
       the cpuset/isolation mechanism to exclude them from handling
       timers of remote idle CPUs

 - The usual small updates, cleanups and enhancements

* tag 'timers-core-2025-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  timers/migration: Exclude isolated cpus from hierarchy
  cpumask: Add initialiser to use cleanup helpers
  sched/isolation: Force housekeeping if isolcpus and nohz_full don't leave any
  cgroup/cpuset: Rename update_unbound_workqueue_cpumask() to update_isolation_cpumasks()
  timers/migration: Use scoped_guard on available flag set/clear
  timers/migration: Add mask for CPUs available in the hierarchy
  timers/migration: Rename 'online' bit to 'available'
  selftests/timers/nanosleep: Add tests for return of remaining time
  selftests/timers: Clean up kernel version check in posix_timers
  time: Fix a few typos in time[r] related code comments
  time: tick-oneshot: Add missing Return and parameter descriptions to kernel-doc
  hrtimer: Store time as ktime_t in restart block
  timers/migration: Remove dead code handling idle CPU checking for remote timers
  timers/migration: Remove unused "cpu" parameter from tmigr_get_group()
  timers/migration: Assert that hotplug preparing CPU is part of stable active hierarchy
  timers/migration: Fix imbalanced NUMA trees
  timers/migration: Remove locking on group connection
  timers/migration: Convert "while" loops to use "for"
  tick/sched: Limit non-timekeeper CPUs calling jiffies update
parents 5028f424 7dec062c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1022,6 +1022,7 @@ static __always_inline unsigned int cpumask_size(void)

#define this_cpu_cpumask_var_ptr(x)	this_cpu_read(x)
#define __cpumask_var_read_mostly	__read_mostly
#define CPUMASK_VAR_NULL		NULL

bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node);

@@ -1068,6 +1069,7 @@ static __always_inline bool cpumask_available(cpumask_var_t mask)

#define this_cpu_cpumask_var_ptr(x) this_cpu_ptr(x)
#define __cpumask_var_read_mostly
#define CPUMASK_VAR_NULL {}

static __always_inline bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
{
+4 −4
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ void usleep_range_state(unsigned long min, unsigned long max,
 * @min:	Minimum time in microseconds to sleep
 * @max:	Maximum time in microseconds to sleep
 *
 * For basic information please refere to usleep_range_state().
 * For basic information please refer to usleep_range_state().
 *
 * The task will be in the state TASK_UNINTERRUPTIBLE during the sleep.
 */
@@ -82,10 +82,10 @@ static inline void usleep_range(unsigned long min, unsigned long max)
 * @min:	Minimum time in microseconds to sleep
 * @max:	Maximum time in microseconds to sleep
 *
 * For basic information please refere to usleep_range_state().
 * For basic information please refer to usleep_range_state().
 *
 * The sleeping task has the state TASK_IDLE during the sleep to prevent
 * contribution to the load avarage.
 * contribution to the load average.
 */
static inline void usleep_range_idle(unsigned long min, unsigned long max)
{
@@ -96,7 +96,7 @@ static inline void usleep_range_idle(unsigned long min, unsigned long max)
 * ssleep - wrapper for seconds around msleep
 * @seconds:	Requested sleep duration in seconds
 *
 * Please refere to msleep() for detailed information.
 * Please refer to msleep() for detailed information.
 */
static inline void ssleep(unsigned int seconds)
{
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ struct restart_block {
				struct __kernel_timespec __user *rmtp;
				struct old_timespec32 __user *compat_rmtp;
			};
			u64 expires;
			ktime_t expires;
		} nanosleep;
		/* For poll */
		struct {
+9 −0
Original line number Diff line number Diff line
@@ -188,4 +188,13 @@ int timers_dead_cpu(unsigned int cpu);
#define timers_dead_cpu		NULL
#endif

#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
extern int tmigr_isolated_exclude_cpumask(struct cpumask *exclude_cpumask);
#else
static inline int tmigr_isolated_exclude_cpumask(struct cpumask *exclude_cpumask)
{
	return 0;
}
#endif

#endif
+2 −2
Original line number Diff line number Diff line
@@ -173,14 +173,14 @@ DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_active,
	TP_ARGS(tmc)
);

DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_online,
DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_available,

	TP_PROTO(struct tmigr_cpu *tmc),

	TP_ARGS(tmc)
);

DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_offline,
DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_unavailable,

	TP_PROTO(struct tmigr_cpu *tmc),

Loading