CEPH-Devel archive mirror
 help / color / mirror / Atom feed
From: Venky Shankar <vshankar@redhat.com>
To: xiubli@redhat.com
Cc: ceph-devel@vger.kernel.org, idryomov@gmail.com,
	jlayton@kernel.org,  mchangir@redhat.com
Subject: Re: [PATCH v2 2/2] ceph: update the oldest_client_tid via the renew caps
Date: Tue, 6 Feb 2024 14:55:20 +0530	[thread overview]
Message-ID: <CACPzV1mu8Fn_x5dV3vTOktcpw+mYgV4cG-1n3ecnUw9rBqj3fQ@mail.gmail.com> (raw)
In-Reply-To: <20231117081509.723731-3-xiubli@redhat.com>

On Fri, Nov 17, 2023 at 1:47 PM <xiubli@redhat.com> wrote:
>
> From: Xiubo Li <xiubli@redhat.com>
>
> Update the oldest_client_tid via the session renew caps msg to
> make sure that the MDSs won't pile up the completed request list
> in a very large size.
>
> URL: https://tracker.ceph.com/issues/63364
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/mds_client.c | 24 +++++++++++++++++++-----
>  1 file changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index fdfea11d9568..7bdee08ec2eb 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -1579,6 +1579,9 @@ create_session_full_msg(struct ceph_mds_client *mdsc, int op, u64 seq)
>                 size = METRIC_BYTES(count);
>         extra_bytes += 2 + 4 + 4 + size;
>
> +       /* flags, mds auth caps and oldest_client_tid */
> +       extra_bytes += 4 + 4 + 8;
> +
>         /* Allocate the message */
>         msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h) + extra_bytes,
>                            GFP_NOFS, false);
> @@ -1597,9 +1600,9 @@ create_session_full_msg(struct ceph_mds_client *mdsc, int op, u64 seq)
>          * Serialize client metadata into waiting buffer space, using
>          * the format that userspace expects for map<string, string>
>          *
> -        * ClientSession messages with metadata are v4
> +        * ClientSession messages with metadata are v7
>          */
> -       msg->hdr.version = cpu_to_le16(4);
> +       msg->hdr.version = cpu_to_le16(7);
>         msg->hdr.compat_version = cpu_to_le16(1);
>
>         /* The write pointer, following the session_head structure */
> @@ -1635,6 +1638,15 @@ create_session_full_msg(struct ceph_mds_client *mdsc, int op, u64 seq)
>                 return ERR_PTR(ret);
>         }
>
> +       /* version == 5, flags */
> +       ceph_encode_32(&p, 0);
> +
> +       /* version == 6, mds auth caps */
> +       ceph_encode_32(&p, 0);
> +
> +       /* version == 7, oldest_client_tid */
> +       ceph_encode_64(&p, mdsc->oldest_tid);
> +
>         msg->front.iov_len = p - msg->front.iov_base;
>         msg->hdr.front_len = cpu_to_le32(msg->front.iov_len);
>
> @@ -2030,10 +2042,12 @@ static int send_renew_caps(struct ceph_mds_client *mdsc,
>
>         doutc(cl, "to mds%d (%s)\n", session->s_mds,
>               ceph_mds_state_name(state));
> -       msg = ceph_create_session_msg(CEPH_SESSION_REQUEST_RENEWCAPS,
> +
> +       /* send connect message */
> +       msg = create_session_full_msg(mdsc, CEPH_SESSION_REQUEST_RENEWCAPS,
>                                       ++session->s_renew_seq);
> -       if (!msg)
> -               return -ENOMEM;
> +       if (IS_ERR(msg))
> +               return PTR_ERR(msg);
>         ceph_con_send(&session->s_con, msg);
>         return 0;
>  }
> --
> 2.41.0
>

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>


-- 
Cheers,
Venky


      reply	other threads:[~2024-02-06  9:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  8:15 [PATCH v2 0/2] ceph: update the oldest_client_tid via the renew caps xiubli
2023-11-17  8:15 ` [PATCH v2 1/2] ceph: rename create_session_open_msg() to create_session_full_msg() xiubli
2023-11-17  8:15 ` [PATCH v2 2/2] ceph: update the oldest_client_tid via the renew caps xiubli
2024-02-06  9:25   ` Venky Shankar [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=CACPzV1mu8Fn_x5dV3vTOktcpw+mYgV4cG-1n3ecnUw9rBqj3fQ@mail.gmail.com \
    --to=vshankar@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=mchangir@redhat.com \
    --cc=xiubli@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 read-only IMAP folder(s) and NNTP newsgroup(s).