Commit be05ee54 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

Merge branches 'docs.2022.04.20a', 'fixes.2022.04.20a', 'nocb.2022.04.11b',...

Merge branches 'docs.2022.04.20a', 'fixes.2022.04.20a', 'nocb.2022.04.11b', 'rcu-tasks.2022.04.11b', 'srcu.2022.05.03a', 'torture.2022.04.11b', 'torture-tasks.2022.04.20a' and 'torturescript.2022.04.20a' into HEAD

docs.2022.04.20a: Documentation updates.
fixes.2022.04.20a: Miscellaneous fixes.
nocb.2022.04.11b: Callback-offloading updates.
rcu-tasks.2022.04.11b: RCU-tasks updates.
srcu.2022.05.03a: Put SRCU on a memory diet.
torture.2022.04.11b: Torture-test updates.
torture-tasks.2022.04.20a: Avoid torture testing changing RCU configuration.
torturescript.2022.04.20a: Torture-test scripting updates.
Loading
+70 −3
Original line number Diff line number Diff line
@@ -4955,10 +4955,34 @@
			number avoids disturbing real-time workloads,
			but lengthens grace periods.

	rcupdate.rcu_task_stall_info= [KNL]
			Set initial timeout in jiffies for RCU task stall
			informational messages, which give some indication
			of the problem for those not patient enough to
			wait for ten minutes.  Informational messages are
			only printed prior to the stall-warning message
			for a given grace period. Disable with a value
			less than or equal to zero.  Defaults to ten
			seconds.  A change in value does not take effect
			until the beginning of the next grace period.

	rcupdate.rcu_task_stall_info_mult= [KNL]
			Multiplier for time interval between successive
			RCU task stall informational messages for a given
			RCU tasks grace period.  This value is clamped
			to one through ten, inclusive.	It defaults to
			the value three, so that the first informational
			message is printed 10 seconds into the grace
			period, the second at 40 seconds, the third at
			160 seconds, and then the stall warning at 600
			seconds would prevent a fourth at 640 seconds.

	rcupdate.rcu_task_stall_timeout= [KNL]
			Set timeout in jiffies for RCU task stall warning
			messages.  Disable with a value less than or equal
			to zero.
			Set timeout in jiffies for RCU task stall
			warning messages.  Disable with a value less
			than or equal to zero.	Defaults to ten minutes.
			A change in value does not take effect until
			the beginning of the next grace period.

	rcupdate.rcu_self_test= [KNL]
			Run the RCU early boot self tests
@@ -5377,6 +5401,17 @@
	smart2=		[HW]
			Format: <io1>[,<io2>[,...,<io8>]]

	smp.csd_lock_timeout= [KNL]
			Specify the period of time in milliseconds
			that smp_call_function() and friends will wait
			for a CPU to release the CSD lock.  This is
			useful when diagnosing bugs involving CPUs
			disabling interrupts for extended periods
			of time.  Defaults to 5,000 milliseconds, and
			setting a value of zero disables this feature.
			This feature may be more efficiently disabled
			using the csdlock_debug- kernel parameter.

	smsc-ircc2.nopnp	[HW] Don't use PNP to discover SMC devices
	smsc-ircc2.ircc_cfg=	[HW] Device configuration I/O port
	smsc-ircc2.ircc_sir=	[HW] SIR base I/O port
@@ -5608,6 +5643,30 @@
			off:    Disable mitigation and remove
				performance impact to RDRAND and RDSEED

	srcutree.big_cpu_lim [KNL]
			Specifies the number of CPUs constituting a
			large system, such that srcu_struct structures
			should immediately allocate an srcu_node array.
			This kernel-boot parameter defaults to 128,
			but takes effect only when the low-order four
			bits of srcutree.convert_to_big is equal to 3
			(decide at boot).

	srcutree.convert_to_big [KNL]
			Specifies under what conditions an SRCU tree
			srcu_struct structure will be converted to big
			form, that is, with an rcu_node tree:

				   0:  Never.
				   1:  At init_srcu_struct() time.
				   2:  When rcutorture decides to.
				   3:  Decide at boot time (default).
				0x1X:  Above plus if high contention.

			Either way, the srcu_node tree will be sized based
			on the actual runtime number of CPUs (nr_cpu_ids)
			instead of the compile-time CONFIG_NR_CPUS.

	srcutree.counter_wrap_check [KNL]
			Specifies how frequently to check for
			grace-period sequence counter wrap for the
@@ -5625,6 +5684,14 @@
			expediting.  Set to zero to disable automatic
			expediting.

	srcutree.small_contention_lim [KNL]
			Specifies the number of update-side contention
			events per jiffy will be tolerated before
			initiating a conversion of an srcu_struct
			structure to big form.	Note that the value of
			srcutree.convert_to_big must have the 0x10 bit
			set for contention-based conversions to occur.

	ssbd=		[ARM64,HW]
			Speculative Store Bypass Disable control

+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ config KPROBES
	depends on MODULES
	depends on HAVE_KPROBES
	select KALLSYMS
	select TASKS_RCU if PREEMPTION
	help
	  Kprobes allows you to trap at almost any kernel address and
	  execute a callback function.  register_kprobe() establishes
+1 −0
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ void synchronize_rcu_tasks_rude(void);
void exit_tasks_rcu_start(void);
void exit_tasks_rcu_finish(void);
#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
#define rcu_tasks_classic_qs(t, preempt) do { } while (0)
#define rcu_tasks_qs(t, preempt) do { } while (0)
#define rcu_note_voluntary_context_switch(t) do { } while (0)
#define call_rcu_tasks call_rcu
+41 −0
Original line number Diff line number Diff line
@@ -2117,6 +2117,47 @@ static inline void cond_resched_rcu(void)
#endif
}

