public inbox for gfs2@lists.linux.dev
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: gfs2@lists.linux.dev
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Subject: [PATCH 12/16] gfs2: Update to the evict / remote delete documentation
Date: Thu, 26 Sep 2024 00:03:22 +0200	[thread overview]
Message-ID: <20240925220331.417856-13-agruenba@redhat.com> (raw)
In-Reply-To: <20240925220331.417856-1-agruenba@redhat.com>

Try to be a bit more clear and remove some duplications.  We cannot
actually get rid of the verification step eventually, so remove the
comment saying so.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/gfs2/glock.c | 31 ++++++++-----------------------
 fs/gfs2/super.c |  6 +++---
 2 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 3736e7f3b381..8fff36846145 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -965,13 +965,16 @@ static void gfs2_try_evict(struct gfs2_glock *gl)
 
 	/*
 	 * If there is contention on the iopen glock and we have an inode, try
-	 * to grab and release the inode so that it can be evicted.  This will
-	 * allow the remote node to go ahead and delete the inode without us
-	 * having to do it, which will avoid rgrp glock thrashing.
+	 * to grab and release the inode so that it can be evicted.  The
+	 * GIF_DEFER_DELETE flag indicates to gfs2_evict_inode() that the inode
+	 * should not be deleted locally.  This will allow the remote node to
+	 * go ahead and delete the inode without us having to do it, which will
+	 * avoid rgrp glock thrashing.
 	 *
 	 * The remote node is likely still holding the corresponding inode
 	 * glock, so it will run before we get to verify that the delete has
-	 * happened below.
+	 * happened below.  (Verification is triggered by the call to
+	 * gfs2_queue_verify_delete() in gfs2_evict_inode().)
 	 */
 	spin_lock(&gl->gl_lockref.lock);
 	ip = gl->gl_object;
@@ -1027,26 +1030,8 @@ static void delete_work_func(struct work_struct *work)
 	struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
 	bool verify_delete = test_and_clear_bit(GLF_VERIFY_DELETE, &gl->gl_flags);
 
-	if (test_and_clear_bit(GLF_TRY_TO_EVICT, &gl->gl_flags)) {
-		/*
-		 * If we can evict the inode, give the remote node trying to
-		 * delete the inode some time before verifying that the delete
-		 * has happened.  Otherwise, if we cause contention on the inode glock
-		 * immediately, the remote node will think that we still have
-		 * the inode in use, and so it will give up waiting.
-		 *
-		 * If we can't evict the inode, signal to the remote node that
-		 * the inode is still in use.  We'll later try to delete the
-		 * inode locally in gfs2_evict_inode.
-		 *
-		 * FIXME: We only need to verify that the remote node has
-		 * deleted the inode because nodes before this remote delete
-		 * rework won't cooperate.  At a later time, when we no longer
-		 * care about compatibility with such nodes, we can skip this
-		 * step entirely.
-		 */
+	if (test_and_clear_bit(GLF_TRY_TO_EVICT, &gl->gl_flags))
 		gfs2_try_evict(gl);
-	}
 
 	if (verify_delete) {
 		u64 no_addr = gl->gl_name.ln_number;
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 90cdc9212f12..715821c837cd 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1272,9 +1272,9 @@ static enum evict_behavior gfs2_upgrade_iopen_glock(struct inode *inode)
 	 * exclusive access to the iopen glock here.
 	 *
 	 * Otherwise, the other nodes holding the lock will be notified about
-	 * our locking request.  If they do not have the inode open, they are
-	 * expected to evict the cached inode and release the lock, allowing us
-	 * to proceed.
+	 * our locking request (see iopen_go_callback()).  If they do not have
+	 * the inode open, they are expected to evict the cached inode and
+	 * release the lock, allowing us to proceed.
 	 *
 	 * Otherwise, if they cannot evict the inode, they are expected to poke
 	 * the inode glock (note: not the iopen glock).  We will notice that
-- 
2.46.0


  parent reply	other threads:[~2024-09-25 22:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 22:03 [PATCH 00/16] gfs2: unlinked inodes Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 01/16] gfs2: Rename GLF_VERIFY_EVICT to GLF_VERIFY_DELETE Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 02/16] gfs2: Initialize gl_no_formal_ino earlier Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 03/16] gfs2: Allow immediate GLF_VERIFY_DELETE work Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 04/16] gfs2: Fix unlinked inode cleanup Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 05/16] gfs2: Faster gfs2_upgrade_iopen_glock wakeups Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 06/16] gfs2: Rename GIF_{DEFERRED -> DEFER}_DELETE Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 07/16] gfs2: Rename dinode_demise to evict_behavior Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 08/16] gfs2: Return enum evict_behavior from gfs2_upgrade_iopen_glock Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 09/16] gfs2: Minor delete_work_func cleanup Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 10/16] gfs2: Clean up delete work processing Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 11/16] gfs2: Call gfs2_queue_verify_delete from gfs2_evict_inode Andreas Gruenbacher
2024-09-25 22:03 ` Andreas Gruenbacher [this message]
2024-09-25 22:03 ` [PATCH 13/16] gfs2: Use mod_delayed_work in gfs2_queue_try_to_evict Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 14/16] gfs2: Randomize GLF_VERIFY_DELETE work delay Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 15/16] gfs2: Use get_random_u32 in gfs2_orlov_skip Andreas Gruenbacher
2024-09-25 22:03 ` [PATCH 16/16] gfs2: Make gfs2_inode_refresh static Andreas Gruenbacher
2024-09-26 12:18 ` [PATCH 00/16] gfs2: unlinked inodes Andrew Price

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=20240925220331.417856-13-agruenba@redhat.com \
    --to=agruenba@redhat.com \
    --cc=gfs2@lists.linux.dev \
    /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