Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3169226rwd; Fri, 16 Jun 2023 13:19:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5X9Ceun3xq/Z41UZEz3+j9hADtSFrHNTvfxhg1IyNkEbuFc3igxKA6xzYsbv6hWYN0ScU+ X-Received: by 2002:a05:6a00:244f:b0:63b:5c82:e209 with SMTP id d15-20020a056a00244f00b0063b5c82e209mr2742422pfj.10.1686946762952; Fri, 16 Jun 2023 13:19:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686946762; cv=pass; d=google.com; s=arc-20160816; b=tAJdToiy5lAjdIlWZpy4fJLPuXUSR3SOeGqLrs246VUuIkAOYKdW02lyQ5DbkTzn9p iX3Rxlqsb8aCPWTdToJxQN5k0+tXy4G5f+i3NV9htjXwhGpOk9zma6u7WZ+gkQ12ucCR Y93usQz2j/i/Ih8DqFJ1MVHsJ0oE5Y7JWigRFt0IloYk4uNXGWX2Icf9VXAl5kM0WO/3 hWWO3AVLSlrNb7DFvSQ8uvWX3nXU4fWsa2S8YljbtZMStA0olc0xNww77MfI263mKVeh QUUcqhxWvlHta7iZIpm80G6UYmsPtQvt0S+ObfpI7+A4AST+kuGko1KFUstZLtPripJT DTEw== 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=xk2aH9j7TaYKdfYmMySLNO3laJ1BpxRYBi/wyTzDez4=; b=Bmyl+z19+ec5l6vpnyL9hVleyIVIthOHmql8sbSXgConsNDpJxYZz7uxUCLjR+1sQk HJbQqwuL9O9HObYKXs1ew/qzmOdb5sjJowkJzlkgoHwgM8oOJ1wWQ4cTDNQs8UGrBRYE gnrwpC/1ZCeAAXCOqKDCnNrAGRGpFH4B9rYGEKQ0fozMhsxiAZLmd+9wY832IUsR7+Cg gjaZ77Ey35cXD3lFovHoAqNsApgnFVW4ifimmwSlK5n1Urp1LWSY+hSlEi8ZI58cGbbp ijBuFrHoTZ6Yw6jbpB92dYO4RY5UrRzo8+JlI3X9vZ/lPBrShOH6emUWstAfGCj7eTd/ D3eg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=vNasRzJZ; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w63-20020a638242000000b00553213cebd2si3512409pgd.180.2023.06.16.13.19.08; Fri, 16 Jun 2023 13:19:22 -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=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=vNasRzJZ; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345200AbjFPTuA (ORCPT + 99 others); Fri, 16 Jun 2023 15:50:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231856AbjFPTt6 (ORCPT ); Fri, 16 Jun 2023 15:49:58 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2119.outbound.protection.outlook.com [40.107.93.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA2310D8; Fri, 16 Jun 2023 12:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qpv41IaBJrXJk9bvzhAoL2Xg46Cu1qduB7su+PWzfL2DK4qrNvcx0P1jU440pVzXseq4NuINxw65TQeg274xDxqZx4VFNS4FHV5afcoiBwwK9Z11bJuh/NLKH5YGBZZKsPWngpX/UW9jEeGPk9IBIZ/08S4ABszPscrcl+trzvbb7Z+5M9/ydKYTXJHTZXgJU3AEYClsPO4AdIy/wXNkNh1ZptZ52M1BD45f3voNqtMZy+7aISOC8pJiGyR81dxzLEwOyi9gGqcAcTsvg8+3GEkVxMdJ5/XlP6AaDmluQAzWD7oCigVkokILLwJb0sVE+/QHzfsmEGeCl/weWC8kOQ== 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=xk2aH9j7TaYKdfYmMySLNO3laJ1BpxRYBi/wyTzDez4=; b=NJmM57IeCyrdiDM38iOJffVyQWRPSatx51uwzevme5FR3VtLcGSkP0Dzy3XCr+1r73dzoRUD1MsT3nTJagKRneAO9y9g5SEtQJrxNuUlKwB4JmeZv4p3ZBTIku9qB2E5kniLnR/SyF17jSWS2sREy3/DkkA5lu6eFR7kevtFsCOMc4Dk1afSROJTDaczFm1/mbR0NdfT3ZCstiDKRt4SGxoOPGSphv6RlZL7U0iKJHCznjLGkDcXj0xO9Q8bn7Tv12KE7lEzl4HVOqOxmm05psyPGZdsf9v7gtz9lfQ9qbvJl1/zotKPmrY5wKySYU3s/a4onz3CdF6n0LYYgA8x4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xk2aH9j7TaYKdfYmMySLNO3laJ1BpxRYBi/wyTzDez4=; b=vNasRzJZSm5BDWey9MCFIf8YOUkBw1QTKn0KJ4XBbikjD3Hii+zoagbYNGlVHlYxFIFfcl38fwVSly0sx6ItHVK4B98khV8rPzNj0M8tQPV8pzgPaQw+vlsRBs8pORoj7Q/ZoOmkha8V5MzbJxYP6Fk18OFtQk2kneevuR1Ahms= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MN2PR13MB4037.namprd13.prod.outlook.com (2603:10b6:208:24f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.29; Fri, 16 Jun 2023 19:49:53 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e%5]) with mapi id 15.20.6500.025; Fri, 16 Jun 2023 19:49:53 +0000 Date: Fri, 16 Jun 2023 21:49:45 +0200 From: Simon Horman To: David Howells Cc: netdev@vger.kernel.org, Alexander Duyck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Menglong Dong Subject: Re: [PATCH net-next 01/17] net: Copy slab data for sendmsg(MSG_SPLICE_PAGES) Message-ID: References: <20230616161301.622169-1-dhowells@redhat.com> <20230616161301.622169-2-dhowells@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230616161301.622169-2-dhowells@redhat.com> X-ClientProxiedBy: AM4PR0302CA0011.eurprd03.prod.outlook.com (2603:10a6:205:2::24) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|MN2PR13MB4037:EE_ X-MS-Office365-Filtering-Correlation-Id: bce14373-aea6-43b4-ae89-08db6ea2da70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ETsZMFkyS7j3I9hQxVsRv+Okmyy6oEpYBmphs7dyhIUPMLmYaLtBcpVBITM1Afh7xUM6sU9kTiCQKWamJ/CBEYsNYRyxEu8KCViENnfO5up3JFD5IcLB/arLEah6HI9Mgnxg4gaF78pOFZBHSAho608/ciwcWH4thmJCRG7iDZNrua7bdIGKQvF6Ctsh+ytktNxZObSaf4Sa4PO26zPmPb5V+OFjPJJeYRZBtSKRB7y4RL+TRpJWlhOhOEsiPJhFtzdPV+1tAxWzSE0JQQpvs2xz4qFMOCW608PxPUMyKyJOJAAahTzVkG5G4Jya6ghvTsqmbDFAcepfKfNDuMM1TtiRBSG5mIJTI5aYorYXa2CiYxaQmwnFzF2nCwNVL9MMW6pFYOspWWbwdFNhHgB/TrXGoS9oP/QWX8h2dvNBH7z0vFTpovbk8fhIuKRBNlv4NwfNUkXs7JuirOiCX072H7Epg55QfVkRdz30bmRIEUgClU7Wtgxqv1iKGFnHeOZOlSZMx2i0VkllAgLH9qgvqR1xtV47p7YDXFRO843MfJHFJ6DWzdmyuWHw7uEF9zz2sNjbO8+n4hRgpSvUsi0r04QD736CKj+UQ5herZPdwZE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39840400004)(346002)(366004)(136003)(451199021)(6512007)(478600001)(36756003)(6506007)(186003)(6666004)(6486002)(4744005)(2906002)(316002)(41300700001)(44832011)(86362001)(5660300002)(8676002)(8936002)(7416002)(38100700002)(2616005)(54906003)(4326008)(66946007)(66556008)(66476007)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7sHqMvRM3PTiHT5VWFmvIcaPGEOeVNSchiIrYaZUp5TAQBy/+iA2hR5yE7VP?= =?us-ascii?Q?UQSblo8cqUAgOCFQrEiA8N6YArZeaPN/6j1Uq/Xj/2lRvqxd74RFTRFCzXsk?= =?us-ascii?Q?KcG93Z3NX5Gnsv5JrCWdolKkheUgh2f15aYqUoYuxmPNdlQQYNRNPeXWOkQf?= =?us-ascii?Q?f0Gh+n39chpjLGhnqtQ4SBWFow8MHYMUMg4lq3gMCOX8isEoH/8yFk9YJpXZ?= =?us-ascii?Q?9DIxLb/PELf/wH/h1aD7R9gMXr/doKS2Xpo3Qp9MPLdUpv/sSu/gHcF7SE2p?= =?us-ascii?Q?ktNeYiv5GUmi5nn3IDrIq4TQdnzW9DPc/jF+0LMscFniWm+yMu3JHdmLj9KF?= =?us-ascii?Q?0bMXS41OW4I6a8/ccWnd+b+29uI5IKcRuAtEEcQ/uDCxq3YONI4dsrgbhn1R?= =?us-ascii?Q?qwW18prch79OD4IMxVYVNqXWPFnkLXGuC4D+oQ4grnDSLDtot9HeKLpECU7j?= =?us-ascii?Q?iKTEjdlqtCqQiR50qir5KPw8ZJCdUyaUsvi6hdCr5fIYGNAhikvFwhnH/oME?= =?us-ascii?Q?5ZeRat9a6NoMmjmdmw+esjUvfhSHxIOpnuj00QnsL76E8ABQgg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rf8I+S1Lcpla1jEZz5kYZXnQ6ViczcLz?= =?us-ascii?Q?QqfdDlPsxaPcdzlwmW0/lWCAxaSEqrQgwUsIk/vp4Lk9g7Ieb25JpUl1oKig?= =?us-ascii?Q?zhF/0WfX5EHzPy2u0TqcDzVOHcclHADp9UnMggAodZ0X3JnRsk6fcSoLVw2O?= =?us-ascii?Q?tgWoz+JEi1EPNUW+wAaqphZRX7Ky1OTKrzPaYVs+AAQAmghMF7o4rFrxlHY0?= =?us-ascii?Q?1mL/fw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: bce14373-aea6-43b4-ae89-08db6ea2da70 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 19:49:53.4116 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AhVrALmfh7TF7n0HlM9pdGXhIq0XHaMjpJT/+uQrWc2MD2Cl1K3y3rgV8qM2oQ7SpkFY0CK1WgSk3RH6lPmb/BrZpyRNRKvjXd+GfTeuoeo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB4037 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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-kernel@vger.kernel.org On Fri, Jun 16, 2023 at 05:12:44PM +0100, David Howells wrote: ... > +/** > + * alloc_skb_frag - Allocate a page fragment for using in a socket > + * @fragsz: The size of fragment required > + * @gfp: Allocation flags > + */ > +void *alloc_skb_frag(size_t fragsz, gfp_t gfp) > +{ > + struct skb_splice_frag_cache *cache; > + struct folio *folio, *spare = NULL; > + size_t offset, fsize; > + void *p; > + > + if (WARN_ON_ONCE(fragsz == 0)) > + fragsz = 1; > + > + cache = get_cpu_ptr(&skb_splice_frag_cache); > +reload: > + folio = cache->folio; > + offset = cache->offset; > +try_again: > + if (fragsz > offset) > + goto insufficient_space; > + > + /* Make the allocation. */ > + cache->pagecnt_bias--; > + offset = ALIGN_DOWN(offset - fragsz, SMP_CACHE_BYTES); > + cache->offset = offset; > + p = cache->virt + offset; > + put_cpu_ptr(skb_splice_frag_cache); Hi David, I don't think it makes any difference at run-time. But to keep Sparse happy, perhaps this ought to be put_cpu_var() ...