[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130529215005.c91c75de.akpm@linux-foundation.org>
Date: Wed, 29 May 2013 21:50:05 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Joe Perches <joe@...ches.com>
Cc: Bart Van Assche <bart.vanassche@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Arjan van de Ven <arjan@...radead.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-kernel <linux-kernel@...r.kernel.org>,
Miklos Szeredi <miklos@...redi.hu>
Subject: Re: [PATCH] timer: Fix jiffies wrap behavior of round_jiffies*()
On Wed, 29 May 2013 17:13:49 -0700 Joe Perches <joe@...ches.com> wrote:
> On Wed, 2013-05-29 at 16:38 -0700, Andrew Morton wrote:
> > On Wed, 29 May 2013 16:17:47 -0700 Joe Perches <joe@...ches.com> wrote:
> >
> > > > We could perhaps have a checkpatch rule
> > > > which looks for comparisons against jiffes (and any other
> > > > time-measuring variables we can detect)
> > >
> > > other variables like?
> >
> > Grepping for time_after finds a bunch. There's no real pattern to it though.
>
> get_jiffies_64() should probably be added as
> another test too.
>
> Also, these might be wrong:
>
> arch/arm/kernel/smp_twd.c: while (get_jiffies_64() < waitjiffies)
> arch/arm/kernel/smp_twd.c: while (get_jiffies_64() < waitjiffies)
> fs/fuse/dir.c: else if (fuse_dentry_time(entry) < get_jiffies_64()) {
> fs/fuse/dir.c: if (fi->i_time < get_jiffies_64()) {
> fs/fuse/dir.c: if (fi->i_time < get_jiffies_64()) {
>
Yup. Normally a 64-bit jiffy will wrap around shortly after the heat
death of the universe, but
a) it's derived from jiffies, which we evilly cause to wrap after 5
minutes uptime and
b) it's derived from jiffies, which is 32-bit on 32-bit and hence
wraps every 49 days (HZ=1000).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists