linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
@ 2021-03-16 11:20 Wang Qing
  2021-03-17  4:43 ` Mike Galbraith
  0 siblings, 1 reply; 8+ messages in thread
From: Wang Qing @ 2021-03-16 11:20 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, linux-kernel
  Cc: Wang Qing

Why not just use wake_up_process().

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 kernel/sched/swait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c
index e1c655f..7a24925
--- a/kernel/sched/swait.c
+++ b/kernel/sched/swait.c
@@ -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.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
  2021-03-16 11:20 [PATCH] sched: swait: use wake_up_process() instead of wake_up_state() Wang Qing
@ 2021-03-17  4:43 ` Mike Galbraith
  2021-03-17  9:46   ` Ingo Molnar
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Galbraith @ 2021-03-17  4:43 UTC (permalink / raw)
  To: Wang Qing, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Daniel Bristot de Oliveira, linux-kernel

On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:
> 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.

> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>  kernel/sched/swait.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c
> index e1c655f..7a24925
> --- a/kernel/sched/swait.c
> +++ b/kernel/sched/swait.c
> @@ -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))


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
  2021-03-17  4:43 ` Mike Galbraith
@ 2021-03-17  9:46   ` Ingo Molnar
  2021-03-17 10:35     ` Peter Zijlstra
  2021-03-17 10:41     ` Mike Galbraith
  0 siblings, 2 replies; 8+ messages in thread
From: Ingo Molnar @ 2021-03-17  9:46 UTC (permalink / raw)
  To: Mike Galbraith
  Cc: Wang Qing, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Daniel Bristot de Oliveira, linux-kernel


* Mike Galbraith <efault@gmx.de> wrote:

> On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:
> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
  2021-03-17  9:46   ` Ingo Molnar
@ 2021-03-17 10:35     ` Peter Zijlstra
  2021-03-18  2:14       ` 王擎
  2021-03-17 10:41     ` Mike Galbraith
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2021-03-17 10:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Mike Galbraith, Wang Qing, Ingo Molnar, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Daniel Bristot de Oliveira, linux-kernel

On Wed, Mar 17, 2021 at 10:46:18AM +0100, Ingo Molnar wrote:
> 
> * Mike Galbraith <efault@gmx.de> wrote:
> 
> > On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:
> > > 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
  2021-03-17  9:46   ` Ingo Molnar
  2021-03-17 10:35     ` Peter Zijlstra
@ 2021-03-17 10:41     ` Mike Galbraith
  2021-03-17 14:57       ` Thomas Gleixner
  1 sibling, 1 reply; 8+ messages in thread
From: Mike Galbraith @ 2021-03-17 10:41 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Wang Qing, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Daniel Bristot de Oliveira, linux-kernel

On Wed, 2021-03-17 at 10:46 +0100, Ingo Molnar wrote:
> * Mike Galbraith <efault@gmx.de> wrote:
>
> > On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:
> > > 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
  2021-03-17 10:41     ` Mike Galbraith
@ 2021-03-17 14:57       ` Thomas Gleixner
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Gleixner @ 2021-03-17 14:57 UTC (permalink / raw)
  To: Mike Galbraith, Ingo Molnar
  Cc: Wang Qing, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Daniel Bristot de Oliveira, linux-kernel

On Wed, Mar 17 2021 at 11:41, Mike Galbraith wrote:
> On Wed, 2021-03-17 at 10:46 +0100, Ingo Molnar wrote:
>> * Mike Galbraith <efault@gmx.de> wrote:
>>
>> > On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:
>> > > 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" :)

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re:Re: [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
  2021-03-17 10:35     ` Peter Zijlstra
@ 2021-03-18  2:14       ` 王擎
  2021-03-18  3:03         ` Mike Galbraith
  0 siblings, 1 reply; 8+ messages in thread
From: 王擎 @ 2021-03-18  2:14 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Mike Galbraith, Ingo Molnar, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Daniel Bristot de Oliveira, linux-kernel


>> 
>> * Mike Galbraith <efault@gmx.de> wrote:
>> 
>> > On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:
>> > > 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.

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [PATCH] sched: swait: use wake_up_process() instead of wake_up_state()
  2021-03-18  2:14       ` 王擎
@ 2021-03-18  3:03         ` Mike Galbraith
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Galbraith @ 2021-03-18  3:03 UTC (permalink / raw)
  To: 王擎, Peter Zijlstra
  Cc: Ingo Molnar, Ingo Molnar, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, linux-kernel

On Thu, 2021-03-18 at 10:14 +0800, 王擎 wrote:
> >>
> >> * Mike Galbraith <efault@gmx.de> wrote:
> >>
> >> > On Tue, 2021-03-16 at 19:20 +0800, Wang Qing wrote:
> >> > > 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.
>
> 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-18  3:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 11:20 [PATCH] sched: swait: use wake_up_process() instead of wake_up_state() Wang Qing
2021-03-17  4:43 ` Mike Galbraith
2021-03-17  9:46   ` Ingo Molnar
2021-03-17 10:35     ` Peter Zijlstra
2021-03-18  2:14       ` 王擎
2021-03-18  3:03         ` Mike Galbraith
2021-03-17 10:41     ` Mike Galbraith
2021-03-17 14:57       ` Thomas Gleixner

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).