diff mbox series

[v2] ceph: don't retain the caps if they're being revoked and not used

Message ID 20220428132344.94413-1-xiubli@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v2] ceph: don't retain the caps if they're being revoked and not used | expand

Commit Message

Xiubo Li April 28, 2022, 1:23 p.m. UTC
For example if the Frwcb caps are being revoked, but only the Fr
caps is still being used then the kclient will skip releasing them
all. But in next turn if the Fr caps is ready to be released the
Fw caps maybe just being used again. So in corner case, such as
heavy load IOs, the revocation maybe stuck for a long time.

URL: https://tracker.ceph.com/issues/46904
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/caps.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jeff Layton April 28, 2022, 1:28 p.m. UTC | #1
On Thu, 2022-04-28 at 21:23 +0800, Xiubo Li wrote:
> For example if the Frwcb caps are being revoked, but only the Fr
> caps is still being used then the kclient will skip releasing them
> all. But in next turn if the Fr caps is ready to be released the
> Fw caps maybe just being used again. So in corner case, such as
> heavy load IOs, the revocation maybe stuck for a long time.
> 
> URL: https://tracker.ceph.com/issues/46904
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/caps.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index 22dae29be64d..bf9243795f3b 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -1978,6 +1978,12 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
>  		}
>  	}
>  
> +	/*
> +	 * Do not retain the capabilities if they are being revoked
> +	 * but not used, this could help speed up the revoking.
> +	 */
> +	retain &= ~(revoking & ~used);
> +
>  	dout("check_caps %llx.%llx file_want %s used %s dirty %s flushing %s"
>  	     " issued %s revoking %s retain %s %s%s\n", ceph_vinop(inode),
>  	     ceph_cap_string(file_wanted),

Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff mbox series

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 22dae29be64d..bf9243795f3b 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1978,6 +1978,12 @@  void ceph_check_caps(struct ceph_inode_info *ci, int flags,
 		}
 	}
 
+	/*
+	 * Do not retain the capabilities if they are being revoked
+	 * but not used, this could help speed up the revoking.
+	 */
+	retain &= ~(revoking & ~used);
+
 	dout("check_caps %llx.%llx file_want %s used %s dirty %s flushing %s"
 	     " issued %s revoking %s retain %s %s%s\n", ceph_vinop(inode),
 	     ceph_cap_string(file_wanted),