Skip to contentSkip to conversation

sched: swait: use wake_up_process() instead of wake_up_state()

PATCH In review Wang Qing 5 participants 8 messages Mar 16, 2021 – Mar 18, 2021 Scheduler

lore
Share & tools
lore

Wang Qing

author
#0 lore raw

PATCH 1/1 sched: swait: use wake_up_process() instead of wake_up_state()

Why not just use wake_up_process().

---
 kernel/sched/swait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/swait.c +1 -1
index e1c655f..7a24925
@@ -69,7 +69,7 @@ void swake_up_all(struct swait_queue_head *q)
 	while (!list_empty(&tmp)) {
 		curr = list_first_entry(&tmp, typeof(*curr), task_list);
 
-		wake_up_state(curr->task, TASK_NORMAL);
+		wake_up_process(curr->task);
 		list_del_init(&curr->task_list);
 
 		if (list_empty(&tmp))
Signature · 1 line
2.7.4
#1 lore raw
Quoted 1 line · Wang Qing

Why not just use wake_up_process().

IMO this is not an improvement. There are other places where explicit TASK_NORMAL is used as well, and they're all perfectly clear as is.

Quoted 18 lines
---
 kernel/sched/swait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/swait.c +1 -1
index e1c655f..7a24925
@@ -69,7 +69,7 @@ void swake_up_all(struct swait_queue_head *q)
 	while (!list_empty(&tmp)) {
 		curr = list_first_entry(&tmp, typeof(*curr), task_list);
 
-		wake_up_state(curr->task, TASK_NORMAL);
+		wake_up_process(curr->task);
 		list_del_init(&curr->task_list);
 
 		if (list_empty(&tmp))
#2 lore raw
Quoted 5 lines · Mike Galbraith
Quoted 1 line · Wang Qing

Why not just use wake_up_process().

IMO this is not an improvement. There are other places where explicit TASK_NORMAL is used as well, and they're all perfectly clear as is.

Arguably those could all be converted to wake_up_process() as well. It's a very small kernel code size optimization. There's about 3 such places, could be converted in a single patch.

Thanks,

Ingo

maintainer
#3 lore raw
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Mike Galbraith

On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Why not just use wake_up_process().

IMO this is not an improvement. There are other places where explicit TASK_NORMAL is used as well, and they're all perfectly clear as is.

Arguably those could all be converted to wake_up_process() as well. It's a very small kernel code size optimization. There's about 3 such places, could be converted in a single patch.

It's still pointless churn IMO.

author
#4 lore raw
Quoted 7 lines
Quoted 7 lines · Mike Galbraith
Quoted 4 lines · Wang Qing
Quoted 1 line

Why not just use wake_up_process().

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

IMO this is not an improvement. There are other places where explicit TASK_NORMAL is used as well, and they're all perfectly clear as is.

Arguably those could all be converted to wake_up_process() as well. It's a very small kernel code size optimization. There's about 3 such places, could be converted in a single patch.

It's still pointless churn IMO.

Using wake_up_process() is more simpler and friendly for beginners, and it is more convenient for analysis and statistics.

#5 lore raw
Quoted 9 lines · 王擎
Quoted 9 lines
Quoted 9 lines · Mike Galbraith
Quoted 6 lines · Wang Qing
Quoted 1 line

Why not just use wake_up_process().

IMO this is not an improvement. There are other places where explicit TASK_NORMAL is used as well, and they're all perfectly clear as is.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Arguably those could all be converted to wake_up_process() as well. It's a very small kernel code size optimization. There's about 3 such places, could be converted in a single patch.

It's still pointless churn IMO.

Using wake_up_process() is more simpler and friendly for beginners, and it is more convenient for analysis and statistics.

If that's your argument, that should have been in the change log. That said, it's IMO still pretty darn weak. When presenting a patch, do what Ingo did, show the technical merit, that's what will determine whether it flies or dies.

-Mike

#6 lore raw
In reply to Ingo Molnar
Quoted 11 lines · Ingo Molnar
Quoted 5 lines · Mike Galbraith
Quoted 1 line · Wang Qing

Why not just use wake_up_process().

IMO this is not an improvement. There are other places where explicit TASK_NORMAL is used as well, and they're all perfectly clear as is.

Arguably those could all be converted to wake_up_process() as well. It's a very small kernel code size optimization. There's about 3 such places, could be converted in a single patch.

I still prefer the way it sits, but that's certainlyly a heck of a lot better change justification than "why not" :)

-Mike

#7 lore raw
Quoted 9 lines · Mike Galbraith
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Mike Galbraith
Quoted 1 line · Wang Qing

Why not just use wake_up_process().

IMO this is not an improvement. There are other places where explicit TASK_NORMAL is used as well, and they're all perfectly clear as is.

Quoted 6 lines
Quoted 3 lines

Arguably those could all be converted to wake_up_process() as well. It's a very small kernel code size optimization. There's about 3 such places, could be converted in a single patch.

I still prefer the way it sits, but that's certainlyly a heck of a lot better change justification than "why not" :)

Which begs the reply "Why should we?" just for 10 bytes less of kernel text :)