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 69F5EC43334 for ; Mon, 4 Jul 2022 10:35:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCEFB6B0072; Mon, 4 Jul 2022 06:35:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7F956B0073; Mon, 4 Jul 2022 06:35:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6D646B0074; Mon, 4 Jul 2022 06:35:33 -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 B4F616B0072 for ; Mon, 4 Jul 2022 06:35:33 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 7B3241209BE for ; Mon, 4 Jul 2022 10:35:33 +0000 (UTC) X-FDA: 79649060946.13.BE2CF5D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id B5458C0052 for ; Mon, 4 Jul 2022 10:35:32 +0000 (UTC) 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 D86E061590; Mon, 4 Jul 2022 10:35:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7868CC3411E; Mon, 4 Jul 2022 10:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656930931; bh=YMgEwaarHlXVWxjbc1utp5BF4lA79Mt080X8k4FjCYI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uPSaWbzxucd8Yz8sGU7fyaytLBrFev31claPyi2lkjBaXQd55HBvjSihl7PkBmDqO ofpJxBJ+b/QhJLmyFBQunt17/y86AxhXFZZx96FosVZHh5aLv8LL1I/+BDml9c//Ta 8BtvCBKMpGz8krQOay7Y8hE9MAQAuNy/0oh86gl9SPRgSstIJflRb3uxrs4iFFXhIj +pU4MCVIOnvvFZyPDIaxw9zMokrijg1qIp/Hhf7h66hxBeoY0OfD6vBmXQWNB2vvp+ Mw6fBvedo6bj4Z3+xXqVymB1t6fEfkqbgaFAXw1BuNts6o4NdcGt2OSh4kbglu61oK 2Dgz524F6qKdw== Date: Mon, 4 Jul 2022 11:35:23 +0100 From: Will Deacon To: Guanghui Feng Cc: baolin.wang@linux.alibaba.com, catalin.marinas@arm.com, akpm@linux-foundation.org, david@redhat.com, jianyong.wu@arm.com, james.morse@arm.com, quic_qiancai@quicinc.com, christophe.leroy@csgroup.eu, jonathan@marek.ca, mark.rutland@arm.com, thunder.leizhen@huawei.com, anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rppt@kernel.org, geert+renesas@glider.be, ardb@kernel.org, linux-mm@kvack.org, yaohongbo@linux.alibaba.com, alikernel-developer@linux.alibaba.com Subject: Re: [PATCH v4] arm64: mm: fix linear mem mapping access performance degradation Message-ID: <20220704103523.GC31437@willie-the-truck> References: <1656777473-73887-1-git-send-email-guanghuifeng@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1656777473-73887-1-git-send-email-guanghuifeng@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656930933; a=rsa-sha256; cv=none; b=EpxPPM8mNZ5UtY4bYG4Y5z9xZ7ngafd/zdq3YgQyCsfy5pvXTC61KZw0PJxDpHGC68Xux/ l4R/S9Rug+2uaw4EEeOItf3VnReFPyPMFB5UFRVdtgTcdeCzkGRwIejgqy42Q6QT2ilRQo 9DJ4QMRVAtU5k5QtdT1Or/AP/tyDBuo= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uPSaWbzx; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of will@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=will@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656930933; 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:dkim-signature; bh=YMgEwaarHlXVWxjbc1utp5BF4lA79Mt080X8k4FjCYI=; b=s8w+35nbQqHN1A3Yv0iP5vO1xJJNxvpRxIXbcXCt2LUcmmAoze8F0aIBgWqkjSqurHj66U xMW4n+2QM1vs5P/3Bee0nX3IjJnPZ/0phMHg0W0Q7R1i0ZiBu6EIAYEcw5zWp3SENh5mtt t1KA/A0VjpDjsQXNIka9w833kbzKDuo= Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uPSaWbzx; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of will@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=will@kernel.org X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B5458C0052 X-Rspam-User: X-Stat-Signature: jhguu6g7woagauiy1srbqti5m7j6q636 X-HE-Tag: 1656930932-97966 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 Sat, Jul 02, 2022 at 11:57:53PM +0800, Guanghui Feng wrote: > The arm64 can build 2M/1G block/sectiion mapping. When using DMA/DMA32 zone > (enable crashkernel, disable rodata full, disable kfence), the mem_map will > use non block/section mapping(for crashkernel requires to shrink the region > in page granularity). But it will degrade performance when doing larging > continuous mem access in kernel(memcpy/memmove, etc). Hmm. It seems a bit silly to me that we take special care to unmap the crashkernel from the linear map even when can_set_direct_map() is false, as we won't be protecting the main kernel at all! Why don't we just leave the crashkernel mapped if !can_set_direct_map() and then this problem just goes away? Will