Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1822370rdh; Sat, 25 Nov 2023 04:29:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUHiWYVAH4hLeVGWHb7UXTVDf+UOen1/EUD2Zyb8+JE1/B8/HltuRGguKd56q1WSN6SFrp X-Received: by 2002:a05:6e02:20e5:b0:34f:e02a:f820 with SMTP id q5-20020a056e0220e500b0034fe02af820mr6573074ilv.12.1700915378516; Sat, 25 Nov 2023 04:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700915378; cv=none; d=google.com; s=arc-20160816; b=bSNI+pchDOgxBCY18EtuJEanpk9MUkGs7t8g3+leOZJH3Hn2A4mIMNAplUb3uez3Yk /MCxsC9JGHd0Wj1JJhTCknuJI3gKf6fM4Y3n+MdtRnBa/iY9p5HgHOmiYFjTBI6Gft1f O/0swgkIX0B0xBqpLUAlHn64Bsov3oZax3nFDniSdU65IFxSFlsasO6WxbMZBv1zRMrG 4K2aZiGmbit7g5r4vzZu779cllcIc141/VXa4zf7TjZ87aRjEkui0t1BO24s8SsjlDhi e8wkmerBIz62oKwtPpMh/rxlIDXiaEB3WoZmx+ScDrEteMQNLsA9fnwSGmsoezxxiLzo qJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=9/8RZ1hJzRtQr+FfM0N/AnkpMo3B7qSUGP8h6OU8bd4=; fh=ViJZPlUnsmDftCUB263Ts0kc3VhL7hfuAIADeVj8VQg=; b=oMAup1WWI/C8YURuw+MeY2/2/0EnDigfDRo5YPLe7QWQhxb95PqyDgtC/Wm9URNvMv eV+FK+lq1e1Or+pmwFkZQ0yihPAr/SLDkVwFmznkmoMzc1QGnsqRu3tYIUsGLA5VSPze OuirsAVVN5NQpd0HlhPztgHO+m06ArX8PTdq43bD1Iyx6XWkVIJyc/lWC1nRhmOS6aKb Sz8+eWWgv4pLtjnFY7Qq6ydhL1Be8zjm/7PXfKUbRgQaM+VPrzZF8PL3WYl0FLm9UZTH XHEzh00A+Vq0MOz+s7zy5Vt9PKMWRwuTDrgQ/OJstmpCRem2hFNUyURs0AI+cPEaTSuZ c7wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id bz8-20020a056a02060800b005c1faa82bfesi5851392pgb.857.2023.11.25.04.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 04:29:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 27897802158D; Sat, 25 Nov 2023 04:29:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232023AbjKYM3T (ORCPT + 99 others); Sat, 25 Nov 2023 07:29:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231838AbjKYM3S (ORCPT ); Sat, 25 Nov 2023 07:29:18 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC228BF; Sat, 25 Nov 2023 04:29:24 -0800 (PST) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4ScrdJ16N2zMnKp; Sat, 25 Nov 2023 20:24:36 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sat, 25 Nov 2023 20:29:22 +0800 Subject: Re: [PATCH net-next v5 01/14] page_pool: make sure frag API fields don't span between cachelines To: Alexander Lobakin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Maciej Fijalkowski , Michal Kubiak , Larysa Zaremba , Alexander Duyck , David Christensen , Jesper Dangaard Brouer , Ilias Apalodimas , Paul Menzel , , , References: <20231124154732.1623518-1-aleksander.lobakin@intel.com> <20231124154732.1623518-2-aleksander.lobakin@intel.com> From: Yunsheng Lin Message-ID: <9902d1c4-5e51-551a-3b66-c078c217c5ad@huawei.com> Date: Sat, 25 Nov 2023 20:29:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20231124154732.1623518-2-aleksander.lobakin@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.4 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 25 Nov 2023 04:29:36 -0800 (PST) On 2023/11/24 23:47, Alexander Lobakin wrote: > After commit 5027ec19f104 ("net: page_pool: split the page_pool_params > into fast and slow") that made &page_pool contain only "hot" params at > the start, cacheline boundary chops frag API fields group in the middle > again. > To not bother with this each time fast params get expanded or shrunk, > let's just align them to `4 * sizeof(long)`, the closest upper pow-2 to > their actual size (2 longs + 2 ints). This ensures 16-byte alignment for > the 32-bit architectures and 32-byte alignment for the 64-bit ones, > excluding unnecessary false-sharing. > > Signed-off-by: Alexander Lobakin > --- > include/net/page_pool/types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h > index e1bb92c192de..989d07b831fc 100644 > --- a/include/net/page_pool/types.h > +++ b/include/net/page_pool/types.h > @@ -127,7 +127,7 @@ struct page_pool { > > bool has_init_callback; It seems odd to have only a slow field between tow fast field group, isn't it better to move it to the end of page_pool or where is more appropriate? > > - long frag_users; > + long frag_users __aligned(4 * sizeof(long)); If we need that, why not just use '____cacheline_aligned_in_smp'? > struct page *frag_page; > unsigned int frag_offset; > u32 pages_state_hold_cnt; >