time_after - what on earth???

Previous thread: [PATCH 0/6] Use one zonelist per node instead of multiple zonelists v5 (resend) by Mel Gorman on Tuesday, September 11, 2007 - 2:30 pm. (12 messages)

Next thread: [git patches] ocfs2 fixes by Mark Fasheh on Tuesday, September 11, 2007 - 3:32 pm. (1 message)
From: Adrian McMenamin
Date: Tuesday, September 11, 2007 - 3:05 pm

OK, why does this line occasionally return true:

	if ((maple_dev->interval > 0) && (jiffies >maple_dev->when))

while this one never does (no other changes made):

if  ((maple_dev->interval > 0) && (time_after(jiffies, maple_dev->when)))


Is this a gcc issue or what?
-

From: Rene Herman
Date: Tuesday, September 11, 2007 - 3:11 pm

Is maple_dev->when an unsigned long?

Rene.
-

From: Adrian McMenamin
Date: Tuesday, September 11, 2007 - 3:15 pm

Yes. Does that make a difference?
-

From: Rene Herman
Date: Tuesday, September 11, 2007 - 3:19 pm

If it had been a signed type, it could've wrapped to something you didn't 
expect, explaining the difference at least...

With an unsigned long, the only diference should be that time_after() deals 
with jiffie wrapping which I assume is not an actual problem here. I'll 
retreat into the shades again... ;-(

Rene.

-

From: B.Steinbrink
Date: Tuesday, September 11, 2007 - 4:09 pm

What exactly is "occassionally"?  Does it happen more than once per
boot? If not, and it happens after a certain time after booting, it

If "occasionally" is limited to once per boot, it might be jiffie
wrapping. IIRC jiffies are initialized so that they wrap after about 5
minutes of uptime to reveal such bugs without forcing you to wait for
ages just to have the counter wrap for the first time.

Bj
From: Adrian McMenamin
Date: Tuesday, September 11, 2007 - 4:10 pm

On 12/09/2007, Bj
From: B.Steinbrink
Date: Tuesday, September 11, 2007 - 4:50 pm

On 2007.09.12 00:10:19 +0100, Adrian McMenamin wrote:
> On 12/09/2007, Bj
From: Adrian McMenamin
Date: Tuesday, September 11, 2007 - 5:03 pm

On 12/09/2007, Bj
From: Rene Herman
Date: Tuesday, September 11, 2007 - 4:16 pm

On 09/12/2007 01:09 AM, Bj
Previous thread: [PATCH 0/6] Use one zonelist per node instead of multiple zonelists v5 (resend) by Mel Gorman on Tuesday, September 11, 2007 - 2:30 pm. (12 messages)

Next thread: [git patches] ocfs2 fixes by Mark Fasheh on Tuesday, September 11, 2007 - 3:32 pm. (1 message)