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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 DC04CC11D3D for ; Thu, 27 Feb 2020 17:49:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A591F24692 for ; Thu, 27 Feb 2020 17:49:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NGbteWBU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A591F24692 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7mp83tMbRKKRh8/mInzDFma+sIVRVXIgYVZgHZQdkR8=; b=NGbteWBUNZvsiN PTap8PVR/YmW7NWZkGpcj2qp5bD9v9br1MzKgsmUO7XBletJ2zzELnnhpFBXxNKUvdvnpEyxCuO+1 mixYpB+cOrl3ScGFcTRnLUTAL31/WbcfmrH0yBkmgXxmDk3rNA3u/gIOWt2IE+gSnMBX2Eb+/ms86 cApt6l/jOKvCXhQW7GisH1Yv8HNQpMB0MvLNkPgzG/xW+xN7Dg1+fW/xRG5ElBiLcKSaq3X+VGWjP /zyeXb+VWaaATircjfhQ0RpTZtebX/4M5peAkT+XKV5Pafgjx4CCv/oIozeFoGmWxTq7NKQ6cXER1 JOsB1ExTWtBRMGYqZGmg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7NHS-00068r-VW; Thu, 27 Feb 2020 17:49:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7NH8-0005ty-34 for linux-arm-kernel@lists.infradead.org; Thu, 27 Feb 2020 17:48:44 +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 AA1261FB; Thu, 27 Feb 2020 09:48:41 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AA2DD3F73B; Thu, 27 Feb 2020 09:48:40 -0800 (PST) Date: Thu, 27 Feb 2020 17:48:38 +0000 From: Catalin Marinas To: Vlastimil Babka Subject: Re: cma can't activate area on arm64 Message-ID: <20200227174838.GI3281767@arrakis.emea.arm.com> References: <8f82edf2-7313-eb4c-f68e-ff18f7a5e919@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8f82edf2-7313-eb4c-f68e-ff18f7a5e919@suse.cz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200227_094842_212016_C68FFE72 X-CRM114-Status: GOOD ( 21.36 ) 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: Jonathan Richardson , linux-mm@kvack.org, Nicolas Saenz Julienne , akpm@linux-foundation.org, Robin Murphy , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 27, 2020 at 10:56:12AM +0100, Vlastimil Babka wrote: > On 2/22/20 12:42 AM, Jonathan Richardson wrote: > > As of the 5.5 kernel I see boot errors in cma. It reserves 1G and then can't > > activate an area. I added some prints. It's trying to activate the DMA > > zone. This causes a driver to fail allocating a dma pool later on. The > > coherent pool is the default 256MB. If I reduce cma from 1G to 512M > > then it only tries activates DMA32 zone. I assume there was not enough cma > > memory for DMA zone? Are there any configuration changes required due > > to the DMA_ZONE and DMA_ZONE32 changes? I've attached my boot log. > > I think this question is better for the ARM guys. CC'd With commit 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32"), we limited ZONE_DMA to 1G to accommodate the RPi4 requirements. ZONE_DMA32 spans to the end of the 32-bit space. So with a CMA region that goes across the 1st GB, you'd hit this problem. The dma_contiguous_reserve() call in arm64 uses ZONE_DMA32 as the upper limit under the assumption that you don't need CMA in ZONE_DMA. But this one doesn't have a lower limit. What platform is this and how to you request the CMA size (cmdline)? Do you use a fixed base? Also, do you want the CMA in ZONE_DMA or ZONE_DMA32? > > [ 0.000000] cma: Reserved 1024 MiB at 0x00000000a0000000 > > ... > > [ 0.390448] Activating cma name: reserved, zone name: DMA > > [ 0.396564] pfn = 0xa0000 > > [ 0.399522] cma->count = 262144 > > [ 0.406244] pfn failed on = c0000 > > [ 0.410002] cma: CMA area reserved could not be activated > > > > static int __init cma_activate_area(struct cma *cma) > > { > > ... > > printk("Activating cma name: %s, zone name: %s\n", cma->name, zone->name); > > printk("pfn = 0x%lx\n", pfn); > > printk("cma->count = %lu\n", cma->count); > > > > do { > > unsigned j; > > > > base_pfn = pfn; > > for (j = pageblock_nr_pages; j; --j, pfn++) { > > WARN_ON_ONCE(!pfn_valid(pfn)); > > /* > > * alloc_contig_range requires the pfn range > > * specified to be in the same zone. Make this > > * simple by forcing the entire CMA resv range > > * to be in the same zone. > > */ > > if (page_zone(pfn_to_page(pfn)) != zone) { > > printk("pfn failed on = 0x%lx\n", pfn); > > goto not_in_zone; So I guess it's this test that fails as the CMA now spans ZONE_DMA and ZONE_DMA32. > > } > > } > > init_cma_reserved_pageblock(pfn_to_page(base_pfn)); > > } while (--i); > > > > Thanks. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel