mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Grouzdev <vladimir.grouzdev@Jaluna.COM>
To: linux-kernel@vger.kernel.org
Cc: johnstul@us.ibm.com
Subject: 2.6.8.1: xtime value may become incorrect
Date: Mon, 27 Sep 2004 17:22:30 +0200	[thread overview]
Message-ID: <41583036.9010907@jaluna.com> (raw)


    The xtime value may become incorrect when the
    update_wall_time(ticks) function is called with "ticks" > 1.
    In such a case, the xtime variable is updated multiple times
    inside the loop but it is normalized only once outside of
    the loop.

    This bug was reported at:

    http://bugme.osdl.org/show_bug.cgi?id=3403

    Patch to fix the problem:

diff -Nrca linux-2.6.8.1/kernel/timer.c linux-2.6.8.1-patched/kernel/timer.c
*** linux-2.6.8.1/kernel/timer.c    2004-08-14 12:56:00.000000000 +0200
--- linux-2.6.8.1-patched/kernel/timer.c    2004-09-27 
16:24:48.000000000 +0200
***************
*** 776,788 ****
      do {
          ticks--;
          update_wall_time_one_tick();
      } while (ticks);
-
-     if (xtime.tv_nsec >= 1000000000) {
-         xtime.tv_nsec -= 1000000000;
-         xtime.tv_sec++;
-         second_overflow();
-     }
  }
 
  static inline void do_process_times(struct task_struct *p,
--- 776,787 ----
      do {
          ticks--;
          update_wall_time_one_tick();
+         if (xtime.tv_nsec >= 1000000000) {
+             xtime.tv_nsec -= 1000000000;
+             xtime.tv_sec++;
+             second_overflow();
+         }
      } while (ticks);
  }
 
  static inline void do_process_times(struct task_struct *p,



             reply	other threads:[~2004-09-27 15:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-27 15:22 Vladimir Grouzdev [this message]
2004-09-27 15:52 ` john stultz

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=41583036.9010907@jaluna.com \
    --to=vladimir.grouzdev@jaluna.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®