All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: adilger@turbolabs.com
Cc: tim@physik3.uni-rostock.de, jgarzik@mandrakesoft.com,
	andrewm@uow.edu.au, linux-kernel@vger.kernel.org,
	torvalds@transmeta.com, netdev@oss.sgi.com, ak@muc.de,
	kuznet@ms2.inr.ac.ru
Subject: Re: [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup
Date: Wed, 07 Nov 2001 16:44:26 -0800 (PST)	[thread overview]
Message-ID: <20011107.164426.35502643.davem@redhat.com> (raw)
In-Reply-To: <20011107173626.S5922@lynx.no>
In-Reply-To: <Pine.LNX.4.30.0111080003320.29364-100000@gans.physik3.uni-rostock.de> <20011107.160950.57890584.davem@redhat.com> <20011107173626.S5922@lynx.no>

   From: Andreas Dilger <adilger@turbolabs.com>
   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@redhat.com

  reply	other threads:[~2001-11-08  0:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-08  0:00 [PATCH] net/ipv4/*, net/core/neighbour.c jiffies cleanup Tim Schmielau
2001-11-08  0:09 ` David S. Miller
2001-11-08  0:36   ` Andreas Dilger
2001-11-08  0:44     ` David S. Miller [this message]
2001-11-08  0:58       ` Tim Schmielau
2001-11-08  1:09         ` David S. Miller
2001-11-08  1:20           ` Tim Schmielau
2001-11-08  1:36             ` David S. Miller
2001-11-08  4:32       ` Andreas Dilger
2001-11-08  4:39         ` David S. Miller
2001-11-08  1:22     ` Linus Torvalds
2001-11-08 17:54   ` kuznet
2001-11-08 18:10     ` Tim Schmielau
2001-11-08 18:10     ` Andreas Dilger
2001-11-08 18:32       ` kuznet
  -- strict thread matches above, loose matches on Subject: below --
2001-11-08  3:07 Krishna Kumar
2001-11-08  5:26 ` Linus Torvalds
2001-11-08 16:55 Krishna Kumar
2001-11-08 17:10 ` Linus Torvalds
2001-11-08 18:01 ` Andreas Dilger
2001-11-09 10:43 ` Vino Thomas
2001-11-08 17:47 Krishna Kumar

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=20011107.164426.35502643.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=adilger@turbolabs.com \
    --cc=ak@muc.de \
    --cc=andrewm@uow.edu.au \
    --cc=jgarzik@mandrakesoft.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=tim@physik3.uni-rostock.de \
    --cc=torvalds@transmeta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.