[PATCH RFC 10/16] rcutorture: Test call_prcu() and prcu_barrier()

From: lianglihao
Date: Tue Jan 23 2018 - 03:10:11 EST


From: Lihao Liang <lianglihao@xxxxxxxxxx>

Signed-off-by: Lihao Liang <lianglihao@xxxxxxxxxx>
---
kernel/rcu/prcu.c | 4 +++-
kernel/rcu/rcutorture.c | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/prcu.c b/kernel/rcu/prcu.c
index 2664d091..49cb70e6 100644
--- a/kernel/rcu/prcu.c
+++ b/kernel/rcu/prcu.c
@@ -179,8 +179,10 @@ void call_prcu(struct rcu_head *head, rcu_callback_t func)

/* Use GFP_ATOMIC with IRQs disabled */
vhp = kmalloc(sizeof(struct prcu_version_head), GFP_ATOMIC);
- if (!vhp)
+ if (!vhp) {
+ WARN_ON(1);
return;
+ }

head->func = func;
head->next = NULL;
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 7d65bf0c..9215ebb0 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -797,8 +797,8 @@ static struct rcu_torture_ops prcu_ops = {
.exp_sync = synchronize_prcu,
.get_state = NULL,
.cond_sync = NULL,
- .call = NULL,
- .cb_barrier = NULL,
+ .call = call_prcu,
+ .cb_barrier = prcu_barrier,
.fqs = NULL,
.stats = NULL,
.irq_capable = 1,
--
2.14.1.729.g59c0ea183