Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1231777rdh; Fri, 24 Nov 2023 07:52:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1k92KINqhl1oGPNAz0IIVSrfHHwuFQ3OyNBqIQUr/yD5APENJ3arDNRCxC9BpL3Ym8Otw X-Received: by 2002:a05:6a00:2449:b0:6cb:68d7:b163 with SMTP id d9-20020a056a00244900b006cb68d7b163mr3467940pfj.23.1700841156871; Fri, 24 Nov 2023 07:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700841156; cv=none; d=google.com; s=arc-20160816; b=nbFts1ySdwpm5R1osmRebbinCHZxYXmT/BIGitPeytlwo7oh20eLMVH/1eQ8dGgqJd dG+mMv698VwoahYDQYiP9anf1PMCLEreidBbVjJb3uk8OfoH27Gavzmq4/oLpsx9gLtD SPiAV+E7v5lfcabSytRvh4sOatfT4q60h7ipYtOzayCjWwC6a9vQRfb4VcRMT626RkKt CAD60tSuEIAcfYEn0b3Ee2qzFGGoiruTzQ54afQhyNehk+qoU5rOkOReQmA9lRg9sS5Q BKG9ETKsIDxgGbwadnQ7qjzXTuWwVQKzCQjGO+vywGUjB4VB16xQdBc7gDSwBI1/Y4y5 Bg0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ORavtEfJb+uxkBDxdprTRTOtl1178wDq6mIWiYPRwdw=; fh=QtEizEezWMPccSW0U8o1LFLT1SqErEb68UiNokAWV6o=; b=PHSSvtzG9iq+JeJgehNpMBOuk5DReo/iINivaEZJBUVOneumkmrha+5VuFtqvvm7Lx CRpzxCSXJcNcz9ql78zl5+Ybf463vh6HApy44U1Usgm3C9KvHyFE2AbHZ2MA34f42XFu lYQ7++lwwg3P3NrwE4oXwcZ9xvbZdR5UnaFR4sAC8HZl/fQcbhaZjVYU6ym+NFK/lDIf MeEbhI69O9ixaqg/lepUnG6KtL9twLfCVWcO0tGcUCwgJptlERU2aQhnTasw8xHufupY s7sDdfj/CudmpyleiuVfmDSU5IonCg8i36beTcqOTv5uT4jt2B2iVF4gcxTpHAxJva7v CUKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rb4hW5Gg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v6-20020a626106000000b006cbe41f2c1fsi3571005pfb.398.2023.11.24.07.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:52:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rb4hW5Gg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8F8F7805A78D; Fri, 24 Nov 2023 07:50:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345908AbjKXPt7 (ORCPT + 99 others); Fri, 24 Nov 2023 10:49:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345902AbjKXPt5 (ORCPT ); Fri, 24 Nov 2023 10:49:57 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A0F919A5; Fri, 24 Nov 2023 07:50:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700841004; x=1732377004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=C2fNXu9LchJZpawCUkZ551134BYCp00pguSifkMlGMY=; b=Rb4hW5GguezRiVKluigXxekp5pJy1J+U4c3F4ZCvGl8quye4kwtZR3Tf Jxa9dY7gzebUUG05RFXEmChz2cIzCedKWlJ8YgzDu5sfW8c3T1w6lyHuK tyeDp1so4dvuNsWT3b8oogueFWRFAjRWK/MdUkq4VLE6ty9dDlJPS96UA zbkp0n56VqVKkUCmEk2NDAEBdD7jhJgfW7fq0Bg23feAZRtZ8jJOsm3kV UNSHBCxSEQE8Nt//o8jyFWW7vHC2OA9kT6d4SjMvhPd3PG3Rsc0q1kQ+q wlkQUgBsgQF/uICsCpWbKj4BhiV5eHSg1xmdcwRtIcmiFono+WNjprprx g==; X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="389592431" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="389592431" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 07:50:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="15659777" Received: from newjersey.igk.intel.com ([10.102.20.203]) by orviesa001.jf.intel.com with ESMTP; 24 Nov 2023 07:50:01 -0800 From: Alexander Lobakin To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Maciej Fijalkowski , Michal Kubiak , Larysa Zaremba , Alexander Duyck , Yunsheng Lin , David Christensen , Jesper Dangaard Brouer , Ilias Apalodimas , Paul Menzel , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v5 01/14] page_pool: make sure frag API fields don't span between cachelines Date: Fri, 24 Nov 2023 16:47:19 +0100 Message-ID: <20231124154732.1623518-2-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231124154732.1623518-1-aleksander.lobakin@intel.com> References: <20231124154732.1623518-1-aleksander.lobakin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 24 Nov 2023 07:50:40 -0800 (PST) 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; - long frag_users; + long frag_users __aligned(4 * sizeof(long)); struct page *frag_page; unsigned int frag_offset; u32 pages_state_hold_cnt; -- 2.42.0