Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4721084ioa; Wed, 27 Apr 2022 09:38:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnLbF0CyyGdWPH48OHZaZROpLc/LqiaFeFr+AEM+Pa1BkSFUiU1PJp3rd14mEpUbP+ZMXu X-Received: by 2002:a63:5907:0:b0:382:2f93:5467 with SMTP id n7-20020a635907000000b003822f935467mr24297492pgb.460.1651077507708; Wed, 27 Apr 2022 09:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651077507; cv=none; d=google.com; s=arc-20160816; b=puKpkr14gC6uz0l1qLJc9j/0PRfA9Xh6r8ZI66MmwlYR4j2cm2zolk4o3fLHoKfzrB 5Ej+D4rpJtpctEeQvosYzKawAhosFMgP7+XudpOV0WzHDzL5v7z+Lmc2rSKN+RziBf/t iiTb1yfF0PjbfRSDuB7zChyJ80RDoVuVFsjVzDyYsrB5o16/eRz7vmNhLuLweJ6d4j4S +cp6dQ+61zTaDBTqItufd9GNfWOP8TkJqXyGbeZehHNP8x7Jvp9da0Pvi02bYUjDXpxa Nqkt0ulqTHSwvYKhpImU04iXN9QU3id6F/MJomvOYWZdkRik27kdDw6ty5wFdXCxyyqj BAPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=GqEtQUCiAHeppi+iQJUEpdv8COdXKQyEetkJkeVqE20=; b=ISMBM0ro9seJlj+Xkx8BOWv2kd0vg+9aGLDDiqdqkf2lYjavwyi1qbb64mS/ibkfD9 Eqsg428lpinIchE8Yw6tHZGqhQvoxkkcHdFVATr1t1eFqaeE27c2YlwA5vjZ3EomOv6/ /YBwEj7LcHzqrYf3FN4M5DEZ80Ctka6S4kKkMjjgc5W9FSaHKBlPF9p2SXBB8GxmwJ9C RFd/BBMKUzcgV3pcdFLGbCKs/lPutDWmdd0i4XC+cARSUuXh40rfDhVgkZ4+lU5kWrDi KizqyMxJxkHlLL+PLu6Ew49f0uRqRSoTIX1R+3Pb7lqik4WcG1JO4r24J7eRR3C9npfN OiwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x25-20020a637c19000000b0039815687f74si1876073pgc.839.2022.04.27.09.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E3053FC1D5; Wed, 27 Apr 2022 09:08:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242013AbiD0QKO (ORCPT + 99 others); Wed, 27 Apr 2022 12:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242595AbiD0QJq (ORCPT ); Wed, 27 Apr 2022 12:09:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A2B3E4FBA; Wed, 27 Apr 2022 09:05:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3663661BE9; Wed, 27 Apr 2022 16:04:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25C52C385A9; Wed, 27 Apr 2022 16:04:25 +0000 (UTC) Date: Wed, 27 Apr 2022 17:04:22 +0100 From: Catalin Marinas To: "Leizhen (ThunderTown)" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, Dave Young , Baoquan He , Vivek Goyal , Eric Biederman , kexec@lists.infradead.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , John Donnelly , Dave Kleikamp Subject: Re: [PATCH v22 5/9] arm64: kdump: Reimplement crashkernel=X Message-ID: References: <20220414115720.1887-1-thunder.leizhen@huawei.com> <20220414115720.1887-6-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 27, 2022 at 09:49:20PM +0800, Leizhen (ThunderTown) wrote: > On 2022/4/27 20:32, Catalin Marinas wrote: > > I think one could always pass a default command line like: > > > > crashkernel=1G,high crashkernel=128M,low > > > > without much knowledge of the SoC memory layout. > > Yes, that's what the end result is. The user specify crashkernel=128M,low > and the implementation ensure the 128M low memory is allocated from DMA zone. > We use arm64_dma_phys_limit as the upper limit for crash low memory. > > +#define CRASH_ADDR_LOW_MAX arm64_dma_phys_limit > + unsigned long long crash_max = CRASH_ADDR_LOW_MAX; > + crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, > crash_base, crash_max); > > > Another option is to only introduce crashkernel=Y,low and, when that is > > passed, crashkernel=Y can go above arm64_dma_phys_limit. We won't need a > > 'high' option at all: > > > > crashkernel=1G - all within ZONE_DMA > > crashkernel=1G crashkernel=128M,low - 128M in ZONE_DMA > > 1G above ZONE_DMA > > > > If ZONE_DMA is not present or it extends to the whole RAM, we can ignore > > the 'low' option. > > I think although the code is hard to make generic, the interface is better to > be relatively uniform. A user might have to maintain both x86 and arm64, and > so on. It's not a good thing that the difference is too big. There will be some difference as the 4G limit doesn't always hold for arm64 (though it's true in most cases). Anyway, we can probably simplify things a bit while following the documented behaviour: crashkernel=Y - current behaviour within ZONE_DMA crashkernel=Y,high - allocate from above ZONE_DMA crashkernel=Y,low - allocate within ZONE_DMA There is no fallback from crashkernel=Y. The question is whether we still want a default low allocation if crashkernel=Y,low is missing but 'high' is present. If we add this, I think we'd be consistent with kernel-parameters.txt for the 'low' description. A default 'low' is probably not that bad but I'm tempted to always mandate both 'high' and 'low'. -- Catalin