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 X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 2B845C433DB for ; Thu, 11 Feb 2021 08:39:38 +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 DD24F64E16 for ; Thu, 11 Feb 2021 08:39:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD24F64E16 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IOsV55SWA5lh54kPjYaUb2CbX2sA2itwOtsOnLPFm34=; b=lDR8P4uNd9fQTHrvmc2QxQ9+H M456FrVYqzGYxIQoMqnIIhRfNtNOdS/OT4XBd4mAVC/lbD66MZwFtD0UwVA8ey5EuDeUpm0PDyYnq KdG+vDi7Or2JpIArwRYWJ9LjK+7tSs2UFkgQms1k5uQHi2J+rlHLbc6geGT5DlAzSmB4F/VB5xUVw DWLv0BU++g/o7RZLZ7e6KUM+iEn0+xmM+4DEPAgPvxlZUdaIijmgVhiSgbepzZfD9KIeDzEE0FfMV SViG2S3JO7+AZFWRtLhFFITDbmVVD4J1s9tnBRT4C1ao0M3zH3Xc3+X5MYrW3BSIikGZIOOVVxtGZ vKizQFtrA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA7UF-0002JX-0O; Thu, 11 Feb 2021 08:38:07 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA7UA-0002Iu-SZ for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 08:38:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613032680; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OshEwSbCv9NPTYWa6eOuk9tJUyjlTdPMJ4VCPbd4Iv0=; b=ZP3M+GbqRaCzi4miFuFiGaAxxYwB6nX86FVQPO3Pp3aGGP2rfHr6UKDhLg27wUPwKWaxCB jPOMePdA9jgxt8e0d6ueUYuGfqvEFtgJShWVVKKVJkLheY19+F6gdeiN1HosEZEzVjk321 56v50sg4KnRYH1Mcl0FcNK3uAmQBEXA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-339-blTG32R_OI-ZaE04sIMUog-1; Thu, 11 Feb 2021 03:37:56 -0500 X-MC-Unique: blTG32R_OI-ZaE04sIMUog-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 548D2AFA83; Thu, 11 Feb 2021 08:37:54 +0000 (UTC) Received: from [10.36.114.52] (ovpn-114-52.ams2.redhat.com [10.36.114.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83EC16268E; Thu, 11 Feb 2021 08:37:51 +0000 (UTC) Subject: Re: [PATCH 0/3] mm/page_alloc: Fix pageblock_order with HUGETLB_PAGE_SIZE_VARIABLE To: Anshuman Khandual , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org, will@kernel.org References: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <683c812a-ce3d-ef74-10d1-eaf8a3ae93d4@redhat.com> Date: Thu, 11 Feb 2021 09:37:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_033803_110956_EDB6BB5C X-CRM114-Status: GOOD ( 21.39 ) 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: Mark Rutland , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11.02.21 07:22, Anshuman Khandual wrote: > The following warning gets triggered while trying to boot a 64K page size > without THP config kernel on 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 ]--- > > This warning comes from __fragmentation_index() when the requested order > is greater than MAX_ORDER. > > static int __fragmentation_index(unsigned int order, > struct contig_page_info *info) > { > unsigned long requested = 1UL << order; > > if (WARN_ON_ONCE(order >= MAX_ORDER)) <===== Triggered here > return 0; > > Digging it further reveals that pageblock_order has been assigned a value > which is greater than MAX_ORDER failing the above check. But why this > happened ? Because HUGETLB_PAGE_ORDER for the given config on arm64 is > greater than MAX_ORDER. > > The solution involves enabling HUGETLB_PAGE_SIZE_VARIABLE which would make > pageblock_order a variable instead of constant HUGETLB_PAGE_ORDER. But that > change alone also did not really work as pageblock_order still got assigned > as HUGETLB_PAGE_ORDER in set_pageblock_order(). HUGETLB_PAGE_ORDER needs to > be less than MAX_ORDER for its appropriateness as pageblock_order otherwise > just fallback to MAX_ORDER - 1 as before. While here it also fixes a build > problem via type casting MAX_ORDER in rmem_cma_setup(). I'm wondering, is there any real value in allowing FORCE_MAX_ZONEORDER to be "11" with ARM64_64K_PAGES/ARM64_16K_PAGES? Meaning: are there any real use cases that actually build a kernel without TRANSPARENT_HUGEPAGE and with ARM64_64K_PAGES/ARM64_16K_PAGES? As builds are essentially broken, I assume this is not that relevant? Or how long has it been broken? It might be easier to just drop the "TRANSPARENT_HUGEPAGE" part from the FORCE_MAX_ZONEORDER config. -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel