Skip to contentSkip to conversation

rcutorture: Skip debug object testing for cur_ops without ->debug_objects set

PATCH In review Zqiang 2 participants 8 messages May 28, 2024 – Jun 4, 2024

Subsystems (2)
lore
Share & tools
lore

Zqiang

author
#0 lore raw

PATCH 1/1 rcutorture: Skip debug object testing for cur_ops without ->debug_objects set

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +3 -2
index 08bf7c669dd3..9b8c277ab91a 100644
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
 		return;
 	}
 
-	if (WARN_ON_ONCE(cur_ops->debug_objects &&
-			(!cur_ops->call || !cur_ops->cb_barrier)))
+	if (!cur_ops->debug_objects ||
+			WARN_ON_ONCE(cur_ops->debug_objects &&
+				(!cur_ops->call || !cur_ops->cb_barrier)))
 		return;
 
 	struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 13 lines · Zqiang

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +0 -0
index 08bf7c669dd3..9b8c277ab91a 100644

kernel/rcu/rcutorture.c static void rcu_test_debug_objects(void) · line 3499

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
 		return;
 	}
 
-	if (WARN_ON_ONCE(cur_ops->debug_objects &&
-			(!cur_ops->call || !cur_ops->cb_barrier)))
+	if (!cur_ops->debug_objects ||
+			WARN_ON_ONCE(cur_ops->debug_objects &&

You lost me here. Given that we have "!cur_ops->debug_objects" before that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it?

Also, we don't get here unless the rcutorture.object_debug kernel boot parameter is specified, don't we really want to WARN_ON_ONCE if the current flavor does not support that?

Or do you have a use case that needs to silence these warnings?

Thanx, Paul

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -0
+				(!cur_ops->call || !cur_ops->cb_barrier)))
 		return;
 
 	struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
Signature · 1 line
2.17.1
author
#2 lore raw
Quoted 26 lines · Zqiang
Quoted 13 lines

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +0 -0
index 08bf7c669dd3..9b8c277ab91a 100644

kernel/rcu/rcutorture.c static void rcu_test_debug_objects(void) · line 3499

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
              return;
      }
 
-     if (WARN_ON_ONCE(cur_ops->debug_objects &&
-                     (!cur_ops->call || !cur_ops->cb_barrier)))
+     if (!cur_ops->debug_objects ||
+                     WARN_ON_ONCE(cur_ops->debug_objects &&

You lost me here. Given that we have "!cur_ops->debug_objects" before that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it?

Quoted 3 lines

Also, we don't get here unless the rcutorture.object_debug kernel boot parameter is specified, don't we really want to WARN_ON_ONCE if the current flavor does not support that?

Hi, Paul

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
[  106.111269] rcutorture: WARN: Duplicate call_tasks-tracing() test complete.

Thanks
Zqiang

Quoted 12 lines

Or do you have a use case that needs to silence these warnings?

Thanx, Paul

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -1
+                             (!cur_ops->call || !cur_ops->cb_barrier)))
              return;
 
      struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
--

2.17.1

author
#3 lore raw
Quoted 27 lines
Quoted 27 lines · Zqiang
Quoted 13 lines

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +0 -0
index 08bf7c669dd3..9b8c277ab91a 100644

kernel/rcu/rcutorture.c static void rcu_test_debug_objects(void) · line 3499

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
              return;
      }
 
-     if (WARN_ON_ONCE(cur_ops->debug_objects &&
-                     (!cur_ops->call || !cur_ops->cb_barrier)))
+     if (!cur_ops->debug_objects ||
+                     WARN_ON_ONCE(cur_ops->debug_objects &&

You lost me here. Given that we have "!cur_ops->debug_objects" before that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it?

Quoted 3 lines
Quoted 3 lines

Also, we don't get here unless the rcutorture.object_debug kernel boot parameter is specified, don't we really want to WARN_ON_ONCE if the current flavor does not support that?

Maybe I didn't describe it clearly enough, this modification is mainly to filter out test types that do not support double call_rcu*() checking, for example tasks, tasks-rudes,
task-tracing ;) .

Thanks
Zqiang

Quoted 31 lines

Hi, Paul

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
[  106.111269] rcutorture: WARN: Duplicate call_tasks-tracing() test complete.

Thanks
Zqiang

Quoted 12 lines

Or do you have a use case that needs to silence these warnings?

Thanx, Paul

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -1
+                             (!cur_ops->call || !cur_ops->cb_barrier)))
              return;
 
      struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
--

2.17.1

maintainer
#4 lore raw
Quoted 27 lines · Z qiang
Quoted 27 lines
Quoted 27 lines · Zqiang
Quoted 13 lines

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +0 -0
index 08bf7c669dd3..9b8c277ab91a 100644

kernel/rcu/rcutorture.c static void rcu_test_debug_objects(void) · line 3499

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
              return;
      }
 
-     if (WARN_ON_ONCE(cur_ops->debug_objects &&
-                     (!cur_ops->call || !cur_ops->cb_barrier)))
+     if (!cur_ops->debug_objects ||
+                     WARN_ON_ONCE(cur_ops->debug_objects &&

You lost me here. Given that we have "!cur_ops->debug_objects" before that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it?

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Also, we don't get here unless the rcutorture.object_debug kernel boot parameter is specified, don't we really want to WARN_ON_ONCE if the current flavor does not support that?

Maybe I didn't describe it clearly enough, this modification is mainly to filter out test types that do not support double call_rcu*() checking, for example tasks, tasks-rudes,
task-tracing ;) .

Understood.

It is just that in my experience, it is a good thing for rcutorture to splat when asked to do something that it cannot do. Or do you have a use case where this is problematic?

I don't count the fuzzers because they are supposed to avoid specifying things that are supposed to fail. ;-)

Thanx, Paul

Quoted 34 lines

Thanks
Zqiang

Quoted 31 lines

Hi, Paul

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
[  106.111269] rcutorture: WARN: Duplicate call_tasks-tracing() test complete.

Thanks
Zqiang

Quoted 12 lines

Or do you have a use case that needs to silence these warnings?

Thanx, Paul

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -1
+                             (!cur_ops->call || !cur_ops->cb_barrier)))
              return;
 
      struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
--

2.17.1

author
#5 lore raw
Quoted 38 lines · Z qiang
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines · Zqiang
Quoted 13 lines

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +0 -0
index 08bf7c669dd3..9b8c277ab91a 100644

kernel/rcu/rcutorture.c static void rcu_test_debug_objects(void) · line 3499

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
              return;
      }
 
-     if (WARN_ON_ONCE(cur_ops->debug_objects &&
-                     (!cur_ops->call || !cur_ops->cb_barrier)))
+     if (!cur_ops->debug_objects ||
+                     WARN_ON_ONCE(cur_ops->debug_objects &&

You lost me here. Given that we have "!cur_ops->debug_objects" before that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it?

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Also, we don't get here unless the rcutorture.object_debug kernel boot parameter is specified, don't we really want to WARN_ON_ONCE if the current flavor does not support that?

Maybe I didn't describe it clearly enough, this modification is mainly to filter out test types that do not support double call_rcu*() checking, for example tasks, tasks-rudes,
task-tracing ;) .

Quoted 6 lines

Understood.

It is just that in my experience, it is a good thing for rcutorture to splat when asked to do something that it cannot do. Or do you have a use case where this is problematic?

Hi, Paul

This is a scene I mentioned before:

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.

for call_rcu*() that does not support double call checking, if continue to test,
"rcutorture: duplicated callback was invoked". will output, I just want to avoid the output of this error message :)

Thanks
Zqiang

Quoted 39 lines

I don't count the fuzzers because they are supposed to avoid specifying things that are supposed to fail. ;-)

Thanx, Paul

Quoted 34 lines

Thanks
Zqiang

Quoted 31 lines

Hi, Paul

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
[  106.111269] rcutorture: WARN: Duplicate call_tasks-tracing() test complete.

Thanks
Zqiang

Quoted 12 lines

Or do you have a use case that needs to silence these warnings?

Thanx, Paul

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -1
+                             (!cur_ops->call || !cur_ops->cb_barrier)))
              return;
 
      struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
--

2.17.1

maintainer
#6 lore raw
Quoted 62 lines · Z qiang
Quoted 38 lines · Z qiang
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines · Zqiang
Quoted 13 lines

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +0 -0
index 08bf7c669dd3..9b8c277ab91a 100644

kernel/rcu/rcutorture.c static void rcu_test_debug_objects(void) · line 3499

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
              return;
      }
 
