public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [RFC PATCH 2/3] xfs: fold grant space update into head check function
Date: Mon, 14 Oct 2019 14:12:59 -0400	[thread overview]
Message-ID: <20191014181300.15494-3-bfoster@redhat.com> (raw)
In-Reply-To: <20191014181300.15494-1-bfoster@redhat.com>

The grant space add helper is separate from the check helper that
potentially queues the task until sufficient log reservation is
available. Callers of xlog_grant_head_check() immediately update the
grant head on return. To facilitate additional coordination between
the grant head check and update, fold the space update into the
checking function. No functional changes.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/xfs_log.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 045ab648ca96..ce0aac89e675 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -342,6 +342,9 @@ xlog_grant_head_check(
 		spin_unlock(&head->lock);
 	}
 
+	if (!error)
+		xlog_grant_add_space(log, &head->grant, *need_bytes);
+
 	return error;
 }
 
@@ -409,7 +412,6 @@ xfs_log_regrant(
 	if (error)
 		goto out_error;
 
-	xlog_grant_add_space(log, &log->l_write_head.grant, need_bytes);
 	trace_xfs_log_regrant_exit(log, tic);
 	xlog_verify_grant_tail(log);
 	return 0;
@@ -468,7 +470,6 @@ xfs_log_reserve(
 	if (error)
 		goto out_error;
 
-	xlog_grant_add_space(log, &log->l_reserve_head.grant, need_bytes);
 	xlog_grant_add_space(log, &log->l_write_head.grant, need_bytes);
 	trace_xfs_log_reserve_exit(log, tic);
 	xlog_verify_grant_tail(log);
-- 
2.20.1


  parent reply	other threads:[~2019-10-14 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 18:12 [RFC PATCH 0/3] xfs: grant head concurrency experiment Brian Foster
2019-10-14 18:12 ` [RFC PATCH 1/3] xfs: temporarily bypass oneshot grant tail verification Brian Foster
2019-10-14 18:12 ` Brian Foster [this message]
2019-10-14 18:13 ` [RFC PATCH 3/3] xfs: recheck free reservation on grant head update contention Brian Foster

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=20191014181300.15494-3-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=linux-xfs@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