From patchwork Thu Feb 14 07:27:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10811923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CD836C2 for ; Thu, 14 Feb 2019 07:27:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03B182DC7C for ; Thu, 14 Feb 2019 07:27:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC50E2DC87; Thu, 14 Feb 2019 07:27:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFE232DC7C for ; Thu, 14 Feb 2019 07:27:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbfBNH1y (ORCPT ); Thu, 14 Feb 2019 02:27:54 -0500 Received: from mail-pg1-f178.google.com ([209.85.215.178]:38324 "EHLO mail-pg1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfBNH1y (ORCPT ); Thu, 14 Feb 2019 02:27:54 -0500 Received: by mail-pg1-f178.google.com with SMTP id m2so336658pgl.5 for ; Wed, 13 Feb 2019 23:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=A4RKlfnNA8gomgGeYQ82znM5hzIISejlfMCR7mEDAd4=; b=GztnXlJaY3vXMGRyTSbHsbkoQd/JAXzEOs0o7kHvRHd+tbSYWW+KinTJsZzVoj9L2D 4zXKToMILbJEhyG8eCdf8qVcaFsIlGYKu18aLu5pSItBZ6Hlz+q/fllMdBY9RvebkliR cfLkn0v7IaW+RSovc1aY/eeje66yPEILODoTsu1mjb9rO0314J4HF+OHlB6DJFxN6Lcu eE4QNIttn2TGSVNf7E0dINXMLW0bJh6PrQjGoPzQcZNnGgJcB7JJjC86eKicfcJhgxUT l65EbI+PQIE+uyQnA9yZYnWwdRgrFbROo9iOqRQel8jXYr/ZtOOunRXHZvIZkbiA4N3b OS4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=A4RKlfnNA8gomgGeYQ82znM5hzIISejlfMCR7mEDAd4=; b=t3sqtbdUkeGrufEtPwwGjw7gDAPBBCyXLKCVTzaK5ku6/eKqNVJ9yEtV+UT2wZtoQ2 adej3iSDKhsnUJ5uGA2pftrW1INCl13fuCGfgKmgPfwNgYSaGqf3uztNhQBb1480QYNT o3mKRudeE7UW0Nf1BX0QpTn1vLl+eBLyvpa0xJUFlRTojr7/GI3XHOXWTnGs7ldbT6f8 t5LMvSHvvGY6GlahiAIIRRKdDn+lPAMEttY3tN2NMgWB/Rde8v6USEBfJ0Y6YWrTGgNq zbZ6jjhVgEID/rXSBFZXNAHCmD3vzu0GacAfsG13dQ8OfupM89aeqXbqyjBITfaylBUI qu1Q== X-Gm-Message-State: AHQUAuaPSQ8Gk7TZunL3W1mXVDypszEfqcE19q8bkGBnWDuMpDgX0fLq 8WiCyV6U3rSsdDET4Nr7zEkrIh32Ch3gsDaG+IdwSw== X-Google-Smtp-Source: AHgI3IYxWuvwAzlwy27p8abka5ubtFuLj3qGsQsosHFglxk4qOq9E3zZKwkL85aMKvhygADhtFfxBKk8SEHX8/NOy64= X-Received: by 2002:a62:12d5:: with SMTP id 82mr2570891pfs.255.1550129272763; Wed, 13 Feb 2019 23:27:52 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Thu, 14 Feb 2019 01:27:41 -0600 Message-ID: Subject: [SMB3][PATCH] request more credits during session setup To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We only request significantly more credits (during mount) on first session setup so we typically end up with from 43-49 credits available when mount completes - which is not enough for a large I/O to complete (if started soon after mount). We need > 64 credits. Solve this by requesting more than 2 credits on tree connect. After mount (before this patch): 43 credits (not enough for a 4MB I/O) After mount (with this patch) 105 credits (which is good, enough for two large I/Os to be issued immediately after mount) Reviewed-by: Pavel Shilovsky From 375808983c63e25f8e0d05effab86b0f36a024b7 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 14 Feb 2019 01:19:02 -0600 Subject: [PATCH 1/2] smb3: request more credits on tree connect If we try large I/O (read or write) immediately after mount we won't typically have enough credits because we only request large amounts of credits on the first session setup. So if large I/O is attempted soon after mount we will typically only have about 43 credits rather than 105 credits (with this patch) available for the large i/o (which needs 64 credits minimum). This patch requests more credits during tree connect, which helps ensure that we have enough credits when mount completes (between these requests and the first session setup) in order to start large I/O immediately after mount if needed. --- fs/cifs/smb2pdu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index e3f0775f9765..49c2843b1bcf 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1620,6 +1620,9 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, rqst.rq_iov = iov; rqst.rq_nvec = 2; + /* Need 64 for max size write so ask for more in case not there yet */ + req->sync_hdr.CreditRequest = cpu_to_le16(64); + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); cifs_small_buf_release(req); rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base; -- 2.17.1