Skip to content

Commit aed4e04

Browse files
committed
rcu: Remove unused RCU list functions
Given changes to callback migration, rcu_cblist_head(), rcu_cblist_tail(), rcu_cblist_count_cbs(), rcu_segcblist_segempty(), rcu_segcblist_dequeued_lazy(), and rcu_segcblist_new_cbs() are no longer used. This commit therefore removes them. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
1 parent f2dbe4a commit aed4e04

2 files changed

Lines changed: 0 additions & 110 deletions

File tree

‎kernel/rcu/rcu_segcblist.c‎

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,6 @@ void rcu_cblist_init(struct rcu_cblist *rclp)
3535
rclp->len_lazy = 0;
3636
}
3737

38-
/*
39-
* Debug function to actually count the number of callbacks.
40-
* If the number exceeds the limit specified, return -1.
41-
*/
42-
long rcu_cblist_count_cbs(struct rcu_cblist *rclp, long lim)
43-
{
44-
int cnt = 0;
45-
struct rcu_head **rhpp = &rclp->head;
46-
47-
for (;;) {
48-
if (!*rhpp)
49-
return cnt;
50-
if (++cnt > lim)
51-
return -1;
52-
rhpp = &(*rhpp)->next;
53-
}
54-
}
55-
5638
/*
5739
* Dequeue the oldest rcu_head structure from the specified callback
5840
* list. This function assumes that the callback is non-lazy, but
@@ -102,17 +84,6 @@ void rcu_segcblist_disable(struct rcu_segcblist *rsclp)
10284
rsclp->tails[RCU_NEXT_TAIL] = NULL;
10385
}
10486

105-
/*
106-
* Is the specified segment of the specified rcu_segcblist structure
107-
* empty of callbacks?
108-
*/
109-
bool rcu_segcblist_segempty(struct rcu_segcblist *rsclp, int seg)
110-
{
111-
if (seg == RCU_DONE_TAIL)
112-
return &rsclp->head == rsclp->tails[RCU_DONE_TAIL];
113-
return rsclp->tails[seg - 1] == rsclp->tails[seg];
114-
}
115-
11687
/*
11788
* Does the specified rcu_segcblist structure contain callbacks that
11889
* are ready to be invoked?
@@ -133,50 +104,6 @@ bool rcu_segcblist_pend_cbs(struct rcu_segcblist *rsclp)
133104
!rcu_segcblist_restempty(rsclp, RCU_DONE_TAIL);
134105
}
135106

136-
/*
137-
* Dequeue and return the first ready-to-invoke callback. If there
138-
* are no ready-to-invoke callbacks, return NULL. Disables interrupts
139-
* to avoid interference. Does not protect from interference from other
140-
* CPUs or tasks.
141-
*/
142-
struct rcu_head *rcu_segcblist_dequeue(struct rcu_segcblist *rsclp)
143-
{
144-
unsigned long flags;
145-
int i;
146-
struct rcu_head *rhp;
147-
148-
local_irq_save(flags);
149-
if (!rcu_segcblist_ready_cbs(rsclp)) {
150-
local_irq_restore(flags);
151-
return NULL;
152-
}
153-
rhp = rsclp->head;
154-
BUG_ON(!rhp);
155-
rsclp->head = rhp->next;
156-
for (i = RCU_DONE_TAIL; i < RCU_CBLIST_NSEGS; i++) {
157-
if (rsclp->tails[i] != &rhp->next)
158-
break;
159-
rsclp->tails[i] = &rsclp->head;
160-
}
161-
smp_mb(); /* Dequeue before decrement for rcu_barrier(). */
162-
WRITE_ONCE(rsclp->len, rsclp->len - 1);
163-
local_irq_restore(flags);
164-
return rhp;
165-
}
166-
167-
/*
168-
* Account for the fact that a previously dequeued callback turned out
169-
* to be marked as lazy.
170-
*/
171-
void rcu_segcblist_dequeued_lazy(struct rcu_segcblist *rsclp)
172-
{
173-
unsigned long flags;
174-
175-
local_irq_save(flags);
176-
rsclp->len_lazy--;
177-
local_irq_restore(flags);
178-
}
179-
180107
/*
181108
* Return a pointer to the first callback in the specified rcu_segcblist
182109
* structure. This is useful for diagnostics.
@@ -202,17 +129,6 @@ struct rcu_head *rcu_segcblist_first_pend_cb(struct rcu_segcblist *rsclp)
202129
return NULL;
203130
}
204131

205-
/*
206-
* Does the specified rcu_segcblist structure contain callbacks that
207-
* have not yet been processed beyond having been posted, that is,
208-
* does it contain callbacks in its last segment?
209-
*/
210-
bool rcu_segcblist_new_cbs(struct rcu_segcblist *rsclp)
211-
{
212-
return rcu_segcblist_is_enabled(rsclp) &&
213-
!rcu_segcblist_restempty(rsclp, RCU_NEXT_READY_TAIL);
214-
}
215-
216132
/*
217133
* Enqueue the specified callback onto the specified rcu_segcblist
218134
* structure, updating accounting as needed. Note that the ->len

‎kernel/rcu/rcu_segcblist.h‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,7 @@ static inline void rcu_cblist_dequeued_lazy(struct rcu_cblist *rclp)
3131
rclp->len_lazy--;
3232
}
3333

34-
/*
35-
* Interim function to return rcu_cblist head pointer. Longer term, the
36-
* rcu_cblist will be used more pervasively, removing the need for this
37-
* function.
38-
*/
39-
static inline struct rcu_head *rcu_cblist_head(struct rcu_cblist *rclp)
40-
{
41-
return rclp->head;
42-
}
43-
44-
/*
45-
* Interim function to return rcu_cblist head pointer. Longer term, the
46-
* rcu_cblist will be used more pervasively, removing the need for this
47-
* function.
48-
*/
49-
static inline struct rcu_head **rcu_cblist_tail(struct rcu_cblist *rclp)
50-
{
51-
WARN_ON_ONCE(!rclp->head);
52-
return rclp->tail;
53-
}
54-
5534
void rcu_cblist_init(struct rcu_cblist *rclp);
56-
long rcu_cblist_count_cbs(struct rcu_cblist *rclp, long lim);
5735
struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp);
5836

5937
/*
@@ -134,14 +112,10 @@ static inline struct rcu_head **rcu_segcblist_tail(struct rcu_segcblist *rsclp)
134112

135113
void rcu_segcblist_init(struct rcu_segcblist *rsclp);
136114
void rcu_segcblist_disable(struct rcu_segcblist *rsclp);
137-
bool rcu_segcblist_segempty(struct rcu_segcblist *rsclp, int seg);
138115
bool rcu_segcblist_ready_cbs(struct rcu_segcblist *rsclp);
139116
bool rcu_segcblist_pend_cbs(struct rcu_segcblist *rsclp);
140-
struct rcu_head *rcu_segcblist_dequeue(struct rcu_segcblist *rsclp);
141-
void rcu_segcblist_dequeued_lazy(struct rcu_segcblist *rsclp);
142117
struct rcu_head *rcu_segcblist_first_cb(struct rcu_segcblist *rsclp);
143118
struct rcu_head *rcu_segcblist_first_pend_cb(struct rcu_segcblist *rsclp);
144-
bool rcu_segcblist_new_cbs(struct rcu_segcblist *rsclp);
145119
void rcu_segcblist_enqueue(struct rcu_segcblist *rsclp,
146120
struct rcu_head *rhp, bool lazy);
147121
bool rcu_segcblist_entrain(struct rcu_segcblist *rsclp,

0 commit comments

Comments
 (0)