Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp315191rwl; Thu, 30 Mar 2023 16:43:40 -0700 (PDT) X-Google-Smtp-Source: AKy350aIYSUPWFbpKju8qCmiDGXTjLwqvyqBX6OvtO2y97OWD9n5qFDZc02qez9IkZ4Nmpu8Walb X-Received: by 2002:a62:aa15:0:b0:627:e878:1dbd with SMTP id e21-20020a62aa15000000b00627e8781dbdmr4443461pff.3.1680219820660; Thu, 30 Mar 2023 16:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680219820; cv=none; d=google.com; s=arc-20160816; b=n+Kv5LnUDQyNkOewriHHtONF+OJf1CQqSw+J0DzA/llAmS3FzAJsR/B+xvGrTRyCC7 83IXQTyMJQey/NEbakbyWN1DaK29wOI4upmq3Shdx36h4i9uH1Wn9Ro8xFJYFaiGlyRz LEP+QuZ4ka8kj79AIXj3Mz0+k1rhUDJ4wsIprBWS/6WxDADV4umkCEvC0yU2KZlYrWAT RkbVEIKTCJlV8gtZyEHOjdo8j1WWcnQpAeWX46kuu7F5BMZ8z0HX07DhjQUxLgDx+3qn FBb92bzNPt6OfS5Ooco0bN+C6cgq00izqx3rlTKmtw0KSIgGeSihwfsA4pHLG958SPFk q0eg== 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:dkim-signature; bh=HFKIO15sTpdAt8JGYcoib0o9EwbibSfqk1NxeizxC3g=; b=SFL5SPntIS4DjpHmOJh9ci1sit41o9jGdHe3vCm9WqyMvYkYIGPPT5q7jG3DTKm//u ImDEZ8EC8oToHBiVjMM1YbkGitKp8twZiLJOmreoaTgti0021Al2g2SG7PJqs4PDkqIW 1/UMriYE5fAUf7qD6BjGZu0arpwuxqAkfoKzmRlXicnb/km292eF1bcC1Ou+jMyP+Ljc hfr57giBdCuB71Al0dMDFh4RaWQP+UrDao4jNhMk9thMSnTMGGuo5QZX3jSKp7tyPeoX vtuYP06y4haVFuByjO2eX9Nb/kHoB5Q6baIy5RyUtHd1OFwe0o2klIW2MBjlZtPvt6nu P6Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GQOtV3wT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m8-20020a63fd48000000b0051391af4025si861705pgj.214.2023.03.30.16.43.29; Thu, 30 Mar 2023 16:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GQOtV3wT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231355AbjC3Xdx (ORCPT + 99 others); Thu, 30 Mar 2023 19:33:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbjC3Xdw (ORCPT ); Thu, 30 Mar 2023 19:33:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C728A5FA for ; Thu, 30 Mar 2023 16:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680219186; 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: in-reply-to:in-reply-to:references:references; bh=HFKIO15sTpdAt8JGYcoib0o9EwbibSfqk1NxeizxC3g=; b=GQOtV3wTHTa3GJUQnSt9+ZXRuLp0ErCLwM/e9U57kA+WZ+/Vw91oIb6bfklil53zFyNhoy gACnIit32GC2gF01hORkMQJwnDSpCxcKu7Fd41JWlYhtW1DRZ81tclCz8bOwS2MuOfMoql J8sJ8MPEilF9fn4ob5ctPCzwg1LMNEU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-43-KMXxKy-dMLmNmEpxqNMX8w-1; Thu, 30 Mar 2023 19:33:01 -0400 X-MC-Unique: KMXxKy-dMLmNmEpxqNMX8w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 625BB3C0F231; Thu, 30 Mar 2023 23:33:00 +0000 (UTC) Received: from localhost (ovpn-12-64.pek2.redhat.com [10.72.12.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F368202701E; Thu, 30 Mar 2023 23:32:58 +0000 (UTC) Date: Fri, 31 Mar 2023 07:32:54 +0800 From: Baoquan He To: "chenjiahao (C)" Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, conor.dooley@microchip.com, guoren@kernel.org, heiko@sntech.de, bjorn@rivosinc.com, alex@ghiti.fr, akpm@linux-foundation.org, atishp@rivosinc.com, thunder.leizhen@huawei.com, horms@kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, linux-doc@vger.kernel.org Subject: Re: [PATCH -next v2 1/2] riscv: kdump: Implement crashkernel=X,[high,low] Message-ID: References: <20230328115150.2700016-1-chenjiahao16@huawei.com> <20230328115150.2700016-2-chenjiahao16@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 03/30/23 at 09:40pm, chenjiahao (C) wrote: ...... > Agreed, I will clean this up later in next version. > > > + if (ret || !crash_size) > > > + return; > > > + > > > + /* > > > + * crashkernel=Y,low is valid only when crashkernel=X,high > > > + * is passed and high memory is reserved successful. > > > + */ > > > + ret = parse_crashkernel_low(boot_command_line, 0, &crash_low_size, &crash_base); > > > + if (ret == -ENOENT) > > > + crash_low_size = DEFAULT_CRASH_KERNEL_LOW_SIZE; > > > + else if (ret) > > > + return; > > > + > > > + search_start = dma32_phys_limit; > > > + } else if (ret || !crash_size) { > > > + /* Invalid argument value specified */ > > > return; > > > + } > > > crash_size = PAGE_ALIGN(crash_size); > > > @@ -1201,16 +1246,26 @@ static void __init reserve_crashkernel(void) > > > */ > > > crash_base = memblock_phys_alloc_range(crash_size, PMD_SIZE, > > > search_start, > > > - min(search_end, (unsigned long) SZ_4G)); > > > + min(search_end, (unsigned long)dma32_phys_limit)); > > > if (crash_base == 0) { > > The above conditional check isn't right. If crashkernel=size@offset > > specified, the reservation failure won't trigger retry. This seems to be > > originally introduced by old commit, while this need be fixed firstly. > > Just a little curious about the rule to cope with this specific case. If > "crashkernel=size@offset" was passed > > but reserve failed, should try again to allocate in high memory, regardless > the specified size@offset, > > or just throw a warning and return? Since I noticed the current logic here > on Arm64 is to check if !fixed_base first Yeah, we need mark the "crashkernel=size@offset" case and avoid to retry. Because you won't succeed if memblock has already failed to reserve an unavailable memory region, retry is meaningless. This has been done in x86, arm64.