mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ram Gupta" <ram.gupta5@gmail.com>
To: "Atsushi Nemoto" <anemo@mba.ocn.ne.jp>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH] fix potential jiffies overflow
Date: Thu, 2 Mar 2006 10:43:12 -0600	[thread overview]
Message-ID: <728201270603020843s4feacb1cv3a8acc620e636ffa@mail.gmail.com> (raw)
In-Reply-To: <20060303.000306.08077845.anemo@mba.ocn.ne.jp>

On 3/2/06, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> I found i386 timer_resume is updating jiffies, not jiffies_64.  It
> looks there is a potential overflow problem.  Is this a correct fix?
>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
>
> diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
> index a14d594..e4ed172 100644
> --- a/arch/i386/kernel/time.c
> +++ b/arch/i386/kernel/time.c
> @@ -413,7 +413,7 @@ static int timer_resume(struct sys_devic
>         xtime.tv_sec = sec;
>         xtime.tv_nsec = 0;
>         write_sequnlock_irqrestore(&xtime_lock, flags);
> -       jiffies += sleep_length;
> +       jiffies_64 += sleep_length;
>         wall_jiffies += sleep_length;
>         if (last_timer->resume)
>                 last_timer->resume();


The 64-bit jiffies value is not atomic. You need to hold xtime_lock to read it.

  reply	other threads:[~2006-03-02 16:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 15:03 Atsushi Nemoto
2006-03-02 16:43 ` Ram Gupta [this message]
2006-03-03  2:32   ` Atsushi Nemoto
2006-03-03  2:45     ` Andrew Morton
2006-03-03  3:31       ` Atsushi Nemoto
2006-03-03  3:48         ` Andrew Morton
2006-03-03  4:39           ` Atsushi Nemoto
2006-03-05  1:10         ` Matt Mackall

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=728201270603020843s4feacb1cv3a8acc620e636ffa@mail.gmail.com \
    --to=ram.gupta5@gmail.com \
    --cc=akpm@osdl.org \
    --cc=anemo@mba.ocn.ne.jp \
    --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®