@@ -22,6 +22,8 @@ typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);
22
22
* @kthread_ptr: This flavor's grace-period/callback-invocation kthread.
23
23
* @gp_func: This flavor's grace-period-wait function.
24
24
* @call_func: This flavor's call_rcu()-equivalent function.
25
+ * @name: This flavor's textual name.
26
+ * @kname: This flavor's kthread name.
25
27
*/
26
28
struct rcu_tasks {
27
29
struct rcu_head * cbs_head ;
@@ -31,16 +33,20 @@ struct rcu_tasks {
31
33
struct task_struct * kthread_ptr ;
32
34
rcu_tasks_gp_func_t gp_func ;
33
35
call_rcu_func_t call_func ;
36
+ char * name ;
37
+ char * kname ;
34
38
};
35
39
36
- #define DEFINE_RCU_TASKS (name , gp , call ) \
37
- static struct rcu_tasks name = \
40
+ #define DEFINE_RCU_TASKS (rt_name , gp , call , n ) \
41
+ static struct rcu_tasks rt_name = \
38
42
{ \
39
- .cbs_tail = &name .cbs_head, \
40
- .cbs_wq = __WAIT_QUEUE_HEAD_INITIALIZER(name .cbs_wq), \
41
- .cbs_lock = __RAW_SPIN_LOCK_UNLOCKED(name .cbs_lock), \
43
+ .cbs_tail = &rt_name .cbs_head, \
44
+ .cbs_wq = __WAIT_QUEUE_HEAD_INITIALIZER(rt_name .cbs_wq), \
45
+ .cbs_lock = __RAW_SPIN_LOCK_UNLOCKED(rt_name .cbs_lock), \
42
46
.gp_func = gp, \
43
47
.call_func = call, \
48
+ .name = n, \
49
+ .kname = #rt_name, \
44
50
}
45
51
46
52
/* Track exiting tasks in order to allow them to be waited for. */
@@ -145,8 +151,8 @@ static void __init rcu_spawn_tasks_kthread_generic(struct rcu_tasks *rtp)
145
151
{
146
152
struct task_struct * t ;
147
153
148
- t = kthread_run (rcu_tasks_kthread , rtp , "rcu_tasks_kthread" );
149
- if (WARN_ONCE (IS_ERR (t ), "%s: Could not start Tasks-RCU grace-period kthread, OOM is now expected behavior\n" , __func__ ))
154
+ t = kthread_run (rcu_tasks_kthread , rtp , "%s_kthread" , rtp -> kname );
155
+ if (WARN_ONCE (IS_ERR (t ), "%s: Could not start %s grace-period kthread, OOM is now expected behavior\n" , __func__ , rtp -> name ))
150
156
return ;
151
157
smp_mb (); /* Ensure others see full kthread. */
152
158
}
@@ -342,7 +348,7 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp)
342
348
}
343
349
344
350
void call_rcu_tasks (struct rcu_head * rhp , rcu_callback_t func );
345
- DEFINE_RCU_TASKS (rcu_tasks , rcu_tasks_wait_gp , call_rcu_tasks );
351
+ DEFINE_RCU_TASKS (rcu_tasks , rcu_tasks_wait_gp , call_rcu_tasks , "RCU Tasks" );
346
352
347
353
/**
348
354
* call_rcu_tasks() - Queue an RCU for invocation task-based grace period
@@ -437,7 +443,8 @@ static void rcu_tasks_rude_wait_gp(struct rcu_tasks *rtp)
437
443
}
438
444
439
445
void call_rcu_tasks_rude (struct rcu_head * rhp , rcu_callback_t func );
440
- DEFINE_RCU_TASKS (rcu_tasks_rude , rcu_tasks_rude_wait_gp , call_rcu_tasks_rude );
446
+ DEFINE_RCU_TASKS (rcu_tasks_rude , rcu_tasks_rude_wait_gp , call_rcu_tasks_rude ,
447
+ "RCU Tasks Rude" );
441
448
442
449
/**
443
450
* call_rcu_tasks_rude() - Queue a callback rude task-based grace period
0 commit comments