| To: | adilger@xxxxxxxxxxxxx |
|---|---|
| Subject: | Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup |
| From: | "David S. Miller" <davem@xxxxxxxxxx> |
| Date: | Wed, 07 Nov 2001 16:44:26 -0800 (PST) |
| Cc: | tim@xxxxxxxxxxxxxxxxxxxxxx, jgarzik@xxxxxxxxxxxxxxxx, andrewm@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, ak@xxxxxx, kuznet@xxxxxxxxxxxxx |
| In-reply-to: | <20011107173626.S5922@lynx.no> |
| References: | <Pine.LNX.4.30.0111080003320.29364-100000@gans.physik3.uni-rostock.de> <20011107.160950.57890584.davem@redhat.com> <20011107173626.S5922@lynx.no> |
| Sender: | owner-netdev@xxxxxxxxxxx |
From: Andreas Dilger <adilger@xxxxxxxxxxxxx>
Date: Wed, 7 Nov 2001 17:36:27 -0700
No, only a limited number of them cast to a signed value, which means
that a large number of them get the comparison wrong in the case of
jiffies wrap (where the difference is a large unsigned value, and not
a small negative number).
Why do they these cases that are actually in the code need to cast to
a signed value to get a correct answer? They are not like your
example.
Almost all of these cases are:
(jiffies - SOME_VALUE_KNOWN_TO_BE_IN_THE_PAST) > 5 * HZ
So you say if we don't cast to signed, this won't get it right on
wrap-around? I disagree, let's say "long" is 32-bits and jiffies
wrapped around to "0x2" and SOME_VALUE... is 0xfffffff8. The
subtraction above yields 10, and that is what we want.
Please show me a bad case where casting to signed is necessary.
I actually ran through the tree the other night myself starting to
convert these things, then I noticed that I couldn't even convince
myself that the code was incorrect.
Franks a lot,
David S. Miller
davem@xxxxxxxxxx
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup, Andreas Dilger |
|---|---|
| Next by Date: | Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup, Tim Schmielau |
| Previous by Thread: | Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup, Andreas Dilger |
| Next by Thread: | Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup, Tim Schmielau |
| Indexes: | [Date] [Thread] [Top] [All Lists] |