public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: kill unused parameter of pick_next_task()
@ 2009-03-02  5:55 Wang Chen
  2009-03-02  6:13 ` Américo Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Wang Chen @ 2009-03-02  5:55 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

based on tip/sched/cleanups

impact: no change in functionality

Parameter "prev" seems like an unusable thing.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 kernel/sched.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 410eec4..57f8b12 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4512,7 +4512,7 @@ static inline void schedule_debug(struct task_struct *prev)
  * Pick up the highest-prio task:
  */
 static inline struct task_struct *
-pick_next_task(struct rq *rq, struct task_struct *prev)
+pick_next_task(struct rq *rq)
 {
 	const struct sched_class *class;
 	struct task_struct *p;
@@ -4587,7 +4587,7 @@ need_resched_nonpreemptible:
 		idle_balance(cpu, rq);
 
 	prev->sched_class->put_prev_task(rq, prev);
-	next = pick_next_task(rq, prev);
+	next = pick_next_task(rq);
 
 	if (likely(prev != next)) {
 		sched_info_switch(prev, next);
@@ -6423,7 +6423,7 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
 		if (!rq->nr_running)
 			break;
 		update_rq_clock(rq);
-		next = pick_next_task(rq, rq->curr);
+		next = pick_next_task(rq);
 		if (!next)
 			break;
 		next->sched_class->put_prev_task(rq, next);
-- 
1.5.3.4




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

* Re: [PATCH] sched: kill unused parameter of pick_next_task()
  2009-03-02  5:55 [PATCH] sched: kill unused parameter of pick_next_task() Wang Chen
@ 2009-03-02  6:13 ` Américo Wang
  2009-03-02  6:52   ` Wang Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Américo Wang @ 2009-03-02  6:13 UTC (permalink / raw)
  To: Wang Chen; +Cc: Ingo Molnar, linux-kernel

On Mon, Mar 02, 2009 at 01:55:26PM +0800, Wang Chen wrote:
>based on tip/sched/cleanups
>
>impact: no change in functionality
>
>Parameter "prev" seems like an unusable thing.
>
>Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
>---
> kernel/sched.c |    6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/kernel/sched.c b/kernel/sched.c
>index 410eec4..57f8b12 100644
>--- a/kernel/sched.c
>+++ b/kernel/sched.c
>@@ -4512,7 +4512,7 @@ static inline void schedule_debug(struct task_struct *prev)
>  * Pick up the highest-prio task:
>  */
> static inline struct task_struct *
>-pick_next_task(struct rq *rq, struct task_struct *prev)
>+pick_next_task(struct rq *rq)
> {
> 	const struct sched_class *class;
> 	struct task_struct *p;
>@@ -4587,7 +4587,7 @@ need_resched_nonpreemptible:
> 		idle_balance(cpu, rq);
> 
> 	prev->sched_class->put_prev_task(rq, prev);
        ^^^^^

How about this? :)

>-	next = pick_next_task(rq, prev);
>+	next = pick_next_task(rq);
> 
> 	if (likely(prev != next)) {
                   ^^^^

also here.

> 		sched_info_switch(prev, next);
>@@ -6423,7 +6423,7 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
> 		if (!rq->nr_running)
> 			break;
> 		update_rq_clock(rq);
>-		next = pick_next_task(rq, rq->curr);
>+		next = pick_next_task(rq);
> 		if (!next)
> 			break;
> 		next->sched_class->put_prev_task(rq, next);


I think you should check the latest linus-git, where you can safely
just remove the parameter 'prev'.


-- 
Do what you love, f**k the rest! F**k the regulations!
 

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

* Re: [PATCH] sched: kill unused parameter of pick_next_task()
  2009-03-02  6:13 ` Américo Wang
@ 2009-03-02  6:52   ` Wang Chen
  2009-03-02  7:44     ` Américo Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Wang Chen @ 2009-03-02  6:52 UTC (permalink / raw)
  To: Américo Wang; +Cc: Ingo Molnar, linux-kernel

Américo Wang said the following on 2009-3-2 14:13:
> On Mon, Mar 02, 2009 at 01:55:26PM +0800, Wang Chen wrote:
>> based on tip/sched/cleanups
>>
>> impact: no change in functionality
>>
>> Parameter "prev" seems like an unusable thing.
>>
>> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
>> ---
>> kernel/sched.c |    6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/kernel/sched.c b/kernel/sched.c
>> index 410eec4..57f8b12 100644
>> --- a/kernel/sched.c
>> +++ b/kernel/sched.c
>> @@ -4512,7 +4512,7 @@ static inline void schedule_debug(struct task_struct *prev)
>>  * Pick up the highest-prio task:
>>  */
>> static inline struct task_struct *
>> -pick_next_task(struct rq *rq, struct task_struct *prev)
>> +pick_next_task(struct rq *rq)
>> {
>> 	const struct sched_class *class;
>> 	struct task_struct *p;
>> @@ -4587,7 +4587,7 @@ need_resched_nonpreemptible:
>> 		idle_balance(cpu, rq);
>>
>> 	prev->sched_class->put_prev_task(rq, prev);
>         ^^^^^
> 
> How about this? :)
> 

need_resched_nonpreemptible is inside another function instead of pick_next_task().
Because "diff" doesn't know "asmlinkage void __sched schedule(void)".
;)

>> -	next = pick_next_task(rq, prev);
>> +	next = pick_next_task(rq);
>>
>> 	if (likely(prev != next)) {
>                    ^^^^
> 
> also here.
> 
>> 		sched_info_switch(prev, next);
>> @@ -6423,7 +6423,7 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
>> 		if (!rq->nr_running)
>> 			break;
>> 		update_rq_clock(rq);
>> -		next = pick_next_task(rq, rq->curr);
>> +		next = pick_next_task(rq);
>> 		if (!next)
>> 			break;
>> 		next->sched_class->put_prev_task(rq, next);
> 
> 
> I think you should check the latest linus-git, where you can safely
> just remove the parameter 'prev'.
> 


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

* Re: [PATCH] sched: kill unused parameter of pick_next_task()
  2009-03-02  6:52   ` Wang Chen
@ 2009-03-02  7:44     ` Américo Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Américo Wang @ 2009-03-02  7:44 UTC (permalink / raw)
  To: Wang Chen; +Cc: Américo Wang, Ingo Molnar, linux-kernel

On Mon, Mar 02, 2009 at 02:52:54PM +0800, Wang Chen wrote:
>Américo Wang said the following on 2009-3-2 14:13:
>> On Mon, Mar 02, 2009 at 01:55:26PM +0800, Wang Chen wrote:
>>> based on tip/sched/cleanups
>>>
>>> impact: no change in functionality
>>>
>>> Parameter "prev" seems like an unusable thing.
>>>
>>> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
>>> ---
>>> kernel/sched.c |    6 +++---
>>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/kernel/sched.c b/kernel/sched.c
>>> index 410eec4..57f8b12 100644
>>> --- a/kernel/sched.c
>>> +++ b/kernel/sched.c
>>> @@ -4512,7 +4512,7 @@ static inline void schedule_debug(struct task_struct *prev)
>>>  * Pick up the highest-prio task:
>>>  */
>>> static inline struct task_struct *
>>> -pick_next_task(struct rq *rq, struct task_struct *prev)
>>> +pick_next_task(struct rq *rq)
>>> {
>>> 	const struct sched_class *class;
>>> 	struct task_struct *p;
>>> @@ -4587,7 +4587,7 @@ need_resched_nonpreemptible:
>>> 		idle_balance(cpu, rq);
>>>
>>> 	prev->sched_class->put_prev_task(rq, prev);
>>         ^^^^^
>> 
>> How about this? :)
>> 
>
>need_resched_nonpreemptible is inside another function instead of pick_next_task().
>Because "diff" doesn't know "asmlinkage void __sched schedule(void)".
>;)
>

Oops, I misread the patch. Then it's OK. :)


-- 
Do what you love, f**k the rest! F**k the regulations!
 

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

end of thread, other threads:[~2009-03-02  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-02  5:55 [PATCH] sched: kill unused parameter of pick_next_task() Wang Chen
2009-03-02  6:13 ` Américo Wang
2009-03-02  6:52   ` Wang Chen
2009-03-02  7:44     ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox