From patchwork Mon Oct 21 04:22:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 13843545 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 C302CD3C93E for ; Mon, 21 Oct 2024 04:22:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 902AB6B0098; Mon, 21 Oct 2024 00:22:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B3F46B0099; Mon, 21 Oct 2024 00:22:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 707F36B009A; Mon, 21 Oct 2024 00:22:40 -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 4F88B6B0098 for ; Mon, 21 Oct 2024 00:22:40 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2C7CD815A1 for ; Mon, 21 Oct 2024 04:22:27 +0000 (UTC) X-FDA: 82696312650.19.DC91C3A Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf15.hostedemail.com (Postfix) with ESMTP id D0252A000A for ; Mon, 21 Oct 2024 04:22:23 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Ya8qsin8; spf=pass (imf15.hostedemail.com: domain of 3DdcVZwYKCFIIEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3DdcVZwYKCFIIEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729484408; 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=0qOoUc7S7Ph4MJcNIkBb7u3tw8zxiypBu0RBb7iGSGQ=; b=JwNtFJM9DgJO4ugn3sdFfK1R36FiuvKNo+RdCTDIbRD6dQMMezdNrjczTHWkwDhCckgEci bUPx4bMRq9Gea/XVmjpRqs3RAVkjjbSqmdQ0WtZtba64cHf0jgvQIi81znll1/2GJJRuYW sB1ZhXyvU1p803YKXeeUMT+dL/Fuwe4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729484408; a=rsa-sha256; cv=none; b=6rADBf0dEosr9c6P5lispk47oRaKrTJ4JjPu+ZN3zoxHTS3iTGiU71bDBda0ia6QF0rH34 hgbOrZi1XdzW+Je1a6i9/zOESLCxoZh9+3VnP0f42w8OjU/SyOZWbVU+/oMAAaVb1H+FSJ PCXN1nt4G2NubOWcTFJspMbQALZOnHM= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Ya8qsin8; spf=pass (imf15.hostedemail.com: domain of 3DdcVZwYKCFIIEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3DdcVZwYKCFIIEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e383ba6763so67843667b3.3 for ; Sun, 20 Oct 2024 21:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729484557; x=1730089357; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=0qOoUc7S7Ph4MJcNIkBb7u3tw8zxiypBu0RBb7iGSGQ=; b=Ya8qsin8MM4gX/lhIVoPGnnYcZAOgg4rO9hMHMiK2zZ7o60skffA9/x8vH8kvslKTZ /cjVkoADnPVG6ntkMC8cdc756XujYmpw8geo1Px20mzwDRizO1/sUokX0H4MOcl5pd0q KG42naNs2X/UYn5hml2OXYZdbdcs4gvrl2u1onaHSsWJhQVXqdz7OIXTFp3TmJh0hLjO vPksx3yON1NQX0uOYduUPKKuUFtxFwe/jdLNxWP+7plyhjpdIMGpg/pCZzVykubM8Lmn 4xz4xAHr1VAyeJRGKiVFHStAO91P7pWBoJhw5iMleHbeUz4XtJCxXSCMppsmHVPU+47w 1UMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729484557; x=1730089357; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0qOoUc7S7Ph4MJcNIkBb7u3tw8zxiypBu0RBb7iGSGQ=; b=pm5KunCJIPnq1nDfldCjOPBcUYtHZfZhpp7/vG7ZnOrnWzLOqlLAl38YKM66jQqrX/ 3UJzjT+LUAc2K+djtNQ31R6nBKhGou8/idVdtrEMwsu1N76KfK+9cz++9WDz4s3hFf+Q KIRuUGA6x9f2mqgvotiquiAoqvrKBcw+W2cNe3APV01AMV+kYBqsdmHXMiJlzovIhwJj J82TWGnlb4jmRVUp0qT8uuV/Wf2vYkrskSkcakUVRF/PD4LvzRxO5zoJWgTQAgydJbjW 6qYl359o3WuWbtaMJ+2k7Psk0+BPrkpAJkv/8ME8uUjpVcduqTYdvyiACHJq4wcNsFNA FEPg== X-Forwarded-Encrypted: i=1; AJvYcCW01otjxn5CFrSNUkjmRacZPLuMUdw/yLsYbhhI39crsgIL5DFOJv8e5v8mdZreH+k9/jIsQOGEdw==@kvack.org X-Gm-Message-State: AOJu0YwfcWzeP64UqTaVBGMUpk9LM3Vahj+M68IRt7edizczCExTi4Z1 0gVHIYffvjuRiakoOGJiWNf1jNYqv7yj61e47FGCH5kfiZCXjPpTUqd4XLc8kRekc/C0man8CCD y8g== X-Google-Smtp-Source: AGHT+IHT0kbssKqnqvzVXYJ6z8GdpmqmvaKobmcxDyj7IjWvvjuKhF8UkhPdehMt/EKyLWoXTgeCtaMmNCE= X-Received: from yuzhao2.bld.corp.google.com ([2a00:79e0:2e28:6:1569:9ef4:20ab:abf9]) (user=yuzhao job=sendgmr) by 2002:a25:c781:0:b0:e29:7cd6:593b with SMTP id 3f1490d57ef6-e2bb169afa4mr24157276.8.1729484557262; Sun, 20 Oct 2024 21:22:37 -0700 (PDT) Date: Sun, 20 Oct 2024 22:22:18 -0600 In-Reply-To: <20241021042218.746659-1-yuzhao@google.com> Mime-Version: 1.0 References: <20241021042218.746659-1-yuzhao@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Message-ID: <20241021042218.746659-7-yuzhao@google.com> Subject: [PATCH v1 6/6] arm64: select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP From: Yu Zhao To: Andrew Morton , Catalin Marinas , Marc Zyngier , Muchun Song , Thomas Gleixner , Will Deacon Cc: Douglas Anderson , Mark Rutland , Nanyong Sun , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yu Zhao X-Stat-Signature: njb5tqs3jzhmkkbu5cp45oxp4qmh5onh X-Rspamd-Queue-Id: D0252A000A X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1729484543-880123 X-HE-Meta: U2FsdGVkX1/FDaUFS1ENxi5V5dMUP66pNrHVLkIY7l3IClzrZYhn/LxzjjdnyksSLcYIJ80kLRZ5h755auZ3etf81HxF2TfdHOissEDHsvgk1sfPEHNhdtfIB9qDjcAyGVzzUl0nyCMxLsUoM9Bh50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UJbjezTZvFbFwv8R3WUZHAjLUsCrA4qbMC+X4MrXOTf/5Jm+IMvgR5DbdiYRi9wpT9tYLebDmmN2dfcANhox7vWRLskP6HUTxGoqDszZV0IKp2M6Y+9L/LSaJustIIg2OwLA+L1se/ZMD64LkuyLifLnCGaWl6uBW3BZE8QngoWQ7TbjicEyXF9PyahO+wSQiZqohUDXSTdQCU7SWpFDWPbr81jSlXgouOniOOek73hmnllbyMZID6mOP662HjHRg6/bKD+c6jubRG0L096BS5sKqGNQkrcMaE7aWUCJLJGogx2ePh9NenstE/5YP430qbLXgD0Nkr5nqm6mHkWkfiOjLE/YEgFK2hhmwWHhS5w0Ipw== 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: List-Subscribe: List-Unsubscribe: To use HVO, make sure that the kernel is booted with pseudo-NMI enabled by "irqchip.gicv3_pseudo_nmi=1", as well as "hugetlb_free_vmemmap=on" unless HVO is enabled by default. Note that HVO checks the pseudo-NMI capability and is disabled at runtime if the capability turns out not supported. Successfully enabling HVO should have the following: # dmesg | grep NMI GICv3: Pseudo-NMIs enabled using ... # sysctl vm.hugetlb_optimize_vmemmap vm.hugetlb_optimize_vmemmap = 1 Signed-off-by: Yu Zhao --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fd9df6dcc593..e93745f819d9 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -109,6 +109,7 @@ config ARM64 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36) + select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANTS_EXECMEM_LATE if EXECMEM select ARCH_WANTS_NO_INSTR