Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3018284pxb; Mon, 18 Oct 2021 06:42:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ1LRlwEIrRyYeyE9V0Jao3/mmuSgIhfu73fAntM1fNxT1nNfzuUNrAAuzY+buG60ApE5k X-Received: by 2002:a63:1d7:: with SMTP id 206mr23933469pgb.387.1634564555913; Mon, 18 Oct 2021 06:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634564555; cv=none; d=google.com; s=arc-20160816; b=lKhqFB9CXmHttMqmswoogfTZgNgua6bawFqcoOamjrTcQ2TIIRhOh8AVQStJpe78w/ SuqSR/eV6nB+heZfHOElC1DdT8MAviF/wcy9MnlTzqTBdeULGsUEFrCe+U8iHGVHyZmD Z94itpF5SYxFhT+HG72d35GctKbdijQZRjdO3CO5iKIm+b9nsXk+juPRW4zCCieKSde/ JQfvmouf7ROUYTbWQ/b1P8TjAgsil5juzxQ+HxPdSeV+DwJxy0LOgtV88dv9CuqJGcdR zdR7j/Oy/YD6C8180TjmKlItOMSpg86pgc89jBszMRmvjaWLv0wXJtlWkrT6C7UUpFSp mQDg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DhvM8poVRh3AIiebUAdwfAPtUxWKhMDBHBZxipCB7u4=; b=vsf+LGfXCCM7taNkYS3V1D2W1GcdwEYUTY05TxJIOQk/Sn2Tz/4zY2ouZRULKT3QYT Fo1OsDEYCu1wKRsEK9nV8hXxa7Hs8exWW4INPbkhUA9osHqTGr5bQyZljU6MgnM6vCev u9RB6k9dk9wmCZHTAreBCWA6pDzvu2t0JxicQ6GRmVNx8+JGdUrtWs5oMWy6UA/SECc9 UIsLe45699B3OMgxbA8OH6GVAi8/7NQOgPgkSRVKpbW8lsyXoqWth6GWBBTCbQo7Uj/r ycBVFtevqYh7VStij29hRQ7JMlAJth+0VXzw3NGrgUY3GLF5em3hllpS1d6t2m4LlNZb 2QVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VJS51mk7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si1149876plw.13.2021.10.18.06.42.22; Mon, 18 Oct 2021 06:42:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VJS51mk7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232971AbhJRNlh (ORCPT + 99 others); Mon, 18 Oct 2021 09:41:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232868AbhJRNjZ (ORCPT ); Mon, 18 Oct 2021 09:39:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 699626137E; Mon, 18 Oct 2021 13:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563971; bh=1clZC4+6scj+EWeoxEBLwVl8HlbEHeWyoiYZ54CDi00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VJS51mk7b3giANyBmJHhayAqY/nVdkhw5yTVnD+pqAxD/EJUGQNC4OKXGkISyHw1b x6v86d4BMBqhRkeGe4J9CpnIGFdSSYQTge8zByGTUnsAqw4FRRWNVk932+WFTPo/Fn IwZZiO/FUyeRPIwub8htCbEd8bVeqEq4OExT7pxA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Kravetz , Anshuman Khandual , Catalin Marinas Subject: [PATCH 5.10 017/103] arm64/hugetlb: fix CMA gigantic page order for non-4K PAGE_SIZE Date: Mon, 18 Oct 2021 15:23:53 +0200 Message-Id: <20211018132335.279702348@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132334.702559133@linuxfoundation.org> References: <20211018132334.702559133@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Kravetz commit 2e5809a4ddb15969503e43b06662a9a725f613ea upstream. For non-4K PAGE_SIZE configs, the largest gigantic huge page size is CONT_PMD_SHIFT order. On arm64 with 64K PAGE_SIZE, the gigantic page is 16G. Therefore, one should be able to specify 'hugetlb_cma=16G' on the kernel command line so that one gigantic page can be allocated from CMA. However, when adding such an option the following message is produced: hugetlb_cma: cma area should be at least 8796093022208 MiB This is because the calculation for non-4K gigantic page order is incorrect in the arm64 specific routine arm64_hugetlb_cma_reserve(). Fixes: abb7962adc80 ("arm64/hugetlb: Reserve CMA areas for gigantic pages on 16K and 64K configs") Cc: # 5.9.x Signed-off-by: Mike Kravetz Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20211005202529.213812-1-mike.kravetz@oracle.com Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -43,7 +43,7 @@ void __init arm64_hugetlb_cma_reserve(vo #ifdef CONFIG_ARM64_4K_PAGES order = PUD_SHIFT - PAGE_SHIFT; #else - order = CONT_PMD_SHIFT + PMD_SHIFT - PAGE_SHIFT; + order = CONT_PMD_SHIFT - PAGE_SHIFT; #endif /* * HugeTLB CMA reservation is required for gigantic