public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: sched: Fix signedness bug in yield_to()
       [not found] <20130220022712.0E8586607A4@gitolite.kernel.org>
@ 2013-02-21  0:31 ` Shuah Khan
  2013-02-21  8:56   ` Ingo Molnar
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2013-02-21  0:31 UTC (permalink / raw)
  To: dan.carpenter, peterz, mingo
  Cc: Linux Kernel Mailing List, torvalds, Shuah Khan

On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
> Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
> Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
> Author:     Dan Carpenter <dan.carpenter@oracle.com>
> AuthorDate: Tue Feb 5 14:37:51 2013 +0300
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Tue Feb 5 12:59:29 2013 +0100
>
>     sched: Fix signedness bug in yield_to()
>
>     In 7b270f6099 "sched: Bail out of yield_to when source and
>     target runqueue has one task" we changed this to store -ESRCH so
>     it needs to be signed.

Dan, Ingo,

I can't find the 7b270f6099 "sched: Bail out of yield_to when source
and  target runqueue has one task" in the latest Linus's git. Am I
missing something.

The current kenel/sched/core.c doesn't have the code from the
associated patch https://patchwork.kernel.org/patch/2016651/

>  bool __sched yield_to(struct task_struct *p, bool preempt)
>  {
> @@ -4303,6 +4306,15 @@ bool __sched yield_to(struct task_struct *p, bool preempt)
>
>  again:
>  	p_rq = task_rq(p);
> +	/*
> +	 * If we're the only runnable task on the rq and target rq also
> +	 * has only one task, there's absolutely no point in yielding.
> +	 */
> +	if (rq->nr_running == 1 && p_rq->nr_running == 1) {
> +		yielded = -ESRCH;
> +		goto out_irq;
> +	}

Without the 7b270f6099 "sched: Bail out of yield_to when source and
target runqueue has one task", do you need this change?

Am I missing something?

-- Shuah

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

* Re: sched: Fix signedness bug in yield_to()
  2013-02-21  0:31 ` sched: Fix signedness bug in yield_to() Shuah Khan
@ 2013-02-21  8:56   ` Ingo Molnar
  2013-02-21 10:05     ` Raghavendra KT
  2013-02-21 23:26     ` Marcelo Tosatti
  0 siblings, 2 replies; 8+ messages in thread
From: Ingo Molnar @ 2013-02-21  8:56 UTC (permalink / raw)
  To: Shuah Khan, Marcelo Tosatti
  Cc: dan.carpenter, peterz, Linux Kernel Mailing List, torvalds


* Shuah Khan <shuahkhan@gmail.com> wrote:

> On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org> wrote:
> > Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
> > Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
> > Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
> > Author:     Dan Carpenter <dan.carpenter@oracle.com>
> > AuthorDate: Tue Feb 5 14:37:51 2013 +0300
> > Committer:  Ingo Molnar <mingo@kernel.org>
> > CommitDate: Tue Feb 5 12:59:29 2013 +0100
> >
> >     sched: Fix signedness bug in yield_to()
> >
> >     In 7b270f6099 "sched: Bail out of yield_to when source and
> >     target runqueue has one task" we changed this to store -ESRCH so
> >     it needs to be signed.
> 
> Dan, Ingo,
> 
> I can't find the 7b270f6099 "sched: Bail out of yield_to when 
> source and target runqueue has one task" in the latest Linus's 
> git. Am I missing something.
> 
> The current kenel/sched/core.c doesn't have the code from the
> associated patch https://patchwork.kernel.org/patch/2016651/

As per the lkml discussion that one was supposed to go upstream 
via the KVM tree. Marcelo?

Thanks,

	Ingo

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

* Re: sched: Fix signedness bug in yield_to()
  2013-02-21  8:56   ` Ingo Molnar
@ 2013-02-21 10:05     ` Raghavendra KT
  2013-02-21 15:50       ` Shuah Khan
  2013-02-21 23:26     ` Marcelo Tosatti
  1 sibling, 1 reply; 8+ messages in thread
From: Raghavendra KT @ 2013-02-21 10:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Shuah Khan, Marcelo Tosatti, dan.carpenter, peterz,
	Linux Kernel Mailing List, torvalds

On Thu, Feb 21, 2013 at 2:26 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Shuah Khan <shuahkhan@gmail.com> wrote:
>
>> On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
>> <linux-kernel@vger.kernel.org> wrote:
>> > Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
>> > Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
>> > Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
>> > Author:     Dan Carpenter <dan.carpenter@oracle.com>
>> > AuthorDate: Tue Feb 5 14:37:51 2013 +0300
>> > Committer:  Ingo Molnar <mingo@kernel.org>
>> > CommitDate: Tue Feb 5 12:59:29 2013 +0100
>> >
>> >     sched: Fix signedness bug in yield_to()
>> >
>> >     In 7b270f6099 "sched: Bail out of yield_to when source and
>> >     target runqueue has one task" we changed this to store -ESRCH so
>> >     it needs to be signed.
>>
>> Dan, Ingo,
>>
>> I can't find the 7b270f6099 "sched: Bail out of yield_to when
>> source and target runqueue has one task" in the latest Linus's
>> git. Am I missing something.
>>
>> The current kenel/sched/core.c doesn't have the code from the
>> associated patch https://patchwork.kernel.org/patch/2016651/
>
> As per the lkml discussion that one was supposed to go upstream
> via the KVM tree. Marcelo?
>

It is going via KVM tree. (as per Gleb's pull request)

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

* Re: sched: Fix signedness bug in yield_to()
  2013-02-21 10:05     ` Raghavendra KT
@ 2013-02-21 15:50       ` Shuah Khan
  0 siblings, 0 replies; 8+ messages in thread
From: Shuah Khan @ 2013-02-21 15:50 UTC (permalink / raw)
  To: Raghavendra KT
  Cc: Ingo Molnar, Marcelo Tosatti, dan.carpenter, peterz,
	Linux Kernel Mailing List, torvalds

On Thu, Feb 21, 2013 at 3:05 AM, Raghavendra KT
<raghavendra.kt.linux@gmail.com> wrote:
> On Thu, Feb 21, 2013 at 2:26 PM, Ingo Molnar <mingo@kernel.org> wrote:
>>
>> * Shuah Khan <shuahkhan@gmail.com> wrote:
>>
>>> On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
>>> <linux-kernel@vger.kernel.org> wrote:
>>> > Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
>>> > Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
>>> > Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
>>> > Author:     Dan Carpenter <dan.carpenter@oracle.com>
>>> > AuthorDate: Tue Feb 5 14:37:51 2013 +0300
>>> > Committer:  Ingo Molnar <mingo@kernel.org>
>>> > CommitDate: Tue Feb 5 12:59:29 2013 +0100
>>> >
>>> >     sched: Fix signedness bug in yield_to()
>>> >
>>> >     In 7b270f6099 "sched: Bail out of yield_to when source and
>>> >     target runqueue has one task" we changed this to store -ESRCH so
>>> >     it needs to be signed.
>>>
>>> Dan, Ingo,
>>>
>>> I can't find the 7b270f6099 "sched: Bail out of yield_to when
>>> source and target runqueue has one task" in the latest Linus's
>>> git. Am I missing something.
>>>
>>> The current kenel/sched/core.c doesn't have the code from the
>>> associated patch https://patchwork.kernel.org/patch/2016651/
>>
>> As per the lkml discussion that one was supposed to go upstream
>> via the KVM tree. Marcelo?
>>
>
> It is going via KVM tree. (as per Gleb's pull request)

Thanks. Do you see these two commits as stable release candidates?

-- Shuah

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

* Re: sched: Fix signedness bug in yield_to()
  2013-02-21  8:56   ` Ingo Molnar
  2013-02-21 10:05     ` Raghavendra KT
@ 2013-02-21 23:26     ` Marcelo Tosatti
  2013-02-22  6:42       ` Raghavendra KT
  2013-02-22  9:43       ` Ingo Molnar
  1 sibling, 2 replies; 8+ messages in thread
From: Marcelo Tosatti @ 2013-02-21 23:26 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Shuah Khan, dan.carpenter, peterz, Linux Kernel Mailing List,
	torvalds

On Thu, Feb 21, 2013 at 09:56:54AM +0100, Ingo Molnar wrote:
> 
> * Shuah Khan <shuahkhan@gmail.com> wrote:
> 
> > On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
> > <linux-kernel@vger.kernel.org> wrote:
> > > Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
> > > Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
> > > Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
> > > Author:     Dan Carpenter <dan.carpenter@oracle.com>
> > > AuthorDate: Tue Feb 5 14:37:51 2013 +0300
> > > Committer:  Ingo Molnar <mingo@kernel.org>
> > > CommitDate: Tue Feb 5 12:59:29 2013 +0100
> > >
> > >     sched: Fix signedness bug in yield_to()
> > >
> > >     In 7b270f6099 "sched: Bail out of yield_to when source and
> > >     target runqueue has one task" we changed this to store -ESRCH so
> > >     it needs to be signed.
> > 
> > Dan, Ingo,
> > 
> > I can't find the 7b270f6099 "sched: Bail out of yield_to when 
> > source and target runqueue has one task" in the latest Linus's 
> > git. Am I missing something.
> > 
> > The current kenel/sched/core.c doesn't have the code from the
> > associated patch https://patchwork.kernel.org/patch/2016651/
> 
> As per the lkml discussion that one was supposed to go upstream 
> via the KVM tree. Marcelo?

commit c3c186403c6abd32e719f005f0af950155a9e54d
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Tue Feb 5 14:37:51 2013 +0300

    sched: Fix signedness bug in yield_to()
    
    In 7b270f6099 "sched: Bail out of yield_to when source and
    target runqueue has one task" we changed this to store -ESRCH so
    it needs to be signed.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: kbuild@01.org
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Link: http://lkml.kernel.org/r/20130205113751.GA20521@elgon.mountain
    Signed-off-by: Ingo Molnar <mingo@kernel.org>


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

* Re: sched: Fix signedness bug in yield_to()
  2013-02-21 23:26     ` Marcelo Tosatti
@ 2013-02-22  6:42       ` Raghavendra KT
  2013-02-22 16:06         ` Shuah Khan
  2013-02-22  9:43       ` Ingo Molnar
  1 sibling, 1 reply; 8+ messages in thread
From: Raghavendra KT @ 2013-02-22  6:42 UTC (permalink / raw)
  To: Marcelo Tosatti, dan.carpenter
  Cc: Ingo Molnar, Shuah Khan, peterz, Linux Kernel Mailing List,
	torvalds

On Fri, Feb 22, 2013 at 4:56 AM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
> On Thu, Feb 21, 2013 at 09:56:54AM +0100, Ingo Molnar wrote:
>>
>> * Shuah Khan <shuahkhan@gmail.com> wrote:
>>
>> > On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
>> > <linux-kernel@vger.kernel.org> wrote:
>> > > Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
>> > > Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
>> > > Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
>> > > Author:     Dan Carpenter <dan.carpenter@oracle.com>
>> > > AuthorDate: Tue Feb 5 14:37:51 2013 +0300
>> > > Committer:  Ingo Molnar <mingo@kernel.org>
>> > > CommitDate: Tue Feb 5 12:59:29 2013 +0100
>> > >
>> > >     sched: Fix signedness bug in yield_to()
>> > >
>> > >     In 7b270f6099 "sched: Bail out of yield_to when source and
>> > >     target runqueue has one task" we changed this to store -ESRCH so
>> > >     it needs to be signed.
>> >
>> > Dan, Ingo,
>> >
>> > I can't find the 7b270f6099 "sched: Bail out of yield_to when
>> > source and target runqueue has one task" in the latest Linus's
>> > git. Am I missing something.
>> >
>> > The current kenel/sched/core.c doesn't have the code from the
>> > associated patch https://patchwork.kernel.org/patch/2016651/
>>
>> As per the lkml discussion that one was supposed to go upstream
>> via the KVM tree. Marcelo?
>
> commit c3c186403c6abd32e719f005f0af950155a9e54d
> Author: Dan Carpenter <dan.carpenter@oracle.com>
> Date:   Tue Feb 5 14:37:51 2013 +0300
>
>     sched: Fix signedness bug in yield_to()
>
>     In 7b270f6099 "sched: Bail out of yield_to when source and
>     target runqueue has one task" we changed this to store -ESRCH so
>     it needs to be signed.
>
>     Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>     Cc: Peter Zijlstra <peterz@infradead.org>
>     Cc: kbuild@01.org
>     Cc: Steven Rostedt <rostedt@goodmis.org>
>     Cc: Mike Galbraith <efault@gmx.de>
>     Link: http://lkml.kernel.org/r/20130205113751.GA20521@elgon.mountain
>     Signed-off-by: Ingo Molnar <mingo@kernel.org>
>

IIUC, we are only changing variable in yield_to  from bool to int.
I am curious whether we need changes in struct  sched_class (sched.h)

 bool (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt);
==>
int (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt);

otherwise we would assign bool value  to int here

 yielded = curr->sched_class->yield_to_task(rq, p, preempt);

this return values also cascaded to kvm_main.c.

If we need to patchup entire thing, I can cook a correction patch.

Thanks and Regards
Raghu

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

* Re: sched: Fix signedness bug in yield_to()
  2013-02-21 23:26     ` Marcelo Tosatti
  2013-02-22  6:42       ` Raghavendra KT
@ 2013-02-22  9:43       ` Ingo Molnar
  1 sibling, 0 replies; 8+ messages in thread
From: Ingo Molnar @ 2013-02-22  9:43 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: Shuah Khan, dan.carpenter, peterz, Linux Kernel Mailing List,
	torvalds


* Marcelo Tosatti <mtosatti@redhat.com> wrote:

> On Thu, Feb 21, 2013 at 09:56:54AM +0100, Ingo Molnar wrote:
> > 
> > * Shuah Khan <shuahkhan@gmail.com> wrote:
> > 
> > > On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
> > > <linux-kernel@vger.kernel.org> wrote:
> > > > Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
> > > > Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
> > > > Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
> > > > Author:     Dan Carpenter <dan.carpenter@oracle.com>
> > > > AuthorDate: Tue Feb 5 14:37:51 2013 +0300
> > > > Committer:  Ingo Molnar <mingo@kernel.org>
> > > > CommitDate: Tue Feb 5 12:59:29 2013 +0100
> > > >
> > > >     sched: Fix signedness bug in yield_to()
> > > >
> > > >     In 7b270f6099 "sched: Bail out of yield_to when source and
> > > >     target runqueue has one task" we changed this to store -ESRCH so
> > > >     it needs to be signed.
> > > 
> > > Dan, Ingo,
> > > 
> > > I can't find the 7b270f6099 "sched: Bail out of yield_to when 
> > > source and target runqueue has one task" in the latest Linus's 
> > > git. Am I missing something.
> > > 
> > > The current kenel/sched/core.c doesn't have the code from the
> > > associated patch https://patchwork.kernel.org/patch/2016651/
> > 
> > As per the lkml discussion that one was supposed to go upstream 
> > via the KVM tree. Marcelo?
> 
> commit c3c186403c6abd32e719f005f0af950155a9e54d
> Author: Dan Carpenter <dan.carpenter@oracle.com>
> Date:   Tue Feb 5 14:37:51 2013 +0300
> 
>     sched: Fix signedness bug in yield_to()

I meant the other patch - the two got disassociated.

Thanks,

	Ingo

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

* Re: sched: Fix signedness bug in yield_to()
  2013-02-22  6:42       ` Raghavendra KT
@ 2013-02-22 16:06         ` Shuah Khan
  0 siblings, 0 replies; 8+ messages in thread
From: Shuah Khan @ 2013-02-22 16:06 UTC (permalink / raw)
  To: Raghavendra KT
  Cc: Marcelo Tosatti, dan.carpenter, Ingo Molnar, peterz,
	Linux Kernel Mailing List, torvalds

On Thu, Feb 21, 2013 at 11:42 PM, Raghavendra KT
<raghavendra.kt.linux@gmail.com> wrote:
> On Fri, Feb 22, 2013 at 4:56 AM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
>> On Thu, Feb 21, 2013 at 09:56:54AM +0100, Ingo Molnar wrote:
>>>
>>> * Shuah Khan <shuahkhan@gmail.com> wrote:
>>>
>>> > On Tue, Feb 19, 2013 at 7:27 PM, Linux Kernel Mailing List
>>> > <linux-kernel@vger.kernel.org> wrote:
>>> > > Gitweb:     http://git.kernel.org/linus/;a=commit;h=c3c186403c6abd32e719f005f0af950155a9e54d
>>> > > Commit:     c3c186403c6abd32e719f005f0af950155a9e54d
>>> > > Parent:     e0a79f529d5ba2507486d498b25da40911d95cf6
>>> > > Author:     Dan Carpenter <dan.carpenter@oracle.com>
>>> > > AuthorDate: Tue Feb 5 14:37:51 2013 +0300
>>> > > Committer:  Ingo Molnar <mingo@kernel.org>
>>> > > CommitDate: Tue Feb 5 12:59:29 2013 +0100
>>> > >
>>> > >     sched: Fix signedness bug in yield_to()
>>> > >
>>> > >     In 7b270f6099 "sched: Bail out of yield_to when source and
>>> > >     target runqueue has one task" we changed this to store -ESRCH so
>>> > >     it needs to be signed.
>>> >
>>> > Dan, Ingo,
>>> >
>>> > I can't find the 7b270f6099 "sched: Bail out of yield_to when
>>> > source and target runqueue has one task" in the latest Linus's
>>> > git. Am I missing something.
>>> >
>>> > The current kenel/sched/core.c doesn't have the code from the
>>> > associated patch https://patchwork.kernel.org/patch/2016651/
>>>
>>> As per the lkml discussion that one was supposed to go upstream
>>> via the KVM tree. Marcelo?
>>
>> commit c3c186403c6abd32e719f005f0af950155a9e54d
>> Author: Dan Carpenter <dan.carpenter@oracle.com>
>> Date:   Tue Feb 5 14:37:51 2013 +0300
>>
>>     sched: Fix signedness bug in yield_to()
>>
>>     In 7b270f6099 "sched: Bail out of yield_to when source and
>>     target runqueue has one task" we changed this to store -ESRCH so
>>     it needs to be signed.
>>
>>     Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>     Cc: Peter Zijlstra <peterz@infradead.org>
>>     Cc: kbuild@01.org
>>     Cc: Steven Rostedt <rostedt@goodmis.org>
>>     Cc: Mike Galbraith <efault@gmx.de>
>>     Link: http://lkml.kernel.org/r/20130205113751.GA20521@elgon.mountain
>>     Signed-off-by: Ingo Molnar <mingo@kernel.org>
>>
>
> IIUC, we are only changing variable in yield_to  from bool to int.
> I am curious whether we need changes in struct  sched_class (sched.h)
>
>  bool (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt);
> ==>
> int (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt);
>
> otherwise we would assign bool value  to int here
>
>  yielded = curr->sched_class->yield_to_task(rq, p, preempt);
>
> this return values also cascaded to kvm_main.c.
>
> If we need to patchup entire thing, I can cook a correction patch.
>
> Thanks and Regards
> Raghu

Right/. I was attempting to back-port
c3c186403c6abd32e719f005f0af950155a9e54d to stables when I noticed the
discrepancy. My concerns are:

1. Does it make sense to have c3c186403c6abd32e719f005f0af950155a9e54d
in without 7b270f6099 "sched: Bail out of yield_to when source and
target runqueue has one task" and?
2. Second concern is, is c3c186403c6abd32e719f005f0af950155a9e54d is
enough or more changes are needed? does __yield_to prototype needs
changes as well.

-- Shuah

-- Shuah

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

end of thread, other threads:[~2013-02-22 16:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20130220022712.0E8586607A4@gitolite.kernel.org>
2013-02-21  0:31 ` sched: Fix signedness bug in yield_to() Shuah Khan
2013-02-21  8:56   ` Ingo Molnar
2013-02-21 10:05     ` Raghavendra KT
2013-02-21 15:50       ` Shuah Khan
2013-02-21 23:26     ` Marcelo Tosatti
2013-02-22  6:42       ` Raghavendra KT
2013-02-22 16:06         ` Shuah Khan
2013-02-22  9:43       ` Ingo Molnar

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