Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3175274pxb; Mon, 18 Apr 2022 18:08:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRZEu0aAz28Cwch7iwReJeSpp695ddU5KZhlDKFSpLj6esgZb2i2lhFvtFbN7DMBDKeHO0 X-Received: by 2002:a17:907:8a26:b0:6e1:2646:ef23 with SMTP id sc38-20020a1709078a2600b006e12646ef23mr11718447ejc.109.1650330486016; Mon, 18 Apr 2022 18:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650330486; cv=none; d=google.com; s=arc-20160816; b=opC5D1+cvWrx8dIdAdN3ORi9Vii7WLxdfyygkI8FBZusZyrcPa3ejHqCQVDJAfhJiW 7qJmHsc9skYusZezf2IWkZRgw5f+O3K9SxRQDh7rRPUt+rdArsL1NZ5JHvlc8KLkG0jx teGjXeCy4d0oGsvBTvhCMMgYrVxAmQx5biLFUNRj604vrpibxioViE06mnGDPhWgyAip I3l/W+8gb1Dy7H2+cdScakE+yNfzruLcFGSFjsolQdJotRuLqSPpcM1zNCDz2jVnuroC ECz/E/7y1VycH1Wt+aK+w6ukY1sFy2x+RwTzt2mY64Cw8hsz+J/Pkwns7s3b0aJcnxrg x1Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=NGJO6xBZZGN5n1pOwZX0RF4H4PhG6RQ4N70dxtVneX8=; b=GyKtz6aKpkk9DxmVWww76mndCzHFeavR62fejwQlIQSkhUydNQWaXZHx/Zy03iUjyf pFNXHA2HpnP4BTCxgcI2o10JwC1sgZMGN3iQsp8dYAD5SWlAHlV/Ayz8dZHYFKqQTI2u rmXbk++fpXCjN/f70c1LLODb/mzN+R9kG5g1Lswe704VfB6oxSzVsjvEaF62lJy1cKJ2 1E26WMstTaVlGwDgar367s/hBfItXnaU8zYw4h9VC6otN/2nCoMEJ9AVXHzvt3d9DjJn 6koJr1sKYxIkt7tYSdP2K3HZX+cuFywhdwzz56futv1tFYhY7jNEA8Hk/ZMYvbKUWU0u Qurw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dk11-20020a0564021d8b00b0041d78af2f12si7230650edb.241.2022.04.18.18.07.29; Mon, 18 Apr 2022 18:08:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346568AbiDRQ4n (ORCPT + 99 others); Mon, 18 Apr 2022 12:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346778AbiDRQzn (ORCPT ); Mon, 18 Apr 2022 12:55:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C09F33A37; Mon, 18 Apr 2022 09:52:04 -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 E1ED0612EC; Mon, 18 Apr 2022 16:52:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C48BEC385A1; Mon, 18 Apr 2022 16:52:02 +0000 (UTC) Subject: [PATCH RFC 08/15] SUNRPC: Add RPC_TASK_CORK flag From: Chuck Lever To: netdev@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nvme@lists.infradead.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: ak@tempesta-tech.com, borisp@nvidia.com, simo@redhat.com Date: Mon, 18 Apr 2022 12:52:01 -0400 Message-ID: <165030072175.5246.14868635576137008067.stgit@oracle-102.nfsv4.dev> In-Reply-To: <165030062272.5246.16956092606399079004.stgit@oracle-102.nfsv4.dev> References: <165030062272.5246.16956092606399079004.stgit@oracle-102.nfsv4.dev> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Introduce a mechanism to cause xprt_transmit() to break out of its sending loop at a specific rpc_rqst, rather than draining the whole transmit queue. This enables the client to send just an RPC TLS probe and then wait for the response before proceeding with the rest of the queue. Signed-off-by: Chuck Lever --- include/linux/sunrpc/sched.h | 2 ++ include/trace/events/sunrpc.h | 1 + net/sunrpc/xprt.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 599133fb3c63..f8c09638fa69 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -125,6 +125,7 @@ struct rpc_task_setup { #define RPC_TASK_TLSCRED 0x00000008 /* Use AUTH_TLS credential */ #define RPC_TASK_NULLCREDS 0x00000010 /* Use AUTH_NULL credential */ #define RPC_CALL_MAJORSEEN 0x00000020 /* major timeout seen */ +#define RPC_TASK_CORK 0x00000040 /* cork the xmit queue */ #define RPC_TASK_DYNAMIC 0x00000080 /* task was kmalloc'ed */ #define RPC_TASK_NO_ROUND_ROBIN 0x00000100 /* send requests on "main" xprt */ #define RPC_TASK_SOFT 0x00000200 /* Use soft timeouts */ @@ -137,6 +138,7 @@ struct rpc_task_setup { #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) +#define RPC_IS_CORK(t) ((t)->tk_flags & RPC_TASK_CORK) #define RPC_IS_SOFT(t) ((t)->tk_flags & (RPC_TASK_SOFT|RPC_TASK_TIMEOUT)) #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN) #define RPC_WAS_SENT(t) ((t)->tk_flags & RPC_TASK_SENT) diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 811187c47ebb..e8d6adff1a50 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h @@ -312,6 +312,7 @@ TRACE_EVENT(rpc_request, { RPC_TASK_TLSCRED, "TLSCRED" }, \ { RPC_TASK_NULLCREDS, "NULLCREDS" }, \ { RPC_CALL_MAJORSEEN, "MAJORSEEN" }, \ + { RPC_TASK_CORK, "CORK" }, \ { RPC_TASK_DYNAMIC, "DYNAMIC" }, \ { RPC_TASK_NO_ROUND_ROBIN, "NO_ROUND_ROBIN" }, \ { RPC_TASK_SOFT, "SOFT" }, \ diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 86d62cffba0d..4b303b945b51 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1622,6 +1622,8 @@ xprt_transmit(struct rpc_task *task) if (xprt_request_data_received(task) && !test_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate)) break; + if (RPC_IS_CORK(task)) + break; cond_resched_lock(&xprt->queue_lock); } spin_unlock(&xprt->queue_lock);