Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2590543rwd; Fri, 9 Jun 2023 13:44:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ632OfHl7vinLMS1Io3P9RJCbUmU1Q21z2OOt9VsZPweR49iVKz6MLCFQXwjfnZCCMUOXcO X-Received: by 2002:a05:6a20:9382:b0:101:4e04:cef1 with SMTP id x2-20020a056a20938200b001014e04cef1mr2701431pzh.27.1686343467712; Fri, 09 Jun 2023 13:44:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686343467; cv=pass; d=google.com; s=arc-20160816; b=bzw/nBLEw4LBQgX4EpgpqUnI6i4pM9t5yHH4/Wh6TVq94TuAvNNp6FzJ43AmW3OTuY v+FDXuJY7QqZe+v0iySsIUM4STAD8dGls9eIuLiNLdSUUNKICshjPqua0t8Si345OOLl jmSQiyspfUO6Onw/YhqCkvhvi10auovW5n6cVQGOda4YlHJInugBaIb9lLsIzNTT4Iy9 li5VG7UGbA90ntDwf+iP3Wq+egpwgrp7Bs1mFtyZJ/m1vf4Uc8SO1NVscd9i/RBAulSR JzMjv/zMySt0PluPJ/2FX34/XXk8wRVcjfS7K/+jpqGxsZ+14Sp1qqXo92sgm+y0Xi5P be2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id; bh=+1MbnaSeI0y1myuVQJTpJYiiwId3ZksKvznOVRe/w40=; b=m7QS9sw+Bikd/BNeWDjiVg7Z3CUjRzKT9n3lRfwHzDNJJVpS5T3GJNJ9VddjuJM0rS HgdYDXVZhpw1lFt5GBZ7YvkjHxJizWrx6kEG0d5Ik8vTOWF6nYjMLzwKx6paT+nrRwN/ k0yBCzoC+CpjpmBPHE+7eL54xT1/gginVb5L0A4j/9rUdO41/MMhBRwI+n1yJOXov73A w7mNebPXHnAXgmKNj/fEog/26RxWQDnNsS4jpOz6XZo3Ufwql0Uzw0ACY8FX0c/V3XHZ NTZqEOi6h/SiXfF5LlG61bbICe1KDeWAP1pqQKzL7cUaWM9JVf/IXNbLpBkf6rI4kTDz W/zg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=talpey.com dkim=pass dkdomain=talpey.com dmarc=pass fromdomain=talpey.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a637b4b000000b00543f6a35a43si3236952pgn.306.2023.06.09.13.43.40; Fri, 09 Jun 2023 13:44:27 -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; arc=pass (i=1 spf=pass spfdomain=talpey.com dkim=pass dkdomain=talpey.com dmarc=pass fromdomain=talpey.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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbjFIUb3 (ORCPT + 99 others); Fri, 9 Jun 2023 16:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjFIUb3 (ORCPT ); Fri, 9 Jun 2023 16:31:29 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2048.outbound.protection.outlook.com [40.107.102.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7FE983; Fri, 9 Jun 2023 13:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EVwPJR9FO2VqCfm7o9FWkZemj8COTMaEIZB17Itxaywl973QoNlkPSjI3yk7+lRdHwM6DPom5kGqszs7h52MmA7aMAjWVvJ6m/ywSY3RiB77LyIbrKhqfgvpDrPU8mnVN4We1+IDFIudO0V5P1xd9i8GL6B996lVjuIEXeVaH/QOI2hMqDNX4u10wInQkd07lEbhT8teSFnWs7Dq76xxT48k0TRv7b7ONpV+cLOXWH8mr2sdXZCs1ujuFIXkp4gORSVoovi4hQEXkTh+h+3cjeISFAttGywDsbe4DuvMKqcCkQpPA61jw16JLZP5z7rH953GNjiTOsm1tZY3QSmf4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+1MbnaSeI0y1myuVQJTpJYiiwId3ZksKvznOVRe/w40=; b=RDbvD+KefRHwzhCuz50nMW6IYHWbTOJHI19clkqEQHrUAJLKc3NQmKPEje6h2qwAyi0X/PjYNEYO4vr3ZTWWCdYyc21QsIBdt+mCrF38kQGanyuxMXigMY2Ws2LaU1nH6GsGM7dGRd0qEOlA6YKibi5vV90RWJ8NCTiWLaPLCg/cFM71E6rsgczTyXzNBOM6nvR6IucoSqw5iKMAd+BM7aoPwIAyaQECrH1hPfDH0+MhTchbUgENGugnZUuc96a5NhvTkMj9CuJSP1Z0qVm4rCOuwN/RzQ5KRIeDAOGa/RLjWrimY0QKcfwAn67M2hDBCBNhS1a5YYaUr4IkpLK+4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=talpey.com; dmarc=pass action=none header.from=talpey.com; dkim=pass header.d=talpey.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=talpey.com; Received: from SN6PR01MB4445.prod.exchangelabs.com (2603:10b6:805:e2::33) by PH7PR01MB8025.prod.exchangelabs.com (2603:10b6:510:270::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.36; Fri, 9 Jun 2023 20:31:21 +0000 Received: from SN6PR01MB4445.prod.exchangelabs.com ([fe80::17e9:7e30:6603:23bc]) by SN6PR01MB4445.prod.exchangelabs.com ([fe80::17e9:7e30:6603:23bc%5]) with mapi id 15.20.6455.039; Fri, 9 Jun 2023 20:31:20 +0000 Message-ID: <7ae922eb-511b-f5af-04fe-f68cd5b19237@talpey.com> Date: Fri, 9 Jun 2023 16:31:18 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v1 4/4] SUNRPC: Optimize page release in svc_rdma_sendto() Content-Language: en-US To: Chuck Lever , linux-nfs@vger.kernel.org Cc: Chuck Lever , linux-rdma@vger.kernel.org References: <168607259937.2076.15447551371235387735.stgit@manet.1015granger.net> <168607282316.2076.15999420482159168604.stgit@manet.1015granger.net> From: Tom Talpey In-Reply-To: <168607282316.2076.15999420482159168604.stgit@manet.1015granger.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BLAPR03CA0021.namprd03.prod.outlook.com (2603:10b6:208:32b::26) To SN6PR01MB4445.prod.exchangelabs.com (2603:10b6:805:e2::33) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR01MB4445:EE_|PH7PR01MB8025:EE_ X-MS-Office365-Filtering-Correlation-Id: 5940748a-47a1-499d-5edc-08db69287c11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VGzTgI89IgECFK9baIhGZ9/26rg8dbsdgFgS/grQV9JSMySK960NdLNJRNsUjLW/IUmDKwI2Q3JnoN+muHs1PRMX5p+Soqo95NMNcUXvL8HsBcbhZQEDzoRmbEQuX012hkHvYXfUDUKchgSnwcwgcGFCVKSg2kVX9UH/uOzINxkoKUleaqKsXOKNGz4urOGSOvWTa3P7k/ESO+EWxuVw47der8ghF3njsj6jZ2y9hsG59N/pxq4zE4ezvCOp0BAhrZqM/wLdQiOMMVUCE2L0nhqtVTsyOt6OwdnE7F2iT0BN2yz74I7czDOaeIk16UAdIPSs6U4Pugy80z0S82GmA3hBFXIEaUPlE0zivRophyKImFhMxWq8uxhspOHJ2TWzgDJs0eCYsfXCOT/qjhwDXGQRuBOXgS8V3shR/2wGOadw8xNoW7cQxpKuPKyp6cYFYDe/pgmDeoSt5Q1yn+y11GfLFzh8IahHWn49vo7jlRx6mYvQsM2uH8xKxeOzcYdiXKBPq4xUIJXtsbyjLmaMCv13HFpa9KufW+bnqyOX7OlFmHQPE0IglgxTS/4Dyd8QQRXrBmaBKeHBhyZznuvnRVHZOPszgaoJs97N5mM1A5th0xhkJv1kY1AyhZfPGUACVkNIrdxWryQsomolvljNVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR01MB4445.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(366004)(396003)(136003)(39840400004)(451199021)(66946007)(31686004)(5660300002)(8676002)(8936002)(36756003)(66476007)(4326008)(66556008)(478600001)(52116002)(316002)(41300700001)(6486002)(38350700002)(38100700002)(6512007)(6506007)(26005)(186003)(86362001)(2616005)(83380400001)(31696002)(2906002)(53546011)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RjNCclNCTzlTU1VBZ0ZvSWVaNGJtK2g3VTA2aXlVbUVWZVdOYW02Wk92OEtG?= =?utf-8?B?ekpWbUpQOHZIWkM0S3B1cFNGcVR4WjEzTExDMGNJWk4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B?eitYVkZaaE43Z0lZL0gzYnRlcmpoMWFscGpsbi9oV09EWUZxVk9PQW1uYWIz?= =?utf-8?B?ajdWaE96dUo2aExQejh6Z2ZmUXA2b2EvQksvQk5MUXd4WXVvaVNzNFlwejBJ?= =?utf-8?B?UnJUSkFoNGFmVERDNncweE9ZanQyMGRsanQrdkUwakhZb1lpWWNOYWswK08w?= =?utf-8?B?MFg5ZkNYTmt2YXlZeW4rWU9DR0E0UGZRUEloQmtzSHJSTGwra0l5K0hmYWQ2?= =?utf-8?Q?wMZiJMq7bgye/lbbLb73DyCpx?= X-OriginatorOrg: talpey.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5940748a-47a1-499d-5edc-08db69287c11 X-MS-Exchange-CrossTenant-AuthSource: SN6PR01MB4445.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2023 20:31:20.7481 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 2b2dcae7-2555-4add-bc80-48756da031d5 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WYgJnfPejKKWYw4WH1W6GilGn04I+Xtk8Ywe+I6kh61Pp4KsL/6AL82qbe6SmVGp X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR01MB8025 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 On 6/6/2023 1:33 PM, Chuck Lever wrote: > From: Chuck Lever > > Now that we have bulk page allocation and release APIs, it's more > efficient to use those than it is for nfsd threads to wait for send > completions. Previous patches have eliminated the calls to > wait_for_completion() and complete(), in order to avoid scheduler > overhead. Makes sense to me. Have you considered changing the send cq arming to avoid completion notifications and simply poll them from the cq at future convenient/efficient times? Reviewed-by: Tom Talpey Tom. > Now release pages-under-I/O in the send completion handler using > the efficient bulk release API. > > I've measured a 7% reduction in cumulative CPU utilization in > svc_rdma_sendto(), svc_rdma_wc_send(), and svc_xprt_release(). In > particular, using release_pages() instead of complete() cuts the > time per svc_rdma_wc_send() call by two-thirds. This helps improve > scalability because svc_rdma_wc_send() is single-threaded per > connection. > > Signed-off-by: Chuck Lever > --- > net/sunrpc/xprtrdma/svc_rdma_sendto.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c > index 1ae4236d04a3..24228f3611e8 100644 > --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c > +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c > @@ -236,8 +236,8 @@ void svc_rdma_send_ctxt_put(struct svcxprt_rdma *rdma, > struct ib_device *device = rdma->sc_cm_id->device; > unsigned int i; > > - for (i = 0; i < ctxt->sc_page_count; ++i) > - put_page(ctxt->sc_pages[i]); > + if (ctxt->sc_page_count) > + release_pages(ctxt->sc_pages, ctxt->sc_page_count); > > /* The first SGE contains the transport header, which > * remains mapped until @ctxt is destroyed. > > >