linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Shilovsky <pavel.shilovsky@gmail.com>
To: Steve French <smfrench@gmail.com>
Cc: CIFS <linux-cifs@vger.kernel.org>,
	samba-technical <samba-technical@lists.samba.org>
Subject: Re: [PATCH] Improve performance of POSIX open - request query disk id open context
Date: Sat, 6 Jul 2019 09:34:41 -0700	[thread overview]
Message-ID: <CAKywueQu8idf6120LybjsNwHqy7MOnXMcm=e8ug=UtiU4u0zWA@mail.gmail.com> (raw)
In-Reply-To: <CAH2r5mtb_g1Hx4UPB+5XpSY3Ew_fn=bdjLnpRD=ZQymJxrUw0g@mail.gmail.com>

Good idea! See some comments below.

When adding new context, the following defines need to be changed:

689 /*
690  * Maximum size of a SMB2_CREATE response is 64 (smb2 header) +
691  * 88 (fixed part of create response) + 520 (path) + 150 (contexts) +
692  * 2 bytes of padding.
693  */
694 #define MAX_SMB2_CREATE_RESPONSE_SIZE 824

and

657 /*
658  * Maximum number of iovs we need for an open/create request.
659  * [0] : struct smb2_create_req
660  * [1] : path
661  * [2] : lease context
662  * [3] : durable context
663  * [4] : posix context
664  * [5] : time warp context
665  * [6] : compound padding
666  */
667 #define SMB2_CREATE_IOV_SIZE 7

+       if (n_iov > 2) {
+               struct create_context *ccontext =
+                       (struct create_context *)iov[n_iov-1].iov_base;
+               ccontext->Next = cpu_to_le32(iov[n_iov-1].iov_len);
+       }
+       add_query_id_context(iov, &n_iov);

I think we should add a check if iov has enough capacity to keep all
the contexts. Right now it will oops if it wasn't allocated right in
the upper layer.

In general, I think having a complete patch that adds the whole
functionality is better for future git bisect and looks more logical
instead of breaking such small features into parts.

Best regards,
Pavel Shilovskiy

пт, 5 июл. 2019 г. в 23:14, Steve French via samba-technical
<samba-technical@lists.samba.org>:
>
> We can cut the number of roundtrips on open (may also
> help some rename cases as well) by returning the inode
> number in the SMB2 open request itself instead of
> querying it afterwards via a query FILE_INTERNAL_INFO.
> This should significantly improve the performance of
> posix open.
>
> Add SMB2_CREATE_QUERY_ON_DISK_ID create context request
> on open calls so that when server supports this we
> can save a roundtrip for QUERY_INFO on every open.
>
> Follow on patch will add the response processing for
> SMB2_CREATE_QUERY_ON_DISK_ID context and optimize
> smb2_open_file to avoid the extra network roundtrip
> on every posix open. This patch adds the context on
> SMB2/SMB3 open requests.
>
> --
> Thanks,
>
> Steve

  reply	other threads:[~2019-07-06 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-06  6:13 [PATCH] Improve performance of POSIX open - request query disk id open context Steve French
2019-07-06 16:34 ` Pavel Shilovsky [this message]
2019-07-06 19:43   ` Steve French

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='CAKywueQu8idf6120LybjsNwHqy7MOnXMcm=e8ug=UtiU4u0zWA@mail.gmail.com' \
    --to=pavel.shilovsky@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=smfrench@gmail.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 NNTP newsgroup(s).