Skip to content

Commit dfd458a

Browse files
committed
rcu: Add data structures for synchronize_rcu()
The synchronize_rcu() call is going to be reworked, thus this patch adds dedicated fields into the rcu_state structure. Reviewed-by: Paul E. McKenney <[email protected]> Signed-off-by: Uladzislau Rezki (Sony) <[email protected]>
1 parent 39cd87c commit dfd458a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

kernel/rcu/tree.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,13 @@ do { \
315315
__set_current_state(TASK_RUNNING); \
316316
} while (0)
317317

318+
#define SR_NORMAL_GP_WAIT_HEAD_MAX 5
319+
320+
struct sr_wait_node {
321+
atomic_t inuse;
322+
struct llist_node node;
323+
};
324+
318325
/*
319326
* RCU global state, including node hierarchy. This hierarchy is
320327
* represented in "heap" form in a dense array. The root (first level)
@@ -400,6 +407,13 @@ struct rcu_state {
400407
/* Synchronize offline with */
401408
/* GP pre-initialization. */
402409
int nocb_is_setup; /* nocb is setup from boot */
410+
411+
/* synchronize_rcu() part. */
412+
struct llist_head srs_next; /* request a GP users. */
413+
struct llist_node *srs_wait_tail; /* wait for GP users. */
414+
struct llist_node *srs_done_tail; /* ready for GP users. */
415+
struct sr_wait_node srs_wait_nodes[SR_NORMAL_GP_WAIT_HEAD_MAX];
416+
struct work_struct srs_cleanup_work;
403417
};
404418

405419
/* Values for rcu_state structure's gp_flags field. */

0 commit comments

Comments
 (0)