From: Jan Kara <jack@suse.cz>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Jan Kara <jack@suse.cz>, ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH RFC] jbd: don't wake kjournald unnecessarily
Date: Wed, 19 Dec 2012 18:11:18 +0100 [thread overview]
Message-ID: <20121219171118.GA28042@quack.suse.cz> (raw)
In-Reply-To: <50D1E16B.6000703@redhat.com>
On Wed 19-12-12 09:46:51, Eric Sandeen wrote:
> On 12/19/12 2:13 AM, Jan Kara wrote:
> > On Tue 18-12-12 21:08:51, Eric Sandeen wrote:
> >> On 12/18/12 8:05 PM, Jan Kara wrote:
> >>> On Wed 19-12-12 02:27:10, Jan Kara wrote:
> >>>>> With a u8 tid_t, the "else" clause from commit d9b0193 fires
> >>>>> frequently; I really think the underlying problem is that tid_geq()
> >>>>> etc does not properly handle wraparounds - if, say, target is 255
> >>>>> and j_commit_request is 0, we don't know if j_commit_request
> >>>>> is 255 tids behind, or 1 tid ahead. I have to think about that
> >>>>> some more, unless it's obvious to someone else.
> >>>> Well, there's no way to handle wraps better AFAICT. Tids eventually wrap
> >>>> and if someone has stored away tid of a transaction he wants committed and
> >>>> keeps it for a long time before using it, it can end up being anywhere
> >>>> before / after current j_commit_request. The hope was that it takes long
> >>>> enough to wrap around 32-bit tids. If this happens often in practice we may
> >>>> have to switch to 64-bit tids (in memory, on disk 32-bit tids are enough
> >>>> because of limited journal size).
> >>
> >> I was wondering if, since the tid_g*() functions only work if the
> >> distance is half the unsigned int space, we can force a commit at some
> >> point if j_transaction_sequence has gotten too far ahead? I'm not sure
> >> where or if that could be done...
> > I don't quiete understand. If someone stores tid = transaction->t_tid and
> > in two weeks calls log_start_commit(tid), I don't see how any forcing of
> > commits could solve that tid may now look ahead of the log...
>
> I'm probably missing something, but I was thinking we could compare
> j_commit_sequence to j_transaction_sequence and force a commit up to at least
> j_commit_sequence if it's too "stale" - but I'm only handwaving. :)
You are probably missing the fact that
j_transaction_sequence - 2 <= j_commit_sequence <= j_transaction_sequence.
I.e., we have always one running transaction and at most one committing
transaction which is the previous one. j_commit_sequence is TID of the
transaction which successfully finished commit.
The warnings we are seeing are caused by TIDs stored in
EXT3_I(inode)->i_datasync_tid (and i_sync_tid). Those can get rather old
before they are used.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2012-12-19 17:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 17:03 [PATCH RFC] jbd: don't wake kjournald unnecessarily Eric Sandeen
2012-12-19 1:27 ` Jan Kara
2012-12-19 2:05 ` Jan Kara
2012-12-19 3:08 ` Eric Sandeen
2012-12-19 8:13 ` Jan Kara
2012-12-19 15:37 ` Theodore Ts'o
2012-12-19 17:14 ` Jan Kara
2012-12-19 20:27 ` Theodore Ts'o
2012-12-19 21:19 ` Eric Sandeen
2012-12-21 17:01 ` Eric Sandeen
2012-12-21 17:46 ` Theodore Ts'o
2013-01-08 19:19 ` Eric Sandeen
2013-01-11 16:42 ` Eric Sandeen
2013-01-11 19:03 ` Jan Kara
2013-01-11 19:06 ` Eric Sandeen
2012-12-19 15:46 ` Eric Sandeen
2012-12-19 17:11 ` Jan Kara [this message]
2012-12-19 2:36 ` Eric Sandeen
2012-12-19 2:59 ` [PATCH] jbd2: " Eric Sandeen
2012-12-19 8:09 ` Jan Kara
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=20121219171118.GA28042@quack.suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.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 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).