Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4305599rdh; Tue, 28 Nov 2023 18:55:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IG99UWNoTOHhfbQLL/odxOqJvXfB4uivvn6j+VH57BOheQIPDc+AHuxPD1u/a+lV2MYfRhm X-Received: by 2002:a05:6871:4e97:b0:1f9:fd01:e003 with SMTP id uk23-20020a0568714e9700b001f9fd01e003mr16795387oab.22.1701226514870; Tue, 28 Nov 2023 18:55:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701226514; cv=none; d=google.com; s=arc-20160816; b=hTTsDFiaEdFpHu9jCY9nxjLZXyODb+/KNNB43SfhqK0vTjDCtcRT1gy9un1kEMjTHj hcSan3DRd4HPzc+qnyZRcwwfaegAoRJhFXw6PEEWQwnsgUnMbP6GhRUDCtHKAEWsNZSJ O6eS8VVTMXAc9VRIiqdGE8Tu74+miNcetdJ9Ah8pvyB3cJKBwymN9o0jXH56R1yg5exN VRALa4FqR+MXpxul10BleL9wArOMEAI1yRpl4XRNS9k5sJ7lyd/S6ZDdakz0PDsp4zZf mVz0e0pgTypLOf0S+ck0CAz6obiTIXUo/T9oqLUYC4U/s8k5ytiOk72kK5cYhgWNaBVB SUNQ== 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=AObJ6PYPL6TVP843PukdYJ4PmSL5V69n8jwR1DpIaAw=; fh=yXZn/5hIxGWpJrlHHC/RcK37XPmZZAPT0QrHxDS4GAM=; b=RjRn3pB5UUvRqb275YnA9HcoMwqV1PWreyCyp1rAs3IaPAmWekKDBQuytP/O9BEdX9 ksS0BbyBXqw4iXaHOZX3cfG+woKyfvReYmXtTQKiV+kPm+9a5/aSt5qO+OPhkbaRboX4 1rj/gDLkFKUpKfy78658SvaOs3dKuSSP/L38Is2d6xBOtR833F5x1GgZ+kclW2rjC4KF WLG66qVmQfXgJX64grbo02ZmOEm/wWtfW3GTloAQTjCKTKUoIcTIIlAGlsdN4ExgHWWU OZJZzcH6znDhgJJeZKLqPskI8zHqwF2D3RijVBCqufdUlts7yQNArTmHW5IwWZA3fgkj 3TLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bw28-20020a056a02049c00b005b88dfa676esi14030757pgb.158.2023.11.28.18.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:55:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 6938680ADEFE; Tue, 28 Nov 2023 18:55:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376806AbjK2Cy7 (ORCPT + 99 others); Tue, 28 Nov 2023 21:54:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376788AbjK2Cy5 (ORCPT ); Tue, 28 Nov 2023 21:54:57 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D0EA19A4; Tue, 28 Nov 2023 18:55:03 -0800 (PST) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Sg3nf1VjFzvRHv; Wed, 29 Nov 2023 10:54:30 +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; Wed, 29 Nov 2023 10:55:01 +0800 Subject: Re: [PATCH net-next v5 01/14] page_pool: make sure frag API fields don't span between cachelines To: Alexander Lobakin CC: Maciej Fijalkowski , Michal Kubiak , Larysa Zaremba , Alexander Duyck , David Christensen , Jesper Dangaard Brouer , Ilias Apalodimas , Paul Menzel , , , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni References: <20231124154732.1623518-1-aleksander.lobakin@intel.com> <20231124154732.1623518-2-aleksander.lobakin@intel.com> <9902d1c4-5e51-551a-3b66-c078c217c5ad@huawei.com> <5e6859d3-d3e7-44c1-acee-2c4ec568615d@intel.com> From: Yunsheng Lin Message-ID: Date: Wed, 29 Nov 2023 10:55:00 +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: <5e6859d3-d3e7-44c1-acee-2c4ec568615d@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: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.1 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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 18:55:11 -0800 (PST) On 2023/11/27 22:08, Alexander Lobakin wrote: > From: Yunsheng Lin > Date: Sat, 25 Nov 2023 20:29:22 +0800 > >> 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? > > 1. There will be more in the subsequent patches. > 2. ::has_init_callback happens each new page allocation, it's not slow. > Jakub did put it here for purpose. > >> >>> >>> - long frag_users; >>> + long frag_users __aligned(4 * sizeof(long)); >> >> If we need that, why not just use '____cacheline_aligned_in_smp'? > > It can be an overkill. We don't need a full cacheline, but only these > fields to stay within one, no matter whether they are in the beginning > of it or at the end. I am still a little lost here, A comment explaining why using '4' in the above would be really helpful here.