Message ID | 20230524171904.3967031-11-catalin.marinas@arm.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23852C77B7C for <linux-mm@archiver.kernel.org>; Wed, 24 May 2023 17:19:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BA7190000D; Wed, 24 May 2023 13:19:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96AAE900002; Wed, 24 May 2023 13:19:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85A4490000D; Wed, 24 May 2023 13:19:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 769A8900002 for <linux-mm@kvack.org>; Wed, 24 May 2023 13:19:54 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 522C580ACC for <linux-mm@kvack.org>; Wed, 24 May 2023 17:19:54 +0000 (UTC) X-FDA: 80825811108.29.0FBB9B4 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id 8A3FC40013 for <linux-mm@kvack.org>; Wed, 24 May 2023 17:19:52 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf01.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684948792; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cf1L6WmjPMAYm9aSbUscBDbAibSbBWO2SXPG1VqERas=; b=1n29m0e0qZgmzfhJhn0aNSAe2nYqcpuUgSiU0GXQsvj/CPyECSWbNGNI9Dg/xDldX+IQnU c+jIG+6Ef/0KdELxwseKlGuKmUgSOJnH0WI1IxZ7ErhF+CxYL9nKNMxruWDokpfgwqTDQD 2VOA3iBCBI3YeL9NR5zS+iqFkBmpSog= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf01.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684948792; a=rsa-sha256; cv=none; b=bF6OEkc9X40cpEux42E7l6BWJqh/Nbc79i94T9Qd3aj4XRTIpEOYMsLtkT74FInGPxaCOR t5rUjp9JcHVzAtGRDtlwK8YMLy72fUVnhLudbi95myn3W7/G+eeanO5PndY8F2DRwJnsHJ 9ZhXQQDx4SjpMSy7/sMmKKjWgLXevr8= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9E60163E27; Wed, 24 May 2023 17:19:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E95DC433A7; Wed, 24 May 2023 17:19:47 +0000 (UTC) From: Catalin Marinas <catalin.marinas@arm.com> To: Linus Torvalds <torvalds@linux-foundation.org>, Christoph Hellwig <hch@lst.de>, Robin Murphy <robin.murphy@arm.com> Cc: Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Herbert Xu <herbert@gondor.apana.org.au>, Ard Biesheuvel <ardb@kernel.org>, Isaac Manjarres <isaacmanjarres@google.com>, Saravana Kannan <saravanak@google.com>, Alasdair Kergon <agk@redhat.com>, Daniel Vetter <daniel@ffwll.ch>, Joerg Roedel <joro@8bytes.org>, Mark Brown <broonie@kernel.org>, Mike Snitzer <snitzer@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 10/15] arm64: Allow kmalloc() caches aligned to the smaller cache_line_size() Date: Wed, 24 May 2023 18:18:59 +0100 Message-Id: <20230524171904.3967031-11-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524171904.3967031-1-catalin.marinas@arm.com> References: <20230524171904.3967031-1-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A3FC40013 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: ik9opr731qxab4wywkkyrihhxf7xxw3m X-HE-Tag: 1684948792-799068 X-HE-Meta: U2FsdGVkX1/Ijm13UsezJNNHwtntTfPVJDS46wMhebwHeTloK1kJFvUjdPbso2Co4N8xmYhVp0553gXm2gDuQw/Cuq7Yj0XkCZSsdCgoKmc9XywiAkSjDj7Te+DmVOt6Qd7v9ZwU5UWT/DCdYqBygZJtZ9Scfu8cjCGgkz75YnrEi6QY2FCtOtUEwiiu0Sn5L0U+Hp3T1ZAxEZxS4fFk+ID5jhDltcQuVnGGFLAjZdAf1YBtufWpMLz6YEZi8DmN582grCyLpGTl/h8qcSCcPsoVApZb45G8layKm9ugINdczablVCftfwNi4peGIzHhOSKc4vZPX6u64s6G9A29LHwKXbUL48qlzxpKTkUrK7F3mGeAmxtXNAgA76i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Fh0GmqYIkaKxaDne2s1Do+x5E+1ah5BSSJ3inbs0cqEjaDg4mV1DWqhPWprgjojnGuQfjbFjTo9XM9+3hmhOLnnaEM2QnrNemB7IK8QKIgfv7KSojjoEfqlu X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8
|
expand
|
diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h index a51e6e8f3171..ceb368d33bf4 100644 --- a/arch/arm64/include/asm/cache.h +++ b/arch/arm64/include/asm/cache.h @@ -33,6 +33,7 @@ * the CPU. */ #define ARCH_DMA_MINALIGN (128) +#define ARCH_KMALLOC_MINALIGN (8) #ifndef __ASSEMBLY__ @@ -90,6 +91,8 @@ static inline int cache_line_size_of_cpu(void) int cache_line_size(void); +#define dma_get_cache_alignment cache_line_size + /* * Read the effective value of CTR_EL0. *
On arm64, ARCH_DMA_MINALIGN is 128, larger than the cache line size on most of the current platforms (typically 64). Define ARCH_KMALLOC_MINALIGN to 8 (the default for architectures without their own ARCH_DMA_MINALIGN) and override dma_get_cache_alignment() to return cache_line_size(), probed at run-time. The kmalloc() caches will be limited to the cache line size. This will allow the additional kmalloc-{64,192} caches on most arm64 platforms. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> --- arch/arm64/include/asm/cache.h | 3 +++ 1 file changed, 3 insertions(+)