@@ -107,14 +107,12 @@ static void __bpf_local_storage_free_trace_rcu(struct rcu_head *rcu)
107107{
108108 struct bpf_local_storage * local_storage ;
109109
110- /* If RCU Tasks Trace grace period implies RCU grace period, do
111- * kfree(), else do kfree_rcu().
110+ /*
111+ * RCU Tasks Trace grace period implies RCU grace period, do
112+ * kfree() directly.
112113 */
113114 local_storage = container_of (rcu , struct bpf_local_storage , rcu );
114- if (rcu_trace_implies_rcu_gp ())
115- kfree (local_storage );
116- else
117- kfree_rcu (local_storage , rcu );
115+ kfree (local_storage );
118116}
119117
120118/* Handle use_kmalloc_nolock == false */
@@ -138,10 +136,11 @@ static void bpf_local_storage_free_rcu(struct rcu_head *rcu)
138136
139137static void bpf_local_storage_free_trace_rcu (struct rcu_head * rcu )
140138{
141- if (rcu_trace_implies_rcu_gp ())
142- bpf_local_storage_free_rcu (rcu );
143- else
144- call_rcu (rcu , bpf_local_storage_free_rcu );
139+ /*
140+ * RCU Tasks Trace grace period implies RCU grace period, do
141+ * kfree() directly.
142+ */
143+ bpf_local_storage_free_rcu (rcu );
145144}
146145
147146static void bpf_local_storage_free (struct bpf_local_storage * local_storage ,
@@ -182,10 +181,11 @@ static void __bpf_selem_free_rcu(struct rcu_head *rcu)
182181/* rcu tasks trace callback for use_kmalloc_nolock == false */
183182static void __bpf_selem_free_trace_rcu (struct rcu_head * rcu )
184183{
185- if (rcu_trace_implies_rcu_gp ())
186- __bpf_selem_free_rcu (rcu );
187- else
188- call_rcu (rcu , __bpf_selem_free_rcu );
184+ /*
185+ * RCU Tasks Trace grace period implies RCU grace period, do
186+ * kfree() directly.
187+ */
188+ __bpf_selem_free_rcu (rcu );
189189}
190190
191191/* Handle use_kmalloc_nolock == false */
@@ -214,10 +214,11 @@ static void bpf_selem_free_rcu(struct rcu_head *rcu)
214214
215215static void bpf_selem_free_trace_rcu (struct rcu_head * rcu )
216216{
217- if (rcu_trace_implies_rcu_gp ())
218- bpf_selem_free_rcu (rcu );
219- else
220- call_rcu (rcu , bpf_selem_free_rcu );
217+ /*
218+ * RCU Tasks Trace grace period implies RCU grace period, do
219+ * kfree() directly.
220+ */
221+ bpf_selem_free_rcu (rcu );
221222}
222223
223224void bpf_selem_free (struct bpf_local_storage_elem * selem ,
0 commit comments