netdev
[Top] [All Lists]

Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup

To: Krishna Kumar <kumarkr@xxxxxxxxxx>
Subject: Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup
From: Linus Torvalds <torvalds@xxxxxxxxxxxxx>
Date: Wed, 7 Nov 2001 21:26:11 -0800 (PST)
Cc: Andreas Dilger <adilger@xxxxxxxxxxxxx>, <ak@xxxxxx>, <andrewm@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>, <jgarzik@xxxxxxxxxxxxxxxx>, <kuznet@xxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <netdev@xxxxxxxxxxx>, <owner-netdev@xxxxxxxxxxx>, <tim@xxxxxxxxxxxxxxxxxxxxxx>
In-reply-to: <OF80A3FFE5.FC1D4628-ON88256AFE.0010957E@boulder.ibm.com>
Sender: owner-netdev@xxxxxxxxxxx
On Wed, 7 Nov 2001, Krishna Kumar wrote:
> >
> > In short: It is wrong to do
> >
> >          if (jiffies <= start+HZ)
> >
> > and it is _right_ to do
> >
> >          if (jiffies - start <= HZ)
>
> Actually this last part is wrong, isn't it ? jiffies <= start + HZ is also
> a correct way to do it, since start+HZ will overflow to the current value
> of jiffies when HZ time elapses. So the above two statements are IDENTICAL.

No.

Try it out with a few examples. You'll see.

                Linus


<Prev in Thread] Current Thread [Next in Thread>