From: David Miller <davem@davemloft.net>
To: jdelvare@suse.de
Cc: eric.dumazet@gmail.com, fubar@us.ibm.com,
bonding-devel@lists.sourceforge.net, netdev@vger.kernel.org,
jbohac@suse.cz
Subject: Re: [PATCH v2] bonding: Fix jiffies overflow problems (again)
Date: Mon, 06 Sep 2010 13:16:47 -0700 (PDT) [thread overview]
Message-ID: <20100906.131647.115921981.davem@davemloft.net> (raw)
In-Reply-To: <201009021745.55038.jdelvare@suse.de>
From: Jean Delvare <jdelvare@suse.de>
Date: Thu, 2 Sep 2010 17:45:54 +0200
> From: Jiri Bohac <jbohac@suse.cz>
>
> The time_before_eq()/time_after_eq() functions operate on unsigned
> long and only work if the difference between the two compared values
> is smaller than half the range of unsigned long (31 bits on i386).
>
> Some of the variables (slave->jiffies, dev->trans_start, dev->last_rx)
> used by bonding store a copy of jiffies and may not be updated for a
> long time. With HZ=1000, time_before_eq()/time_after_eq() will start
> giving bad results after ~25 days.
>
> jiffies will never be before slave->jiffies, dev->trans_start,
> dev->last_rx by more than possibly a couple ticks caused by preemption
> of this code. This allows us to detect/prevent these overflows by
> replacing time_before_eq()/time_after_eq() with time_in_range().
>
> Signed-off-by: Jiri Bohac <jbohac@suse.cz>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
Applied, thanks.
prev parent reply other threads:[~2010-09-06 20:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-02 14:19 [PATCH] bonding: Fix jiffies overflow problems (again) Jean Delvare
2010-09-02 14:36 ` Eric Dumazet
2010-09-02 15:45 ` [PATCH v2] " Jean Delvare
2010-09-06 20:16 ` David Miller [this message]
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=20100906.131647.115921981.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bonding-devel@lists.sourceforge.net \
--cc=eric.dumazet@gmail.com \
--cc=fubar@us.ibm.com \
--cc=jbohac@suse.cz \
--cc=jdelvare@suse.de \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).