From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org, "Hunter, Adrian" <adrian.hunter@intel.com>
Subject: Re: [PATCH v2] jbd2: Avoid long hold times of j_state_lock while committing a transaction
Date: Mon, 3 Dec 2018 23:31:17 -0500 [thread overview]
Message-ID: <20181204043117.GB4981@thunk.org> (raw)
In-Reply-To: <20181108122938.10688-1-jack@suse.cz>
On Thu, Nov 08, 2018 at 01:29:38PM +0100, Jan Kara wrote:
> We can hold j_state_lock for writing at the beginning of
> jbd2_journal_commit_transaction() for a rather long time (reportedly for
> 30 ms) due cleaning revoke bits of all revoked buffers under it. The
> handling of revoke tables as well as cleaning of t_reserved_list, and
> checkpoint lists does not need j_state_lock for anything. It is only
> needed to prevent new handles from joining the transaction. Generally
> T_LOCKED transaction state prevents new handles from joining the
> transaction - except for reserved handles which have to allowed to join
> while we wait for other handles to complete.
>
> To prevent reserved handles from joining the transaction while cleaning
> up lists, add new transaction state T_SWITCH and watch for it when
> starting reserved handles. With this we can just drop the lock for
> operations that don't need it.
>
> Reported-and-tested-by: Adrian Hunter <adrian.hunter@intel.com>
> Suggested-by: "Theodore Y. Ts'o" <tytso@mit.edu>
> Signed-off-by: Jan Kara <jack@suse.cz>
Applied, thanks.
- Ted
prev parent reply other threads:[~2018-12-04 4:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 12:29 [PATCH v2] jbd2: Avoid long hold times of j_state_lock while committing a transaction Jan Kara
2018-11-27 10:29 ` Jan Kara
2018-12-04 4:31 ` Theodore Y. Ts'o [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=20181204043117.GB4981@thunk.org \
--to=tytso@mit.edu \
--cc=adrian.hunter@intel.com \
--cc=jack@suse.cz \
--cc=linux-ext4@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).