From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] gfs2: don't hold the sd_jindex_spin during recovery
Date: Mon, 20 Aug 2018 09:54:58 +0100 [thread overview]
Message-ID: <8c4d1c97-a91c-2b62-f867-02b7d2082862@redhat.com> (raw)
In-Reply-To: <1454217843.3491159.1534521234829.JavaMail.zimbra@redhat.com>
Hi,
On 17/08/18 16:53, Bob Peterson wrote:
> Hi,
>
> The sd_jindex_spin is used to serialize access to the sd_jindex_list.
> Before this patch function gfs2_recover_set would hold the
> spin_lock while recovery is running. Since recovery may take a very
> long time, other processes needing to use the list would
> monopolize a CPU for a very long time, spinning. This patch allows
> it to unlock the spin_lock before calling gfs2_recover_journal.
> The test_and_set_bit there should prevent multiple processes from
> trying to recover the same journal.
>
> This is only a problem when multiple processes attempt recovery,
> which is possible via (1) a uevent kicking a 1 into the sysfs file
> /sys/fs/gfs2/<table>/lock_module/recover, while the gfs2_control_func
> in lock_dlm also calls gfs2_recover_set().
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> fs/gfs2/sys.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
> index 0c2a60fa66d7f..9fcb66d882b45 100644
> --- a/fs/gfs2/sys.c
> +++ b/fs/gfs2/sys.c
> @@ -424,8 +424,8 @@ int gfs2_recover_set(struct gfs2_sbd *sdp, unsigned jid)
> list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) {
> if (jd->jd_jid != jid && !sdp->sd_args.ar_spectator)
> continue;
> - rv = gfs2_recover_journal(jd, false);
> - break;
> + spin_unlock(&sdp->sd_jindex_spin);
> + return gfs2_recover_journal(jd, false);
Since the wait parameter is false here, all gfs2_recover_journal does is
queue some work, and that should not block. Also it breaks the locking
between the JDF_RECOVERY flag and the queuing of the work too,
Steve.
> }
> out:
> spin_unlock(&sdp->sd_jindex_spin);
>
prev parent reply other threads:[~2018-08-20 8:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <978501634.3491087.1534521208889.JavaMail.zimbra@redhat.com>
2018-08-17 15:53 ` [Cluster-devel] [GFS2 PATCH] gfs2: don't hold the sd_jindex_spin during recovery Bob Peterson
2018-08-20 8:54 ` Steven Whitehouse [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=8c4d1c97-a91c-2b62-f867-02b7d2082862@redhat.com \
--to=swhiteho@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).