All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: "David S. Miller" <davem@redhat.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, 7 Nov 2001 17:36:27 -0700	[thread overview]
Message-ID: <20011107173626.S5922@lynx.no> (raw)
In-Reply-To: <Pine.LNX.4.30.0111080003320.29364-100000@gans.physik3.uni-rostock.de> <20011107.160950.57890584.davem@redhat.com>
In-Reply-To: <20011107.160950.57890584.davem@redhat.com>; from davem@redhat.com on Wed, Nov 07, 2001 at 04:09:50PM -0800

On Nov 07, 2001  16:09 -0800, David S. Miller wrote:
>    From: Tim Schmielau <tim@physik3.uni-rostock.de>
> 
>    jiffies cleanup patch of the day follows. Mostly boring changes of jiffies
>    comparisons to use time_{before,after} in order to handle jiffies
>    wraparound correctly.
> 
> These cases handle wraparound correctly!!!!
> 
> Please stop sending these changes, start thinking about what the
> code is doing.
> 
> It is comparing a "DIFFERRENCE" not raw jiffy values with each other.
> It works just fine.

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).


This is not just idle change.  Tim has problems when jiffies is
initialized to a pre-wrap value at boot, and changing everything to
use time_{before,after} is the only easy way to audit all of the code
(and know that it is done).

As I sent to Alan privately (and he agreed), there are three reasons to
change this code (even if it is correct) to using time_{before,after}:

1) because it is non-obvious what "correct" is when dealing with jiffies wrap
   (some of the changes that Alan previously complained about as being already
   correct were in fact broken, and if _he_ can't get it right, who can?)
2) so that people see it more and are more likely to get it correct, instead
   of always adding in code that only breaks after 497 days of uptime
3) to isolate code from any changes if jiffies moves to a 64-bit value (where
   casts to "(long)" may not be appropriate anymore)

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


  reply	other threads:[~2001-11-08  0:38 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 [this message]
2001-11-08  0:44     ` David S. Miller
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=20011107173626.S5922@lynx.no \
    --to=adilger@turbolabs.com \
    --cc=ak@muc.de \
    --cc=andrewm@uow.edu.au \
    --cc=davem@redhat.com \
    --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.