Skip to content

Commit e0a3464

Browse files
arndbpaulmckrcu
authored andcommitted
rcuscale: fix building with RCU_TINY
Both the CONFIG_TASKS_RCU and CONFIG_TASKS_RUDE_RCU options are broken when RCU_TINY is enabled as well, as some functions are missing a declaration. In file included from kernel/rcu/update.c:649: kernel/rcu/tasks.h:1271:21: error: no previous prototype for 'get_rcu_tasks_rude_gp_kthread' [-Werror=missing-prototypes] 1271 | struct task_struct *get_rcu_tasks_rude_gp_kthread(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/rcu/rcuscale.c:330:27: error: 'get_rcu_tasks_rude_gp_kthread' undeclared here (not in a function); did you mean 'get_rcu_tasks_trace_gp_kthread'? 330 | .rso_gp_kthread = get_rcu_tasks_rude_gp_kthread, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | get_rcu_tasks_trace_gp_kthread In file included from /home/arnd/arm-soc/kernel/rcu/update.c:649: kernel/rcu/tasks.h:1113:21: error: no previous prototype for 'get_rcu_tasks_gp_kthread' [-Werror=missing-prototypes] 1113 | struct task_struct *get_rcu_tasks_gp_kthread(void) | ^~~~~~~~~~~~~~~~~~~~~~~~ Also, building with CONFIG_TASKS_RUDE_RCU but not CONFIG_TASKS_RCU is broken because of some missing stub functions: kernel/rcu/rcuscale.c:322:27: error: 'tasks_scale_read_lock' undeclared here (not in a function); did you mean 'srcu_scale_read_lock'? 322 | .readlock = tasks_scale_read_lock, | ^~~~~~~~~~~~~~~~~~~~~ | srcu_scale_read_lock kernel/rcu/rcuscale.c:323:27: error: 'tasks_scale_read_unlock' undeclared here (not in a function); did you mean 'srcu_scale_read_unlock'? 323 | .readunlock = tasks_scale_read_unlock, | ^~~~~~~~~~~~~~~~~~~~~~~ | srcu_scale_read_unlock Move the declarations outside of the RCU_TINY #ifdef and duplicate the shared stub functions to address all of the above. Fixes: 88d7ff818f0ce ("rcuscale: Add RCU Tasks Rude testing") Fixes: 755f1c5eb416b ("rcuscale: Measure RCU Tasks Trace grace-period kthread CPU time") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent a15ec57 commit e0a3464

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

kernel/rcu/rcu.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -505,18 +505,20 @@ void rcu_async_relax(void);
505505
void rcupdate_announce_bootup_oddness(void);
506506
#ifdef CONFIG_TASKS_RCU_GENERIC
507507
void show_rcu_tasks_gp_kthreads(void);
508-
# ifdef CONFIG_TASKS_RCU
509-
struct task_struct *get_rcu_tasks_gp_kthread(void);
510-
# endif // # ifdef CONFIG_TASKS_RCU
511-
# ifdef CONFIG_TASKS_RUDE_RCU
512-
struct task_struct *get_rcu_tasks_rude_gp_kthread(void);
513-
# endif // # ifdef CONFIG_TASKS_RUDE_RCU
514508
#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
515509
static inline void show_rcu_tasks_gp_kthreads(void) {}
516510
#endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */
517511
void rcu_request_urgent_qs_task(struct task_struct *t);
518512
#endif /* #else #ifdef CONFIG_TINY_RCU */
519513

514+
#ifdef CONFIG_TASKS_RCU
515+
struct task_struct *get_rcu_tasks_gp_kthread(void);
516+
#endif // # ifdef CONFIG_TASKS_RCU
517+
518+
#ifdef CONFIG_TASKS_RUDE_RCU
519+
struct task_struct *get_rcu_tasks_rude_gp_kthread(void);
520+
#endif // # ifdef CONFIG_TASKS_RUDE_RCU
521+
520522
#define RCU_SCHEDULER_INACTIVE 0
521523
#define RCU_SCHEDULER_INIT 1
522524
#define RCU_SCHEDULER_RUNNING 2

kernel/rcu/rcuscale.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,20 @@ static struct rcu_scale_ops tasks_ops = {
316316
* Definitions for RCU-tasks-rude scalability testing.
317317
*/
318318

319+
static int tasks_rude_scale_read_lock(void)
320+
{
321+
return 0;
322+
}
323+
324+
static void tasks_rude_scale_read_unlock(int idx)
325+
{
326+
}
327+
319328
static struct rcu_scale_ops tasks_rude_ops = {
320329
.ptype = RCU_TASKS_RUDE_FLAVOR,
321330
.init = rcu_sync_scale_init,
322-
.readlock = tasks_scale_read_lock,
323-
.readunlock = tasks_scale_read_unlock,
331+
.readlock = tasks_rude_scale_read_lock,
332+
.readunlock = tasks_rude_scale_read_unlock,
324333
.get_gp_seq = rcu_no_completed,
325334
.gp_diff = rcu_seq_diff,
326335
.async = call_rcu_tasks_rude,

0 commit comments

Comments
 (0)