Commit 79cfea02 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Remove TINY_RCU bloat from pointless boot parameters

The rcu_expedited, rcu_normal, and rcu_normal_after_boot kernel boot
parameters are pointless in the case of TINY_RCU because in that case
synchronous grace periods, both expedited and normal, are no-ops.
However, these three symbols contribute several hundred bytes of bloat.
This commit therefore uses CPP directives to avoid compiling this code
in TINY_RCU kernels.
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 3e42ec1a
...@@ -3308,20 +3308,23 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -3308,20 +3308,23 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
of synchronize_rcu(). This reduces latency, of synchronize_rcu(). This reduces latency,
but can increase CPU utilization, degrade but can increase CPU utilization, degrade
real-time latency, and degrade energy efficiency. real-time latency, and degrade energy efficiency.
No effect on CONFIG_TINY_RCU kernels.
rcupdate.rcu_normal= [KNL] rcupdate.rcu_normal= [KNL]
Use only normal grace-period primitives, Use only normal grace-period primitives,
for example, synchronize_rcu() instead of for example, synchronize_rcu() instead of
synchronize_rcu_expedited(). This improves synchronize_rcu_expedited(). This improves
real-time latency, CPU utilization, and energy real-time latency, CPU utilization, and
efficiency, but can expose users to increased energy efficiency, but can expose users to
grace-period latency. This parameter overrides increased grace-period latency. This parameter
rcupdate.rcu_expedited. overrides rcupdate.rcu_expedited. No effect on
CONFIG_TINY_RCU kernels.
rcupdate.rcu_normal_after_boot= [KNL] rcupdate.rcu_normal_after_boot= [KNL]
Once boot has completed (that is, after Once boot has completed (that is, after
rcu_end_inkernel_boot() has been invoked), use rcu_end_inkernel_boot() has been invoked), use
only normal grace-period primitives. only normal grace-period primitives. No effect
on CONFIG_TINY_RCU kernels.
rcupdate.rcu_task_stall_timeout= [KNL] rcupdate.rcu_task_stall_timeout= [KNL]
Set timeout in jiffies for RCU task stall warning Set timeout in jiffies for RCU task stall warning
......
...@@ -48,8 +48,10 @@ ...@@ -48,8 +48,10 @@
#include <asm/barrier.h> #include <asm/barrier.h>
#ifndef CONFIG_TINY_RCU
extern int rcu_expedited; /* for sysctl */ extern int rcu_expedited; /* for sysctl */
extern int rcu_normal; /* also for sysctl */ extern int rcu_normal; /* also for sysctl */
#endif /* #ifndef CONFIG_TINY_RCU */
#ifdef CONFIG_TINY_RCU #ifdef CONFIG_TINY_RCU
/* Tiny RCU doesn't expedite, as its purpose in life is instead to be tiny. */ /* Tiny RCU doesn't expedite, as its purpose in life is instead to be tiny. */
...@@ -327,7 +329,6 @@ static inline int rcu_preempt_depth(void) ...@@ -327,7 +329,6 @@ static inline int rcu_preempt_depth(void)
/* Internal to kernel */ /* Internal to kernel */
void rcu_init(void); void rcu_init(void);
void rcu_end_inkernel_boot(void);
void rcu_sched_qs(void); void rcu_sched_qs(void);
void rcu_bh_qs(void); void rcu_bh_qs(void);
void rcu_check_callbacks(int user); void rcu_check_callbacks(int user);
...@@ -335,6 +336,12 @@ struct notifier_block; ...@@ -335,6 +336,12 @@ struct notifier_block;
int rcu_cpu_notify(struct notifier_block *self, int rcu_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu); unsigned long action, void *hcpu);
#ifndef CONFIG_TINY_RCU
void rcu_end_inkernel_boot(void);
#else /* #ifndef CONFIG_TINY_RCU */
static inline void rcu_end_inkernel_boot(void) { }
#endif /* #ifndef CONFIG_TINY_RCU */
#ifdef CONFIG_RCU_STALL_COMMON #ifdef CONFIG_RCU_STALL_COMMON
void rcu_sysrq_start(void); void rcu_sysrq_start(void);
void rcu_sysrq_end(void); void rcu_sysrq_end(void);
......
...@@ -144,6 +144,7 @@ static ssize_t fscaps_show(struct kobject *kobj, ...@@ -144,6 +144,7 @@ static ssize_t fscaps_show(struct kobject *kobj,
} }
KERNEL_ATTR_RO(fscaps); KERNEL_ATTR_RO(fscaps);
#ifndef CONFIG_TINY_RCU
int rcu_expedited; int rcu_expedited;
static ssize_t rcu_expedited_show(struct kobject *kobj, static ssize_t rcu_expedited_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf) struct kobj_attribute *attr, char *buf)
...@@ -177,6 +178,7 @@ static ssize_t rcu_normal_store(struct kobject *kobj, ...@@ -177,6 +178,7 @@ static ssize_t rcu_normal_store(struct kobject *kobj,
return count; return count;
} }
KERNEL_ATTR_RW(rcu_normal); KERNEL_ATTR_RW(rcu_normal);
#endif /* #ifndef CONFIG_TINY_RCU */
/* /*
* Make /sys/kernel/notes give the raw contents of our kernel .notes section. * Make /sys/kernel/notes give the raw contents of our kernel .notes section.
...@@ -219,8 +221,10 @@ static struct attribute * kernel_attrs[] = { ...@@ -219,8 +221,10 @@ static struct attribute * kernel_attrs[] = {
&kexec_crash_size_attr.attr, &kexec_crash_size_attr.attr,
&vmcoreinfo_attr.attr, &vmcoreinfo_attr.attr,
#endif #endif
#ifndef CONFIG_TINY_RCU
&rcu_expedited_attr.attr, &rcu_expedited_attr.attr,
&rcu_normal_attr.attr, &rcu_normal_attr.attr,
#endif
NULL NULL
}; };
......
...@@ -60,11 +60,12 @@ MODULE_ALIAS("rcupdate"); ...@@ -60,11 +60,12 @@ MODULE_ALIAS("rcupdate");
#endif #endif
#define MODULE_PARAM_PREFIX "rcupdate." #define MODULE_PARAM_PREFIX "rcupdate."
#ifndef CONFIG_TINY_RCU
module_param(rcu_expedited, int, 0); module_param(rcu_expedited, int, 0);
module_param(rcu_normal, int, 0); module_param(rcu_normal, int, 0);
static int rcu_normal_after_boot; static int rcu_normal_after_boot;
module_param(rcu_normal_after_boot, int, 0); module_param(rcu_normal_after_boot, int, 0);
#endif /* #ifndef CONFIG_TINY_RCU */
#if defined(CONFIG_DEBUG_LOCK_ALLOC) && defined(CONFIG_PREEMPT_COUNT) #if defined(CONFIG_DEBUG_LOCK_ALLOC) && defined(CONFIG_PREEMPT_COUNT)
/** /**
...@@ -172,8 +173,6 @@ void rcu_unexpedite_gp(void) ...@@ -172,8 +173,6 @@ void rcu_unexpedite_gp(void)
} }
EXPORT_SYMBOL_GPL(rcu_unexpedite_gp); EXPORT_SYMBOL_GPL(rcu_unexpedite_gp);
#endif /* #ifndef CONFIG_TINY_RCU */
/* /*
* Inform RCU of the end of the in-kernel boot sequence. * Inform RCU of the end of the in-kernel boot sequence.
*/ */
...@@ -185,6 +184,8 @@ void rcu_end_inkernel_boot(void) ...@@ -185,6 +184,8 @@ void rcu_end_inkernel_boot(void)
WRITE_ONCE(rcu_normal, 1); WRITE_ONCE(rcu_normal, 1);
} }
#endif /* #ifndef CONFIG_TINY_RCU */
#ifdef CONFIG_PREEMPT_RCU #ifdef CONFIG_PREEMPT_RCU
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment