public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John <linux.kernel@free.fr>
To: tglx@linutronix.de
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, john stultz <johnstul@us.ibm.com>,
	Roman Zippel <zippel@linux-m68k.org>,
	Mike Galbraith <efault@gmx.de>,
	Ken Chen <kenneth.w.chen@intel.com>,
	balducci@units.it, Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org, linux.kernel@free.fr
Subject: Re: [PATCH] Fix posix-cpu-timer breakage caused by stale p->last_ran value
Date: Thu, 22 Feb 2007 17:49:03 +0100	[thread overview]
Message-ID: <45DDC97F.7000602@free.fr> (raw)
In-Reply-To: <fa.cIP2OCge0gIF8cSETEmZ9D2dxpE@ifi.uio.no>

Thomas Gleixner wrote:

> Problem description at:
> http://bugzilla.kernel.org/show_bug.cgi?id=8048
> 
> Commit b18ec80396834497933d77b81ec0918519f4e2a7 
>     [PATCH] sched: improve migration accuracy
> optimized the scheduler time calculations, but broke posix-cpu-timers.
> 
> The problem is that the p->last_ran value is not updated after a context
> switch. So a subsequent call to current_sched_time() calculates with a
> stale p->last_ran value, i.e. accounts the full time, which the task was
> scheduled away.

Could you expand on the impact of this bug for non-kernel hackers? :-)

I'm currently testing 2.6.20-rt5. My app runs in SCHED_RR and just 
blocks waiting for several signals. Since my app is the only SCHED_RR 
process running on the system, I get the impression that I'm not 
affected by this bug. Is that correct?

> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> Index: linux-2.6/kernel/sched.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched.c
> +++ linux-2.6/kernel/sched.c
> @@ -3566,7 +3566,7 @@ switch_tasks:
>  
>  	sched_info_switch(prev, next);
>  	if (likely(prev != next)) {
> -		next->timestamp = now;
> +		next->timestamp = next->last_ran = now;
>  		rq->nr_switches++;
>  		rq->curr = next;
>  		++*switch_count;

Regards,

John

       reply	other threads:[~2007-02-22 16:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.5d4W3Gwb5Gw7ztDfk2utJt1zgjc@ifi.uio.no>
     [not found] ` <fa.cIP2OCge0gIF8cSETEmZ9D2dxpE@ifi.uio.no>
2007-02-22 16:49   ` John [this message]
     [not found] <20070221104747.3cb0da32.akpm@linux-foundation.org>
2007-02-22  0:33 ` [PATCH] Fix posix-cpu-timer breakage caused by stale p->last_ran value Thomas Gleixner
2007-02-22  7:46   ` Ingo Molnar
2007-02-22  8:01     ` Thomas Gleixner
2007-02-22  9:16   ` Mike Galbraith
2007-03-01 23:45   ` Chuck Ebbert
2007-03-02  0:27     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45DDC97F.7000602@free.fr \
    --to=linux.kernel@free.fr \
    --cc=akpm@linux-foundation.org \
    --cc=balducci@units.it \
    --cc=efault@gmx.de \
    --cc=greg@kroah.com \
    --cc=johnstul@us.ibm.com \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox