* [PATCH] rcutorture: remove useless INIT_LIST_HEAD()
@ 2022-05-11 2:47 Haowen Bai
2022-05-11 3:01 ` Paul E. McKenney
0 siblings, 1 reply; 3+ messages in thread
From: Haowen Bai @ 2022-05-11 2:47 UTC (permalink / raw)
To: Davidlohr Bueso, Paul E. McKenney, Josh Triplett,
Frederic Weisbecker, Neeraj Upadhyay, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes
Cc: Haowen Bai, linux-kernel, rcu
list rcu_torture_freelist has been inited staticly through LIST_HEAD,
so there's no need to call another INIT_LIST_HEAD. Simply remove
it.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
kernel/rcu/rcutorture.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index faf6b4c7a757..0005e259c4ce 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -3247,7 +3247,6 @@ rcu_torture_init(void)
/* Set up the freelist. */
- INIT_LIST_HEAD(&rcu_torture_freelist);
for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++) {
rcu_tortures[i].rtort_mbtest = 0;
list_add_tail(&rcu_tortures[i].rtort_free,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rcutorture: remove useless INIT_LIST_HEAD()
2022-05-11 2:47 [PATCH] rcutorture: remove useless INIT_LIST_HEAD() Haowen Bai
@ 2022-05-11 3:01 ` Paul E. McKenney
2022-05-11 3:20 ` baihaowen
0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2022-05-11 3:01 UTC (permalink / raw)
To: Haowen Bai
Cc: Davidlohr Bueso, Josh Triplett, Frederic Weisbecker,
Neeraj Upadhyay, Steven Rostedt, Mathieu Desnoyers,
Lai Jiangshan, Joel Fernandes, linux-kernel, rcu
On Wed, May 11, 2022 at 10:47:04AM +0800, Haowen Bai wrote:
> list rcu_torture_freelist has been inited staticly through LIST_HEAD,
> so there's no need to call another INIT_LIST_HEAD. Simply remove
> it.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
For kernels with built-in rcutorture that starts automatically at
boot, you are quite correct.
But wouldn't there be trouble in the case where someone does a series of
"modprobe rcutorture" "rmmod rcutorture" commands?
Thanx, Paul
> ---
> kernel/rcu/rcutorture.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index faf6b4c7a757..0005e259c4ce 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -3247,7 +3247,6 @@ rcu_torture_init(void)
>
> /* Set up the freelist. */
>
> - INIT_LIST_HEAD(&rcu_torture_freelist);
> for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++) {
> rcu_tortures[i].rtort_mbtest = 0;
> list_add_tail(&rcu_tortures[i].rtort_free,
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rcutorture: remove useless INIT_LIST_HEAD()
2022-05-11 3:01 ` Paul E. McKenney
@ 2022-05-11 3:20 ` baihaowen
0 siblings, 0 replies; 3+ messages in thread
From: baihaowen @ 2022-05-11 3:20 UTC (permalink / raw)
To: paulmck
Cc: Davidlohr Bueso, Josh Triplett, Frederic Weisbecker,
Neeraj Upadhyay, Steven Rostedt, Mathieu Desnoyers,
Lai Jiangshan, Joel Fernandes, linux-kernel, rcu
在 2022/5/11 上午11:01, Paul E. McKenney 写道:
> On Wed, May 11, 2022 at 10:47:04AM +0800, Haowen Bai wrote:
>> list rcu_torture_freelist has been inited staticly through LIST_HEAD,
>> so there's no need to call another INIT_LIST_HEAD. Simply remove
>> it.
>>
>> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> For kernels with built-in rcutorture that starts automatically at
> boot, you are quite correct.
>
> But wouldn't there be trouble in the case where someone does a series of
> "modprobe rcutorture" "rmmod rcutorture" commands?
>
> Thanx, Paul
>
>> ---
>> kernel/rcu/rcutorture.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
>> index faf6b4c7a757..0005e259c4ce 100644
>> --- a/kernel/rcu/rcutorture.c
>> +++ b/kernel/rcu/rcutorture.c
>> @@ -3247,7 +3247,6 @@ rcu_torture_init(void)
>>
>> /* Set up the freelist. */
>>
>> - INIT_LIST_HEAD(&rcu_torture_freelist);
>> for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++) {
>> rcu_tortures[i].rtort_mbtest = 0;
>> list_add_tail(&rcu_tortures[i].rtort_free,
>> --
>> 2.7.4
>>
Thank you for kindly reply, got it.
--
Haowen Bai
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-11 3:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 2:47 [PATCH] rcutorture: remove useless INIT_LIST_HEAD() Haowen Bai
2022-05-11 3:01 ` Paul E. McKenney
2022-05-11 3:20 ` baihaowen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).