From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 AA219C7EE29 for ; Thu, 25 May 2023 17:08:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 09E78900003; Thu, 25 May 2023 13:08:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04E63900002; Thu, 25 May 2023 13:08:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E800B900003; Thu, 25 May 2023 13:08:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DBE7A900002 for ; Thu, 25 May 2023 13:08:37 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7BD4DA0C72 for ; Thu, 25 May 2023 17:08:37 +0000 (UTC) X-FDA: 80829411474.22.3E31D4F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf03.hostedemail.com (Postfix) with ESMTP id 8F88220026 for ; Thu, 25 May 2023 17:08:35 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf03.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=1685034515; a=rsa-sha256; cv=none; b=T03wtsa3PtpuDqx4l3lUQfTOGDgZp9JdwTlUo0yMyfITKNoFLqiEQ7xoOfzcFAxIam9cUi C05A4Yv91XyLM5OXUmsvZsTtrDlUMSuir6Qym92O75SGOGS4a/5Q9PNuzi4mG8CVG0myG6 Wdo8KJVwjgiN5vF81l7M2WCJQnNlasM= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf03.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=1685034515; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tYqaLMyOo2MOpMMARqXuzlSBezDen6cUQ1zpEWHDk+s=; b=gQEmTuf4DQde3WVaGpYBQIUxf/qLtO9CUqkBjlhAH8zpDh/yW17s1Hi2i3dGn1RC/q/uJd r2/o84T/tThH8lJ0Au180GFINDZocvospp8YItlv1qO1/t0hZ9oFcFy07Pvg4Xfai0uGid VvucmvHb5yn/yrzu7m3ZDzegszVq2kg= 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 AA0EE61A25; Thu, 25 May 2023 17:08:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCE86C433D2; Thu, 25 May 2023 17:08:30 +0000 (UTC) Date: Thu, 25 May 2023 18:08:27 +0100 From: Catalin Marinas To: Robin Murphy Cc: Linus Torvalds , Christoph Hellwig , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Andrew Morton , Herbert Xu , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 15/15] arm64: Enable ARCH_WANT_KMALLOC_DMA_BOUNCE for arm64 Message-ID: References: <20230524171904.3967031-1-catalin.marinas@arm.com> <20230524171904.3967031-16-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8F88220026 X-Stat-Signature: tqn4brhof957863pe7ro7mbr4mzerk6k X-Rspam-User: X-HE-Tag: 1685034515-230369 X-HE-Meta: U2FsdGVkX18jwq24EkwjZSR/8W/hyfLpNJmG5M/asQMT44GOykw2jbS+Ior1JwLRYvfNerRaEhZTkbjwvRp3u54bW4qafTrEu9DGjMSDyLVUsjcXiZMA6K8eSajK0ezugbZJ9FbK9DfU3QYuNIKm0fpvXs2HjUFjoGKR/1GaOUFYcTr94xaESb6VcwguyR0ivKzrjQavnNFZv5XrR3IsNj5PYIl9FcR2vQPtzDU/4u9apI5Bboanrlmvd0tHIjWRYsxFW74tKYtjuyDdp9Z1/0GxGNxoipP5/CFIGk9bDDntpRFULflEHNLtKYq2ZGF+loftDibRPL5h7jSyTsqC/HND8fl1hTpa7iaNohmMJNK1ZzCRCuUSKrydKP+a+t9Zj7W6ka+8urgWKXf0x55zjua8IFREmcxSle1giNqRcRMKC7W6rjEfVt1ZU6tHzpFou3uBZ3K4zepI/SNxXBXApcc8GboLZBeJeGF/bHcOg0TqknSdRZLpBw6A+E4rWfgn6Bk5puPAOnt0tyPWDnbVWeusJXfGe0qXJIzfY94lNu2biMI00l+Wup4cs3tTqGOsYK4ClXBXrPJ45JoTTCG7dE7yX8A7G1/BWrf+7dfbEGZnnJfYVKDt9FuKH1L4b5SflDlMkr0vE0k7C/reNtsU2mjk6sBZReONiLEoGxKf13jjbn8KQsyJKnnXKfYHQ5eZt0tr790420LzdqqQmb0qAqGRC+XXvSuIgXHWFwlw/Eg1DAgNhU4Ypa/YwLqxbyfA3Z79TNvmMWAIO9zO+23TPp//oto5/SkcvGZm2LLOJZbkfTmG4xd6aZftfF55A0ePa/Or/ERmEf5H84X+wBqtolilm9c4baN4tFoTf1Acq2bWyboe2bJqpud9b+GzEY8EEqZ0CQeYVbD8/V5S7y+nESbKNTcBv5nm+eQjVEbpqQlLFQh8nWHglVsZ720X7QkD8SLQ7SYloQybowpDD6S YO9pokfu ENnfJcjxC5DAaPeQvMsBpeLbjymJq3vVeQimonM8NiqwhCZnONzXIBrvzWp5zqYZh9J3eyf4gCf/hsYdSL3pZtfBmnldgXHgPhK21jcEtOXrYduI5N/xoiSqBpRthh9mlAQPXannRVURUQchRhqQNG1hqT5oTAXvhqNhlLKCUWhcRVa0CIrOctmAyYIa5x7iE82hcnVLocAG7Nm/kpVdIx60ZNmpRlE8DIQhYGTsjqwMtMdT/L6C36iPto+ey126Y6N2FDUkpFQJSQDuzb7DkapGNnpiLhjzONl3u57T/j9ersSpx/wtomjRLsPi45G1K0XlH9j4LoJK3LxFZsE8lLHw3DWtRyzEmVd3en8dI2C/yuH2M8Pc50LofAT+VmAU9nKxIRhVCE9pjFo5P3u2p8rwwelNsnfdvQ5EHgYz8P4x59jU1wabMB4/bYSilI1ejtNhXtynP+OCYeuGt8DSjDQtFSdx9KvbRMgkOwfMf21dqSNVmeDjVYf4LXdhUVgKJiQ1OS6z+LyIk2a54iks9nPGhKrwJ5Rz9g9l8QNRqYkQHPUiwiqzTxVIYwzjEJs1LN/SNS3ISdlz6jeE= 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: On Thu, May 25, 2023 at 05:12:37PM +0100, Robin Murphy wrote: > On 24/05/2023 6:19 pm, Catalin Marinas wrote: > > With the DMA bouncing of unaligned kmalloc() buffers now in place, > > enable it for arm64 to allow the kmalloc-{8,16,32,48,96} caches. In > > addition, always create the swiotlb buffer even when the end of RAM is > > within the 32-bit physical address range (the swiotlb buffer can still > > be disabled on the kernel command line). > > > > Signed-off-by: Catalin Marinas > > Cc: Will Deacon > > --- > > arch/arm64/Kconfig | 1 + > > arch/arm64/mm/init.c | 7 ++++++- > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index b1201d25a8a4..af42871431c0 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -120,6 +120,7 @@ config ARM64 > > select CRC32 > > select DCACHE_WORD_ACCESS > > select DYNAMIC_FTRACE if FUNCTION_TRACER > > + select DMA_BOUNCE_UNALIGNED_KMALLOC > > We may want to give the embedded folks an easier way of turning this off, > since IIRC one of the reasons for the existing automatic behaviour was > people not wanting to have to depend on the command line. Things with 256MB > or so of RAM seem unlikely to get enough memory efficiency back from the > smaller kmem caches to pay off the SWIOTLB allocation :) I thought about this initially and that's why I had two options (ARCH_WANT_* and this one). But we already select SWIOTLB on arm64, so for the embedded folk the only option is swiotlb=noforce on the cmdline which, in turn, limits the kmalloc caches to kmalloc-64 (or whatever the cache line size is) irrespective of this new select. -- Catalin