-     if (WARN_ON_ONCE(cur_ops->debug_objects &&
-                     (!cur_ops->call || !cur_ops->cb_barrier)))
+     if (!cur_ops->debug_objects ||
+                     WARN_ON_ONCE(cur_ops->debug_objects &&

You lost me here. Given that we have "!cur_ops->debug_objects" before that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it?

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Also, we don't get here unless the rcutorture.object_debug kernel boot parameter is specified, don't we really want to WARN_ON_ONCE if the current flavor does not support that?

Maybe I didn't describe it clearly enough, this modification is mainly to filter out test types that do not support double call_rcu*() checking, for example tasks, tasks-rudes,
task-tracing ;) .

Quoted 6 lines

Understood.

It is just that in my experience, it is a good thing for rcutorture to splat when asked to do something that it cannot do. Or do you have a use case where this is problematic?

Hi, Paul

This is a scene I mentioned before:

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
Quoted 4 lines

for call_rcu*() that does not support double call checking, if continue to test,
"rcutorture: duplicated callback was invoked". will output, I just want to avoid the output of this error message :)

OK, but then why not just avoid setting rcutorture.object_debug for the torture_type values that do not support it?

Thanx, Paul

Quoted 43 lines

Thanks
Zqiang

Quoted 39 lines

I don't count the fuzzers because they are supposed to avoid specifying things that are supposed to fail. ;-)

Thanx, Paul

Quoted 34 lines

Thanks
Zqiang

Quoted 31 lines

Hi, Paul

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
[  106.111269] rcutorture: WARN: Duplicate call_tasks-tracing() test complete.

Thanks
Zqiang

Quoted 12 lines

Or do you have a use case that needs to silence these warnings?

Thanx, Paul

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -1
+                             (!cur_ops->call || !cur_ops->cb_barrier)))
              return;
 
      struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
--

2.17.1

author
#7 lore raw
Quoted 64 lines · Z qiang
Quoted 62 lines
Quoted 38 lines · Z qiang
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines · Zqiang
Quoted 13 lines

This commit make rcu_test_debug_objects() early return when the specified cur_ops not set the ->debug_objects.

---
 kernel/rcu/rcutorture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +0 -0
index 08bf7c669dd3..9b8c277ab91a 100644

kernel/rcu/rcutorture.c static void rcu_test_debug_objects(void) · line 3499

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void)
              return;
      }
 
-     if (WARN_ON_ONCE(cur_ops->debug_objects &&
-                     (!cur_ops->call || !cur_ops->cb_barrier)))
+     if (!cur_ops->debug_objects ||
+                     WARN_ON_ONCE(cur_ops->debug_objects &&

You lost me here. Given that we have "!cur_ops->debug_objects" before that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it?

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Also, we don't get here unless the rcutorture.object_debug kernel boot parameter is specified, don't we really want to WARN_ON_ONCE if the current flavor does not support that?

Maybe I didn't describe it clearly enough, this modification is mainly to filter out test types that do not support double call_rcu*() checking, for example tasks, tasks-rudes,
task-tracing ;) .

Quoted 6 lines

Understood.

It is just that in my experience, it is a good thing for rcutorture to splat when asked to do something that it cannot do. Or do you have a use case where this is problematic?

Hi, Paul

This is a scene I mentioned before:

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
Quoted 7 lines
Quoted 4 lines

for call_rcu*() that does not support double call checking, if continue to test,
"rcutorture: duplicated callback was invoked". will output, I just want to avoid the output of this error message :)

OK, but then why not just avoid setting rcutorture.object_debug for the torture_type values that do not support it?

OK, understand.

Thanks
Zqiang

Quoted 46 lines

Thanx, Paul

Quoted 43 lines

Thanks
Zqiang

Quoted 39 lines

I don't count the fuzzers because they are supposed to avoid specifying things that are supposed to fail. ;-)

Thanx, Paul

Quoted 34 lines

Thanks
Zqiang

Quoted 31 lines

Hi, Paul

The rcutorture.object_debug is set true, but the tasks-tracing does not support duplicate cur_ops->call check, but the debug_objects test was still done.

insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 n_barrier_cbs=4 object_debug=1

[  106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting.
[  106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test
[  106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode
[  106.105552] rcutorture: duplicated callback was invoked.
[  106.105567] rcutorture: duplicated callback was invoked.
[  106.111269] rcutorture: WARN: Duplicate call_tasks-tracing() test complete.

Thanks
Zqiang

Quoted 12 lines

Or do you have a use case that needs to silence these warnings?

Thanx, Paul

Quoted 7 lines
kernel/rcu/rcutorture.c +1 -1
+                             (!cur_ops->call || !cur_ops->cb_barrier)))
              return;
 
      struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
--

2.17.1