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: 1041876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GztnXlJa"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 440SfM3kKdz9sMp for ; Thu, 14 Feb 2019 18:27:55 +1100 (AEDT) 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 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