#ifdef CONFIG_PREEMPT_DYNAMIC

extern bool preempt_model_none(void);
extern bool preempt_model_voluntary(void);
extern bool preempt_model_full(void);

#else

static inline bool preempt_model_none(void)
{
	return IS_ENABLED(CONFIG_PREEMPT_NONE);
}
static inline bool preempt_model_voluntary(void)
{
	return IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY);
}
static inline bool preempt_model_full(void)
{
	return IS_ENABLED(CONFIG_PREEMPT);
}

#endif

static inline bool preempt_model_rt(void)
{
	return IS_ENABLED(CONFIG_PREEMPT_RT);
}

/*
 * Does the preemption model allow non-cooperative preemption?
 *
 * For !CONFIG_PREEMPT_DYNAMIC kernels this is an exact match with
 * CONFIG_PREEMPTION; for CONFIG_PREEMPT_DYNAMIC this doesn't work as the
 * kernel is *built* with CONFIG_PREEMPTION=y but may run with e.g. the
 * PREEMPT_NONE model.
 */
static inline bool preempt_model_preemptible(void)
{
	return preempt_model_full() || preempt_model_rt();
}

/*
 * Does a critical section need to be broken due to another
 * task waiting?: (technically does not depend on CONFIG_PREEMPTION,
+25 −7
Original line number Diff line number Diff line
@@ -47,11 +47,9 @@ struct srcu_data {
 */
struct srcu_node {
	spinlock_t __private lock;
	unsigned long srcu_have_cbs[4];		/* GP seq for children */
						/*  having CBs, but only */
						/*  is > ->srcu_gq_seq. */
	unsigned long srcu_data_have_cbs[4];	/* Which srcu_data structs */
						/*  have CBs for given GP? */
	unsigned long srcu_have_cbs[4];		/* GP seq for children having CBs, but only */
						/*  if greater than ->srcu_gq_seq. */
	unsigned long srcu_data_have_cbs[4];	/* Which srcu_data structs have CBs for given GP? */
	unsigned long srcu_gp_seq_needed_exp;	/* Furthest future exp GP. */
	struct srcu_node *srcu_parent;		/* Next up in tree. */
	int grplo;				/* Least CPU for node. */
@@ -62,18 +60,24 @@ struct srcu_node {
 * Per-SRCU-domain structure, similar in function to rcu_state.
 */
struct srcu_struct {
	struct srcu_node node[NUM_RCU_NODES];	/* Combining tree. */
	struct srcu_node *node;			/* Combining tree. */
	struct srcu_node *level[RCU_NUM_LVLS + 1];
						/* First node at each level. */
	int srcu_size_state;			/* Small-to-big transition state. */
	struct mutex srcu_cb_mutex;		/* Serialize CB preparation. */
	spinlock_t __private lock;		/* Protect counters */
	spinlock_t __private lock;		/* Protect counters and size state. */
	struct mutex srcu_gp_mutex;		/* Serialize GP work. */
	unsigned int srcu_idx;			/* Current rdr array element. */
	unsigned long srcu_gp_seq;		/* Grace-period seq #. */
	unsigned long srcu_gp_seq_needed;	/* Latest gp_seq needed. */
	unsigned long srcu_gp_seq_needed_exp;	/* Furthest future exp GP. */
	unsigned long srcu_gp_start;		/* Last GP start timestamp (jiffies) */
	unsigned long srcu_last_gp_end;		/* Last GP end timestamp (ns) */
	unsigned long srcu_size_jiffies;	/* Current contention-measurement interval. */
	unsigned long srcu_n_lock_retries;	/* Contention events in current interval. */
	unsigned long srcu_n_exp_nodelay;	/* # expedited no-delays in current GP phase. */
	struct srcu_data __percpu *sda;		/* Per-CPU srcu_data array. */
	bool sda_is_static;			/* May ->sda be passed to free_percpu()? */
	unsigned long srcu_barrier_seq;		/* srcu_barrier seq #. */
	struct mutex srcu_barrier_mutex;	/* Serialize barrier ops. */
	struct completion srcu_barrier_completion;
@@ -81,10 +85,23 @@ struct srcu_struct {
	atomic_t srcu_barrier_cpu_cnt;		/* # CPUs not yet posting a */
						/*  callback for the barrier */
						/*  operation. */
	unsigned long reschedule_jiffies;
	unsigned long reschedule_count;
	struct delayed_work work;
	struct lockdep_map dep_map;
};

/* Values for size state variable (->srcu_size_state). */
#define SRCU_SIZE_SMALL		0
#define SRCU_SIZE_ALLOC		1
#define SRCU_SIZE_WAIT_BARRIER	2
#define SRCU_SIZE_WAIT_CALL	3
#define SRCU_SIZE_WAIT_CBS1	4
#define SRCU_SIZE_WAIT_CBS2	5
#define SRCU_SIZE_WAIT_CBS3	6
#define SRCU_SIZE_WAIT_CBS4	7
#define SRCU_SIZE_BIG		8

/* Values for state variable (bottom bits of ->srcu_gp_seq). */
#define SRCU_STATE_IDLE		0
#define SRCU_STATE_SCAN1	1
@@ -121,6 +138,7 @@ struct srcu_struct {
#ifdef MODULE
# define __DEFINE_SRCU(name, is_static)					\
	is_static struct srcu_struct name;				\
	extern struct srcu_struct * const __srcu_struct_##name;		\
	struct srcu_struct * const __srcu_struct_##name			\
		__section("___srcu_struct_ptrs") = &name
#else
Loading