From patchwork Thu Feb 4 07:01:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12066423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2C5DC433E0 for ; Thu, 4 Feb 2021 07:02:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4666664D99 for ; Thu, 4 Feb 2021 07:02:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4666664D99 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rPZtQsnSDoPApzEacQoqwj3UawUJShKvGI6EXYkj2zA=; b=Gim4ZpvipGhj5wqk6FsfdOSgb4 odaiF5KFpvsucWX/L2kvhebfYNrKpzyTnlJW003flTgEBpAW/BgLO18LiDrY7LdWg+6cmAhK5AcWh MOJo2judvhDmFiVaRYlM8Qvu5zx01FY4f39RZ1F86G57pt4lXJ7r2rwCezDVjhcIARNUTX1w07eIP j9OGfgTwY48kNIp/LohhCYEATpYNSi71GYUylLcb48ZoHcmCF6t0Y815Ys2D9919ZwL61nkmEOt73 cQMnSQjw1FTWzzRQCg1xdyrGB3eteH4MmH+NI4Gn2MNuaM0O6ypgTvtcB98sEg5LGy5Z8jLxRV2Lw OZOKFgRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Ydk-0002vk-Cq; Thu, 04 Feb 2021 07:01:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Ydd-0002ta-NR for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 07:01:15 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 124CC12FC; Wed, 3 Feb 2021 23:01:12 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.94.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7A96F3F694; Wed, 3 Feb 2021 23:01:08 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org Subject: [RFC 1/3] mm/page_alloc: Fix pageblock_order when HUGETLB_PAGE_ORDER >= MAX_ORDER Date: Thu, 4 Feb 2021 12:31:22 +0530 Message-Id: <1612422084-30429-2-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612422084-30429-1-git-send-email-anshuman.khandual@arm.com> References: <1612422084-30429-1-git-send-email-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210204_020113_915051_53420861 X-CRM114-Status: GOOD ( 14.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anshuman Khandual , Will Deacon , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org With HUGETLB_PAGE_SIZE_VARIABLE enabled, pageblock_order cannot be assigned as HUGETLB_PAGE_ORDER when it is greater than or equal to MAX_ORDER during set_pageblock_order(). Otherwise the following warning is triggered during boot as detected on an arm64 platform. WARNING: CPU: 5 PID: 124 at mm/vmstat.c:1080 __fragmentation_index+0xa4/0xc0 Modules linked in: CPU: 5 PID: 124 Comm: kswapd0 Not tainted 5.11.0-rc6-00004-ga0ea7d62002 #159 Hardware name: linux,dummy-virt (DT) [ 8.810673] pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--) [ 8.811732] pc : __fragmentation_index+0xa4/0xc0 [ 8.812555] lr : fragmentation_index+0xf8/0x138 [ 8.813360] sp : ffff0000864079b0 [ 8.813958] x29: ffff0000864079b0 x28: 0000000000000372 [ 8.814901] x27: 0000000000007682 x26: ffff8000135b3948 [ 8.815847] x25: 1fffe00010c80f48 x24: 0000000000000000 [ 8.816805] x23: 0000000000000000 x22: 000000000000000d [ 8.817764] x21: 0000000000000030 x20: ffff0005ffcb4d58 [ 8.818712] x19: 000000000000000b x18: 0000000000000000 [ 8.819656] x17: 0000000000000000 x16: 0000000000000000 [ 8.820613] x15: 0000000000000000 x14: ffff8000114c6258 [ 8.821560] x13: ffff6000bff969ba x12: 1fffe000bff969b9 [ 8.822514] x11: 1fffe000bff969b9 x10: ffff6000bff969b9 [ 8.823461] x9 : dfff800000000000 x8 : ffff0005ffcb4dcf [ 8.824415] x7 : 0000000000000001 x6 : 0000000041b58ab3 [ 8.825359] x5 : ffff600010c80f48 x4 : dfff800000000000 [ 8.826313] x3 : ffff8000102be670 x2 : 0000000000000007 [ 8.827259] x1 : ffff000086407a60 x0 : 000000000000000d [ 8.828218] Call trace: [ 8.828667] __fragmentation_index+0xa4/0xc0 [ 8.829436] fragmentation_index+0xf8/0x138 [ 8.830194] compaction_suitable+0x98/0xb8 [ 8.830934] wakeup_kcompactd+0xdc/0x128 [ 8.831640] balance_pgdat+0x71c/0x7a0 [ 8.832327] kswapd+0x31c/0x520 [ 8.832902] kthread+0x224/0x230 [ 8.833491] ret_from_fork+0x10/0x30 [ 8.834150] ---[ end trace 472836f79c15516b ]--- The above warning happens because pageblock_order exceeds MAX_ORDER, caused by large HUGETLB_PAGE_ORDER on certain platforms like arm64. Lets prevent the scenario by first checking HUGETLB_PAGE_ORDER against MAX_ORDER, before its assignment as pageblock_order. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 519a60d5b6f7..36473f2fa683 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6798,7 +6798,7 @@ void __init set_pageblock_order(void) if (pageblock_order) return; - if (HPAGE_SHIFT > PAGE_SHIFT) + if ((HPAGE_SHIFT > PAGE_SHIFT) && (HUGETLB_PAGE_ORDER < MAX_ORDER)) order = HUGETLB_PAGE_ORDER; else order = MAX_ORDER - 1; From patchwork Thu Feb 4 07:01:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12066425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89C1BC433E0 for ; Thu, 4 Feb 2021 07:02:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2960464F47 for ; Thu, 4 Feb 2021 07:02:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2960464F47 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Xl7nojwIRZ2288uNkZ6ATp47GLFz5I6WEdcbGd2h/tI=; b=lufT9Ap1npWISF57SfwCrWMNCw Z4bOrLvowrIgPAX5l/uhyETXYEW8v4pXOOKuIhNK5jguWIShyB33uvfMaEY9iGYKYAYgjMjukFaPk owfSyzMYwOJFW1iGH3MLi77TSwT94XtVXimjuElrF2KzcjSMmsbPQAEkmlv0m+9Dix+hyjv7AlXYH 3rmmjpTR78QuZv32xVYEFzeoqrQcooUFRt9hbEYz7ol5oYbwE/tNp+Dg7mtOzvd/mOlPvPExnZ7Ym efAwG00ttIQafJslewl1L+7hMy0gw8kBN0B4Gz4Hx8Yx9XbIXM8BO273d0XVRpm4WkvFaoe+JN3DS d50jjK/w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Ydt-0002zh-Cy; Thu, 04 Feb 2021 07:01:29 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Ydi-0002vZ-EV for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 07:01:19 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3EA5D1396; Wed, 3 Feb 2021 23:01:16 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.94.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 983C73F694; Wed, 3 Feb 2021 23:01:12 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org Subject: [RFC 2/3] arm64/hugetlb: Enable HUGETLB_PAGE_SIZE_VARIABLE Date: Thu, 4 Feb 2021 12:31:23 +0530 Message-Id: <1612422084-30429-3-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612422084-30429-1-git-send-email-anshuman.khandual@arm.com> References: <1612422084-30429-1-git-send-email-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210204_020118_591072_BE688A7D X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anshuman Khandual , Will Deacon , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org MAX_ORDER which invariably depends on FORCE_MAX_ZONEORDER can be a variable for a given page size, depending on whether TRANSPARENT_HUGEPAGE is enabled or not. In certain page size and THP combinations HUGETLB_PAGE_ORDER can be greater than MAX_ORDER, making it unusable as pageblock_order. This enables HUGETLB_PAGE_SIZE_VARIABLE making pageblock_order a variable rather than the compile time constant HUGETLB_PAGE_ORDER which could break MAX_ORDER rule for certain configurations. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 175914f2f340..c4acf8230f20 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1918,6 +1918,10 @@ config ARCH_ENABLE_THP_MIGRATION def_bool y depends on TRANSPARENT_HUGEPAGE +config HUGETLB_PAGE_SIZE_VARIABLE + def_bool y + depends on HUGETLB_PAGE + menu "Power management options" source "kernel/power/Kconfig" From patchwork Thu Feb 4 07:01:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12066427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C10DC433DB for ; Thu, 4 Feb 2021 07:02:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E825864D99 for ; Thu, 4 Feb 2021 07:02:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E825864D99 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PFE/Equ0VrM11u6QZ8OhlzsDAPK3LhDWzmey5dNfrMM=; b=Ypj4/KJLtg7kIaZVS9cqbvHYX BvLLtU7NLtXJ2welnzbnjYrjSPdFADMl0E0f+r7ZGgsWWv/UendRtZct9PICfwUZua6gqWGSivMSa gWEPjsKr/Y2gMoi/ymljOwpTJ7DYX1BNLruvjDH8+ZcA1rjlNd+87Y9Z9AQkQdnFKLHKTl9BcW/Zq eEl5fxTPoewTYMqfY6A6pLbBTp47EBiRnQFF38Q6Uk5el6kEkAUmCvk5UjAwIbO22w4RIWtHoGsWT lcSJgTvyy1iSJyB1UTqG6i+8nrumWhrQ3q+KueHtFMiOOed31UvI8c1HSNyPzdfirJokSUIaTPHnR be5WwmBuw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Ydx-00031f-0T; Thu, 04 Feb 2021 07:01:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Ydl-0002x4-2h for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 07:01:22 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5A8BB1424; Wed, 3 Feb 2021 23:01:20 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.94.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C50F03F694; Wed, 3 Feb 2021 23:01:16 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org Subject: [RFC 3/3] dma-contiguous: Type cast MAX_ORDER as unsigned int Date: Thu, 4 Feb 2021 12:31:24 +0530 Message-Id: <1612422084-30429-4-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612422084-30429-1-git-send-email-anshuman.khandual@arm.com> References: <1612422084-30429-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210204_020121_250760_07E6DBBD X-CRM114-Status: GOOD ( 14.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anshuman Khandual , Will Deacon , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Type cast MAX_ORDER as unsigned int to fix the following build warning. In file included from ./include/linux/kernel.h:14, from ./include/asm-generic/bug.h:20, from ./arch/arm64/include/asm/bug.h:26, from ./include/linux/bug.h:5, from ./include/linux/mmdebug.h:5, from ./arch/arm64/include/asm/memory.h:166, from ./arch/arm64/include/asm/page.h:42, from kernel/dma/contiguous.c:46: kernel/dma/contiguous.c: In function ‘rmem_cma_setup’: ./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ^~ ./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’ (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~ ./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’ __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~ ./include/linux/minmax.h:58:19: note: in expansion of macro ‘__careful_cmp’ #define max(x, y) __careful_cmp(x, y, >) ^~~~~~~~~~~~~ kernel/dma/contiguous.c:402:35: note: in expansion of macro ‘max’ phys_addr_t align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- kernel/dma/contiguous.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 3d63d91cba5c..1c2782349d71 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -399,7 +399,7 @@ static const struct reserved_mem_ops rmem_cma_ops = { static int __init rmem_cma_setup(struct reserved_mem *rmem) { - phys_addr_t align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); + phys_addr_t align = PAGE_SIZE << max((unsigned int)MAX_ORDER - 1, pageblock_order); phys_addr_t mask = align - 1; unsigned long node = rmem->fdt_node; bool default_cma = of_get_flat_dt_prop(node, "linux,cma-default", NULL);