Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4759366rwi; Mon, 17 Oct 2022 10:16:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SPdnDM2Yk7DSrTLst8B/xpNRTAg6eA03xMjQ59PHQ+WN31DYyWCMirtB4lQoOhoSGmSTi X-Received: by 2002:a17:902:d48d:b0:185:115c:b165 with SMTP id c13-20020a170902d48d00b00185115cb165mr13223294plg.86.1666026974697; Mon, 17 Oct 2022 10:16:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666026974; cv=pass; d=google.com; s=arc-20160816; b=vGZ68haCTfJW5OGWsutrWZp4WojoXYstiCeZRpWou5wa9YoFQntXHoAZ863Vg9LkU4 uTrzjMtZM/cQ9iYy+hfp+M//BmesPdx18dm0Ah8pKxv7S71LZ5G8EPfVIQ4yFqoIEo3a q9rdJi+IYSEyAUnENiWH58uGElJp2D6oDsg3vvEW9jz/LlyvlZWexWT6qcIkRO7zfsrc oRiVGtxzQnhfohnIiJJDMR21xPJtZ+Oq1PQbif2B0F98YfcwxeWfrsppvZAkne6NSSc4 ssz5hAU/X0ITS9yNmkq1vFYRv18Rqf0ORLpQM1ylpDIh/Pnw0nHbUtA5rYbMaC/D0khf jV2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sJndO+WYzbz5is5kB3zdIkNOVtirp5H2I1z+a+edfSs=; b=rSMkj2rZSonGPXBjm3ZaQd+FxFXIQpMzPdwClyZ/2PiJj7L1CuGyPCPw7wUKCWyUVB tapdMtt8mdLP5oOBwyUOjNkx4mmZ3YIsDiovXtrlTM7lAXlmSIEah5hxgOKjh803Odyn AUqbRzsEQt0uZfzvsxi6XMql1ydpy7MZQfebOCUu7aw++0g7Bkqiaf2Z0cvdAH2dZAII 4fkI8HhWyJN8OLwxO9dKuR1D4F311Wi1HJUrqAwwK8XuoiwqkR3bdab3atKUIcJz8sWJ K3ShX+HfEjeGjgxFDlN2h5KfR8zeanbolRqbMpneNYoILtoUqPgH2Bus1kn6gEb1Ifzj iY/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Q7bzqYh9; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s200-20020a632cd1000000b0042ff6b15129si11789010pgs.2.2022.10.17.10.15.55; Mon, 17 Oct 2022 10:16:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Q7bzqYh9; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbiJQRD0 (ORCPT + 99 others); Mon, 17 Oct 2022 13:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbiJQRDY (ORCPT ); Mon, 17 Oct 2022 13:03:24 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2077.outbound.protection.outlook.com [40.107.220.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16A786F24C; Mon, 17 Oct 2022 10:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WDPnJWxNyikFSP1JxvP7cuNzVd9wJbWkE5gc5AM1f8NYOy6w0deMXthag6JWROSMnI349xLAk/mXQEngWu9+5eYU2RLoshT7GpgmY0IgyD8n0iS7Xlib+hDvWKzc2SH0YG16xZZ5fqKhTxXrAjobdVIQht2zF0Pgu2TrlNmCZZz5+rxoOdFJjbAagZLMuxD3OeJTp2WwBbV8aayY+LFdFWuetCOkRTndzdI3Pn6unR2BGMjLg2qyzKwgt8bHW6WVlqTTyOd6TwbSkkvjZQZgHrRZ/hp9TLLspecbaxt/uTHH84UE8EY4lk8s1u4XevzBEZdffoHomn5BzBqIVYwgkA== 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=sJndO+WYzbz5is5kB3zdIkNOVtirp5H2I1z+a+edfSs=; b=Yw/qGHHCE92nivX0g9yKaquUyatg8yEntI3o6YEh1NOO8u2/5uxp/6PUl0ILRxPykQmfFNwTV+VlWHUgL9QYX8wzj7szGZFQgXM8r5jOb/BbT2wVd0K0k92Fb1wDYkrZMecaNt4Qb1c92FGscKyMhzfzkilfPwXXJ/y+2qb5Kkl6CYJ0qOTjl5knHH1HzBDRNARdm0G3sMREfSw0MjXSDyq4bGdESi8AjhKEqiZZ2+xjaHGWXkJGsiQNJUeFUkgJ7isRAMf1xtsuTMcXS0BIvlpXvj93bVXXYOiiC98czccMXBr2ZPJ4eh79K5Rn1BpeHUAeRuVnfynoH4045qDeqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sJndO+WYzbz5is5kB3zdIkNOVtirp5H2I1z+a+edfSs=; b=Q7bzqYh9T7iCqAwgqDlEPD5jetxV3x9K+QPBFZSdezBHLZ1Yq2hdJuSvcw7iP+vxhUx+z9nKWcSLUSP+Lux4ZFwJxmQZolwVpLGvzYqHL9qcaS7o41BfJyTlXDS/N08UpR2jlcDaWVEAjyuKoAV5dfDqMPWODRL4znZGyd23p3jje+unNhZkbeNJUtZmSnG7ZYb+fKKWOJuz9W9ydtsNC1BPjotCnb6CAFVf4ZJkO5+mvWhw69tmZ95nbbUlqyNcZcagV/wfOXA0MJW5EcFWF7BHjd1inwVUbNkHTm9D5onuqJV90TkTNdfbHPJU1Sb3e8+IgUorBKk5b52KhbkbCg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by BN9PR12MB5384.namprd12.prod.outlook.com (2603:10b6:408:105::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Mon, 17 Oct 2022 17:03:15 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de%6]) with mapi id 15.20.5723.033; Mon, 17 Oct 2022 17:03:14 +0000 Date: Mon, 17 Oct 2022 14:03:11 -0300 From: Jason Gunthorpe To: Christian Schoenebeck Cc: v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Dominique Martinet , Eric Van Hensbergen , Latchesar Ionkov , Nikolay Kichukov , Leon Romanovsky Subject: Re: [PATCH v6 11/11] net/9p: allocate appropriate reduced message buffers Message-ID: References: <3f51590535dc96ed0a165b8218c57639cfa5c36c.1657920926.git.linux_oss@crudebyte.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3f51590535dc96ed0a165b8218c57639cfa5c36c.1657920926.git.linux_oss@crudebyte.com> X-ClientProxiedBy: BYAPR05CA0090.namprd05.prod.outlook.com (2603:10b6:a03:e0::31) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|BN9PR12MB5384:EE_ X-MS-Office365-Filtering-Correlation-Id: 84275d8c-183a-472e-708c-08dab0617adb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1IinCNpJ+Jh5MPezwnaNA1P/sGtXgnUhMjpAVcHvcyNyPIboVYRnb9R7EX0BUp7xlljUj78dWIq29oRc+4cD/gHXs490VIkqKCjiJ2VXudObrJc7kvTPtNbxw4raQKhtyXJSyG3u5/kwySkJOSlNQ0hXKsEoVDK69v/bW1uspIb3NVVDeCYuK5BZIarxnYAr9H0DXwz5YEAglHGN1OXyL68UXgVtl/aHEClSHB6SPlSneHvMMtagfBk/Dduq6ajXFpNt3fwG29iuj9QpwcZp0vLBp+3rSDcCyMjiFTNci+HfFXa4IS3Zh5B9eJ+/JPaJn8yCtuxtXVhYV3ak9tnRFDWPbpTDpYb+q0lcpe1WpVF6LwdXdry0qLxuAuAZXgY3s2y+Us7yk/AoYy64gyj64ixpmVdb2wtil+EVjy3xz43sg8tRElOuJ68RnOrBZcCC4+xskKh9ZMSCsmjjWphnnoPGFHqTNHNxP8G9qJJxWmiFrJB4SAE3irIMnglFUehASy1ejRpepGy+ZK0WPe7ZXR/Jtrm+Qk3OSehcK3JbwWGC6r+YTCleRXhpvDP70J7vdRTliMdIogqAzup8zw4dsj1+5kCG5dFr9ynA9qtUGN9NGrmt6AnoTBRyY+WNJ2pfcbBV+ynuZBRboHQALslsGD1qLtCot3Yp2L1jNYlZ48FH22Mhn5Rf1viARafXVEz4CffTeAJ1hdzC3WNr7N5yyJlSc0ShwizBw0qh6HRuSZ/ABmXNbeJPZ4HmfNmJ6zGX5KkuZPk87KgZmocgz5Mhn+ls5LsfbJBOwyshkZPqgeLeabN8/fYOkCEmdcdMamsXFO3jlTeP7ih//JKDqOb4tw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199015)(54906003)(6916009)(66476007)(66946007)(66556008)(6666004)(107886003)(8676002)(4326008)(316002)(2616005)(15650500001)(186003)(2906002)(86362001)(83380400001)(26005)(41300700001)(6506007)(36756003)(5660300002)(6512007)(8936002)(966005)(6486002)(478600001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BpMlDZcESj5Ky3gdtz07V/6+rE4qFUhCzedopRZ8ss33PisdkQDat6vek5LS?= =?us-ascii?Q?LUnwo1LQ2A0EaEEd7OQN7ToCU8pjqbjrMKo563Fw3TxoPG1D1JFQAKlesMjH?= =?us-ascii?Q?UuQ0xTrM4jmxYoZZDpigIIo5pUVz7d7tBF6X9iEl08tg75EwezrNipdS7xMR?= =?us-ascii?Q?vauui+QFKsOsdCHqbJm7h3u70BVvdg1NYOhgJ/4iq+pmYyG5UqT6hvHe1iwZ?= =?us-ascii?Q?TP+oGmcZt26jwv14L5r9FLwtHExR7ioKbmveruvh0Welhyu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2HqVm8SPvHbClpXOQKPMzOklK28qDCNwo1Dp?= =?us-ascii?Q?w/QPsc4R5CiqkRZnMBKT3OZTKWuaKKn26p0znBsYGfgoTT0WcdSqtDSVET9O?= =?us-ascii?Q?X3m4ezlFZw2vLiEPG+ymBR4xb0rVx/65cPm+j/zSImRXWKkfYbn6pohgrKXN?= =?us-ascii?Q?CQhDdWY1kqSHf/XuLr3FKJCaY5JdUVrJEJ6j19+BQJKtMqQlxNTgGc+Htyo3?= =?us-ascii?Q?dc/AK86dM/I1oH7rgUOydZuVno6aUDPEQPWTTPbTWXh3leWNRcE8iZWauu6d?= =?us-ascii?Q?z25uoJBS3tYTLiPstd+0CisMz1i6cppjm8TMBXOkRZaR/LMSIY4WJRxazdqA?= =?us-ascii?Q?465p69kncQQ8nwpGPRoOzLcr0QlwMVM7suzbS0gU8P713O9lkermxfJnILEd?= =?us-ascii?Q?WCuxwMpc3iH66JC2MDg=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84275d8c-183a-472e-708c-08dab0617adb X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2022 17:03:14.7895 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZRqX8ZoZfxqil7IyCoYZfYygBWNvdxic3fmetTNJ8OzeCdbFgOtbrb/4m5zhsEIY X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5384 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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-kernel@vger.kernel.org On Fri, Jul 15, 2022 at 11:33:56PM +0200, Christian Schoenebeck wrote: > So far 'msize' was simply used for all 9p message types, which is far > too much and slowed down performance tremendously with large values > for user configurable 'msize' option. > > Let's stop this waste by using the new p9_msg_buf_size() function for > allocating more appropriate, smaller buffers according to what is > actually sent over the wire. > > Only exception: RDMA transport is currently excluded from this message > size optimization - for its response buffers that is - as RDMA transport > would not cope with it, due to its response buffers being pulled from a > shared pool. [1] > > Link: https://lore.kernel.org/all/Ys3jjg52EIyITPua@codewreck.org/ [1] > Signed-off-by: Christian Schoenebeck > --- > net/9p/client.c | 42 +++++++++++++++++++++++++++++++++++------- > 1 file changed, 35 insertions(+), 7 deletions(-) It took me a while to sort out, but for any others - this patch is incompatible with qemu 5.0. It starts working again after this qemu patch: commit cf45183b718f02b1369e18c795dc51bc1821245d Author: Stefano Stabellini Date: Thu May 21 12:26:25 2020 -0700 Revert "9p: init_in_iov_from_pdu can truncate the size" This reverts commit 16724a173049ac29c7b5ade741da93a0f46edff7. It causes https://bugs.launchpad.net/bugs/1877688. Signed-off-by: Stefano Stabellini Reviewed-by: Christian Schoenebeck Message-Id: <20200521192627.15259-1-sstabellini@kernel.org> Signed-off-by: Greg Kurz It causes something like this: # modprobe ib_cm qemu-system-x86_64: VirtFS reply type 117 needs 17 bytes, buffer has 17, less than minimum Jason