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=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 381EFC433E0 for ; Mon, 22 Mar 2021 18:36:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EA1061994 for ; Mon, 22 Mar 2021 18:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231468AbhCVSgE (ORCPT ); Mon, 22 Mar 2021 14:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbhCVSfV (ORCPT ); Mon, 22 Mar 2021 14:35:21 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE8BC061574 for ; Mon, 22 Mar 2021 11:35:21 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id y18so11628834qky.11 for ; Mon, 22 Mar 2021 11:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jonmasters-org.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ty7sAVs+UNafvjH6QynuwOmpwAWFADfLSWscYpexmW4=; b=10COgiJvzqPsA9rvMaiYoVJAwuBKsknTLcxcJ3o71g/vp7aNWTbH7cNYpleFgOw0dM Q2YDotgAsWJ34bBzNbkj/jWpFc498pBUouqJjx99tSFgXtkBlCo/YvDL3Spre/H5MAok bmuEoQsSc1w1yakV/la3mZdgFTrxc+8D5Om6T/mjEBhPg6bCjRkR1qm7Sr5gHkZABkZ8 9sIzpPQrA+YBgGEdkGSxklPZaAVT7bZkucX52dWB1I1fXZOOrLDZ4DYY25AysVd8pa9c +ifOSacAMJJ+nug8V3Vyki7LpVO1Cwh/ErCtaMCv5F2REwT5+22Y9rEFoYJyGy4eCqfu H3oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ty7sAVs+UNafvjH6QynuwOmpwAWFADfLSWscYpexmW4=; b=adsMalH1qaIuScpXeVLNjt3SBdwAe5D6PkN1BhQvJ/oyWwphOpsDLOvyg8gn9lxAs5 khWRp2pyZiiE/Pw7Ik9svSShy0eI1A88KZfdSUlzKbzYsIlRWBQBk5r96GfuokN21Fsu OHooR6W4Y/YCzODkbex9X5RNYfalzgfHqyDzgMc2uIHNazv7+kz0W2xBmYuMKEnsO1dS MAYD2BwetOnfrXKcaAJ4GKQOHKD2GieXvYMWYycYhxkHOb9rdLfJ13zlR6pj/vL5/nzy jhuDX8CZfrUJRaB17EglDo5xRTr4YSXj0faP/QLigqTBsYfdgf67v4IqvN3Olg42ucw/ Xnwg== X-Gm-Message-State: AOAM531y5EPU12c5pMa3eRdLOPQ0M+zS6565iAaD2sM3HYqvgK7kWy2H dFniFPgjdJqf7WuT7ubJRauOHg== X-Google-Smtp-Source: ABdhPJyZD6r4Sa0DfiDV40Jb0cH0o1l73DCoXB3n8uBU+cy5CkRoivOu1GOTk+W52nx36ADl6XZ07A== X-Received: by 2002:a37:e110:: with SMTP id c16mr1444098qkm.67.1616438120672; Mon, 22 Mar 2021 11:35:20 -0700 (PDT) Received: from independence.bos.jonmasters.org (Boston.jonmasters.org. [50.195.43.97]) by smtp.gmail.com with ESMTPSA id b17sm9442287qtp.73.2021.03.22.11.35.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Mar 2021 11:35:20 -0700 (PDT) Subject: Re: [PATCH v3 2/2] arm64: mm: reserve CMA and crashkernel in ZONE_DMA32 To: Nicolas Saenz Julienne , catalin.marinas@arm.com, linux-kernel@vger.kernel.org Cc: Qian Cai , Will Deacon , linux-arm-kernel@lists.infradead.org References: <20191107095611.18429-1-nsaenzjulienne@suse.de> <20191107095611.18429-3-nsaenzjulienne@suse.de> From: Jon Masters Organization: World Organi{s,z}ation of Broken Dreams Message-ID: <4f094513-507d-566d-a0e2-a30ea36f64c9@jonmasters.org> Date: Mon, 22 Mar 2021 14:34:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191107095611.18429-3-nsaenzjulienne@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nicolas, On 11/7/19 4:56 AM, Nicolas Saenz Julienne wrote: > With the introduction of ZONE_DMA in arm64 we moved the default CMA and > crashkernel reservation into that area. This caused a regression on big > machines that need big CMA and crashkernel reservations. Note that > ZONE_DMA is only 1GB big. > > Restore the previous behavior as the wide majority of devices are OK > with reserving these in ZONE_DMA32. The ones that need them in ZONE_DMA > will configure it explicitly. > > Reported-by: Qian Cai > Signed-off-by: Nicolas Saenz Julienne > --- > arch/arm64/mm/init.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 580d1052ac34..8385d3c0733f 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -88,7 +88,7 @@ static void __init reserve_crashkernel(void) > > if (crash_base == 0) { > /* Current arm64 boot protocol requires 2MB alignment */ > - crash_base = memblock_find_in_range(0, ARCH_LOW_ADDRESS_LIMIT, > + crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit, > crash_size, SZ_2M); > if (crash_base == 0) { > pr_warn("cannot allocate crashkernel (size:0x%llx)\n", > @@ -454,7 +454,7 @@ void __init arm64_memblock_init(void) > > high_memory = __va(memblock_end_of_DRAM() - 1) + 1; > > - dma_contiguous_reserve(arm64_dma_phys_limit ? : arm64_dma32_phys_limit); > + dma_contiguous_reserve(arm64_dma32_phys_limit); > } > > void __init bootmem_init(void) Can we get a bit more of a backstory about what the regression was on larger machines? If the 32-bit DMA region is too small, but the machine otherwise has plenty of memory, the crashkernel reservation will fail. Most e.g. enterprise users aren't going to respond to that situation by determining the placement manually, they'll just not have a crashkernel. Jon. -- Computer Architect 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=-15.5 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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 3A1E4C433C1 for ; Mon, 22 Mar 2021 18:37:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 A352E61994 for ; Mon, 22 Mar 2021 18:37:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A352E61994 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jonmasters.org 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=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LYHnTYqKBouNLXYL7Wk3H2BKjU82r2gBCdBUcKPIIBo=; b=DlKbOj9tw1wJdNEBANM73rhHb J99DBNqjsX8XTuN7FTb6ZoQ4oVd7RtJ0IHl0PYefM/CxJrJZTUhkDOoiPlHqtiHbOaxEHiK/ZvXYw edLPEbkqicZRkkBSY7v/iQCE5cJbfy5m8aBJCiwOgpeTHDI8T6BOEk2mru2ZfUHz4dIisPFoQVTtg Vz3J8t43ey+RRbAYoxvbgtuMfI3IfdhM30PlOdeE8FEsYYFEuRlkmFQ7sHxsKjBNTI4haGJ6LyPUO 9T+Xt5D2q4PyLNc9YESTLbCirtsmsfPyGversZwSIY55W/kSSqSAxUEDxm1YXPZJjSPwK7ps5ITcj DUamua85w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOPOu-00CGrK-Te; Mon, 22 Mar 2021 18:35:41 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOPOi-00CGpi-2E for linux-arm-kernel@lists.infradead.org; Mon, 22 Mar 2021 18:35:33 +0000 Received: by mail-qk1-x731.google.com with SMTP id g20so11624176qkk.1 for ; Mon, 22 Mar 2021 11:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jonmasters-org.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ty7sAVs+UNafvjH6QynuwOmpwAWFADfLSWscYpexmW4=; b=10COgiJvzqPsA9rvMaiYoVJAwuBKsknTLcxcJ3o71g/vp7aNWTbH7cNYpleFgOw0dM Q2YDotgAsWJ34bBzNbkj/jWpFc498pBUouqJjx99tSFgXtkBlCo/YvDL3Spre/H5MAok bmuEoQsSc1w1yakV/la3mZdgFTrxc+8D5Om6T/mjEBhPg6bCjRkR1qm7Sr5gHkZABkZ8 9sIzpPQrA+YBgGEdkGSxklPZaAVT7bZkucX52dWB1I1fXZOOrLDZ4DYY25AysVd8pa9c +ifOSacAMJJ+nug8V3Vyki7LpVO1Cwh/ErCtaMCv5F2REwT5+22Y9rEFoYJyGy4eCqfu H3oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ty7sAVs+UNafvjH6QynuwOmpwAWFADfLSWscYpexmW4=; b=gQrlTTN5DKddzhR0XY/H7ZfQslgnNxeP2XA4mHbZN5uLDi9lj5/eousnuMnZTdMb3G UIksiNxfALTp0kj4IzcSiB4o4Bb7ksXWKQcXSZYpWTHeQaVRdS+T+xsO4Zj9hSEi0FTt BbkP9KeNdXVghl4NgWSOUOmJtrJM7VqCmccJKNMRoxoXYtBlJEk58uCHlhxI1EhYOZtb m6KCch4KShzfc8EpIvpETHLy62Uf1/arIN5xH+eBglkwv5FgFaOH5xMiq3QzqW1Fhh6L MkeKIhJjNnY7nj381peRatySOP7e9jUytogU088B69moPqOQiPzVG+MnW8thp/HzrMUY n0Mw== X-Gm-Message-State: AOAM532tdvXdPidLDWgvgEkBI5tkUpze7mxOR/KLGs28UlYJIGvdFH91 ZjSYzp/SMhtNe8ir7kMI0qVQ/1CK5l2JO6Ek X-Google-Smtp-Source: ABdhPJyZD6r4Sa0DfiDV40Jb0cH0o1l73DCoXB3n8uBU+cy5CkRoivOu1GOTk+W52nx36ADl6XZ07A== X-Received: by 2002:a37:e110:: with SMTP id c16mr1444098qkm.67.1616438120672; Mon, 22 Mar 2021 11:35:20 -0700 (PDT) Received: from independence.bos.jonmasters.org (Boston.jonmasters.org. [50.195.43.97]) by smtp.gmail.com with ESMTPSA id b17sm9442287qtp.73.2021.03.22.11.35.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Mar 2021 11:35:20 -0700 (PDT) Subject: Re: [PATCH v3 2/2] arm64: mm: reserve CMA and crashkernel in ZONE_DMA32 To: Nicolas Saenz Julienne , catalin.marinas@arm.com, linux-kernel@vger.kernel.org Cc: Qian Cai , Will Deacon , linux-arm-kernel@lists.infradead.org References: <20191107095611.18429-1-nsaenzjulienne@suse.de> <20191107095611.18429-3-nsaenzjulienne@suse.de> From: Jon Masters Organization: World Organi{s,z}ation of Broken Dreams Message-ID: <4f094513-507d-566d-a0e2-a30ea36f64c9@jonmasters.org> Date: Mon, 22 Mar 2021 14:34:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191107095611.18429-3-nsaenzjulienne@suse.de> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_183528_933620_3678BF55 X-CRM114-Status: GOOD ( 25.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Hi Nicolas, On 11/7/19 4:56 AM, Nicolas Saenz Julienne wrote: > With the introduction of ZONE_DMA in arm64 we moved the default CMA and > crashkernel reservation into that area. This caused a regression on big > machines that need big CMA and crashkernel reservations. Note that > ZONE_DMA is only 1GB big. > > Restore the previous behavior as the wide majority of devices are OK > with reserving these in ZONE_DMA32. The ones that need them in ZONE_DMA > will configure it explicitly. > > Reported-by: Qian Cai > Signed-off-by: Nicolas Saenz Julienne > --- > arch/arm64/mm/init.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 580d1052ac34..8385d3c0733f 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -88,7 +88,7 @@ static void __init reserve_crashkernel(void) > > if (crash_base == 0) { > /* Current arm64 boot protocol requires 2MB alignment */ > - crash_base = memblock_find_in_range(0, ARCH_LOW_ADDRESS_LIMIT, > + crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit, > crash_size, SZ_2M); > if (crash_base == 0) { > pr_warn("cannot allocate crashkernel (size:0x%llx)\n", > @@ -454,7 +454,7 @@ void __init arm64_memblock_init(void) > > high_memory = __va(memblock_end_of_DRAM() - 1) + 1; > > - dma_contiguous_reserve(arm64_dma_phys_limit ? : arm64_dma32_phys_limit); > + dma_contiguous_reserve(arm64_dma32_phys_limit); > } > > void __init bootmem_init(void) Can we get a bit more of a backstory about what the regression was on larger machines? If the 32-bit DMA region is too small, but the machine otherwise has plenty of memory, the crashkernel reservation will fail. Most e.g. enterprise users aren't going to respond to that situation by determining the placement manually, they'll just not have a crashkernel. Jon. -- Computer Architect _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel