From: Andrew Morton <akpm@linux-foundation.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] writeback: guard against jiffies wraparound on inode->dirtied_when checks (try #2)
Date: Tue, 31 Mar 2009 17:20:31 -0700 [thread overview]
Message-ID: <20090331172031.b2971f1e.akpm@linux-foundation.org> (raw)
In-Reply-To: <1238544239-31882-1-git-send-email-jlayton@redhat.com>
On Tue, 31 Mar 2009 20:03:59 -0400
Jeff Layton <jlayton@redhat.com> wrote:
> + * It's not sufficient to just do a time_after() check on
> + * dirtied_when. That assumes that dirtied_when will always
> + * change within a period of jiffies that encompasses half the
> + * machine word size (2^31 jiffies on 32-bit arch). That's not
> + * necessarily the case if an inode is being constantly
> + * redirtied. Since dirtied_when can never be in the future,
> + * we can assume that if it appears to be so then it is
> + * actually in the distant past.
so this really is a 32-bit-only thing.
I guess that isn't worth optimising for though.
otoh, given that all three comparisons are the same:
+ time_after(inode->dirtied_when, *older_than_this) &&
+ time_before_eq(inode->dirtied_when, jiffies))
(although one is inverted (i think?)), it might end up nicer if this was all done
in a little helper function?
That way we only need to comment what's going on at a single site, and
we could omit the additional test if !CONFIG_64BIT.
next prev parent reply other threads:[~2009-04-01 0:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-01 0:03 [PATCH] writeback: guard against jiffies wraparound on inode->dirtied_when checks (try #2) Jeff Layton
2009-04-01 0:20 ` Andrew Morton [this message]
2009-04-01 0:50 ` Jeff Layton
2009-04-01 1:07 ` Andrew Morton
2009-04-01 6:56 ` Wu Fengguang
2009-04-01 11:53 ` Jeff Layton
2009-04-01 12:26 ` Wu Fengguang
2009-04-01 12:48 ` Jeff Layton
2009-04-01 13:07 ` Wu Fengguang
2009-04-01 14:35 ` Jeff Layton
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=20090331172031.b2971f1e.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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 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.