From: Jan Kara <jack@suse.cz>
To: Ritesh Harjani <riteshh@linux.ibm.com>
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.com>,
tytso@mit.edu
Subject: Re: [PATCHv1 2/2] jbd2: Remove CONFIG_JBD2_DEBUG to update t_max_wait
Date: Mon, 24 Jan 2022 10:12:43 +0100 [thread overview]
Message-ID: <20220124091243.cua4apgkd64fw6iv@quack3.lan> (raw)
In-Reply-To: <c1424ac2e6f6f5a21bcf2fb7679203df865c8a60.1642953021.git.riteshh@linux.ibm.com>
On Sun 23-01-22 22:53:28, Ritesh Harjani wrote:
> CONFIG_JBD2_DEBUG and jbd2_journal_enable_debug knobs were added in
> update_t_max_wait(), since earlier it used to take a spinlock for updating
> t_max_wait, which could cause a bottleneck while starting a txn
> (start_this_handle()).
> Since in previous patch, we have killed t_handle_lock completely, we
> could get rid of this debug config and knob to let t_max_wait be updated
> by default again.
>
> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Sounds fine. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/jbd2/transaction.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
> index 68dd7de49aff..77634e2e118e 100644
> --- a/fs/jbd2/transaction.c
> +++ b/fs/jbd2/transaction.c
> @@ -141,20 +141,19 @@ static void jbd2_get_transaction(journal_t *journal,
> * t_max_wait is carefully updated here with use of atomic compare exchange.
> * Note that there could be multiplre threads trying to do this simultaneously
> * hence using cmpxchg to avoid any use of locks in this case.
> + * With this t_max_wait can be updated w/o enabling jbd2_journal_enable_debug.
> */
> static inline void update_t_max_wait(transaction_t *transaction,
> unsigned long ts)
> {
> -#ifdef CONFIG_JBD2_DEBUG
> unsigned long oldts, newts;
> - if (jbd2_journal_enable_debug &&
> - time_after(transaction->t_start, ts)) {
> +
> + if (time_after(transaction->t_start, ts)) {
> newts = jbd2_time_diff(ts, transaction->t_start);
> oldts = READ_ONCE(transaction->t_max_wait);
> while (oldts < newts)
> oldts = cmpxchg(&transaction->t_max_wait, oldts, newts);
> }
> -#endif
> }
>
> /*
> --
> 2.31.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
prev parent reply other threads:[~2022-01-24 9:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-23 17:23 [PATCHv1 0/2] jbd2: Kill age-old t_handle_lock transaction spinlock Ritesh Harjani
2022-01-23 17:23 ` [PATCHv1 1/2] jbd2: Kill " Ritesh Harjani
2022-01-24 9:11 ` Jan Kara
2022-01-23 17:23 ` [PATCHv1 2/2] jbd2: Remove CONFIG_JBD2_DEBUG to update t_max_wait Ritesh Harjani
2022-01-24 9:12 ` Jan Kara [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=20220124091243.cua4apgkd64fw6iv@quack3.lan \
--to=jack@suse.cz \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=riteshh@linux.ibm.com \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®