Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C148CC433EF for ; Tue, 3 May 2022 12:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235561AbiECMwn (ORCPT ); Tue, 3 May 2022 08:52:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230339AbiECMwm (ORCPT ); Tue, 3 May 2022 08:52:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90413464B for ; Tue, 3 May 2022 05:49:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4DA5C616D5 for ; Tue, 3 May 2022 12:49:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D040C385A9; Tue, 3 May 2022 12:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651582149; bh=jJRlCLX8ou18HxFaT9fUN4bEuoB0wzRM4xzF0NUzV3I=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=O/7BgnKIaY5QqnYGNaE8AK+d+Fs2mHmQP43fjTw0AfMjOLhAMy7IqdREydG/iwE7D zSoJyCjdLosaUXxLIszT1lxvfywgH2qZ5U17VjwE2ncx1vlPjmdob3fh9wYmUToAfX 7RNOsgNLbSOIr+Gj2br3lL7D1dRNIRpu2ox+p0Fc/2SAVgDXleNrZvyaenwyBmmJtD QeyJ+UKNnFFrbselklmE82pzMt6TMMq6mlR3x8yj132ZJ5klO18MqOFn5fth1lzRkx p1caidbeoP0/LQW6ML9f0K4Qx03ng8Zaz5ex3CW6d81IzpNn/pjB5Plf9tNphStq9A d3OnmJUcI9JUg== Message-ID: <618528f07d5a6d397a76d954c43a5ff59422d83e.camel@kernel.org> Subject: Re: [PATCH] ceph: don't retain the caps if they're being revoked and not used From: Jeff Layton To: Xiubo Li , "Yan, Zheng" Cc: Ilya Dryomov , Venky Shankar , ceph-devel Date: Tue, 03 May 2022 08:49:07 -0400 In-Reply-To: <8dff2592-03cb-0ef1-e538-ae4b0484c567@redhat.com> References: <20220428121318.43125-1-xiubli@redhat.com> <8dff2592-03cb-0ef1-e538-ae4b0484c567@redhat.com> Content-Type: text/plain; charset="ISO-8859-15" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org On Fri, 2022-04-29 at 14:28 +0800, Xiubo Li wrote: > On 4/29/22 10:46 AM, Yan, Zheng wrote: > > On Thu, Apr 28, 2022 at 11:42 PM 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. > > > > > This does not make sense. If Frwcb are being revoked, writer can't get > > Fw again. Second, Frwcb are managed by single lock at mds side. > > Partial releasing caps does make lock state transition possible. > > > Yeah, you are right. Checked the __ceph_caps_issued() it really has > removed the caps being revoked already. > > Thanks Zheng. > Based on this discussion, I'm going to drop this patch from the testing branch. > > > > Signed-off-by: Xiubo Li > > > --- > > > fs/ceph/caps.c | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c > > > index 0c0c8f5ae3b3..7eb5238941fc 100644 > > > --- a/fs/ceph/caps.c > > > +++ b/fs/ceph/caps.c > > > @@ -1947,6 +1947,13 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, > > > > > > /* The ones we currently want to retain (may be adjusted below) */ > > > retain = file_wanted | used | CEPH_CAP_PIN; > > > + > > > + /* > > > + * Do not retain the capabilities if they are under revoking > > > + * but not used, this could help speed up the revoking. > > > + */ > > > + retain &= ~((revoking & retain) & ~used); > > > + > > > if (!mdsc->stopping && inode->i_nlink > 0) { > > > if (file_wanted) { > > > retain |= CEPH_CAP_ANY; /* be greedy */ > > > -- > > > 2.36.0.rc1 > > > > Thanks, -- Jeff Layton