Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp256519rdb; Fri, 5 Jan 2024 08:49:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZLF2ZJ88rV9lBXmix1oIndJiHoJUbBRwav0Ynz4UfFATRMZrRG2N2LK1/JG86qctm0NzY X-Received: by 2002:a17:906:f889:b0:a23:36f7:4918 with SMTP id lg9-20020a170906f88900b00a2336f74918mr1277003ejb.72.1704473385052; Fri, 05 Jan 2024 08:49:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473385; cv=none; d=google.com; s=arc-20160816; b=GJJVpVCKeYzmXz4HjFxNR8m0xU0zUDf5m/ElXKzWCMbn+cvaJmTJIsJ9lGbREqKsrw qsR54RmTitPgAwKp4ryviBj3+AlMhDXfG4WR0uM+gWASmipsIBfcJfbSoD447wLy40/R N1eCi7MAWZ3pGCLv7GdR2xXWmCd1GftuSm6kuEauIonW22Y0L4Fn8NNC+Fu6rRvWcOj3 1J6YVo7cmUdK1sKH2IIBiqxF+Qmqql+tdlL7c5x4RO2NTKA7n4C+BLpWO4xDtcxs4XIO ksigjPPBeaLCSGz65Pm6+P+bpKH/M0QnaOSEX19VjeyUcObXgxuSnnMSULT8P1SR8T1p 3Mjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=rdh3HBcwcGjyvNQCVWfZTy/z3DWHDUZBIAu0VAJAvhY=; fh=3jQ4RtE6YZbWqn9ASwbCpa6XJUPPwQhag1CAD53Wgig=; b=GIoxpqypnT3Ydbrhfe6hot3Z5yEKb8UG+dVCmdUUN0fzcxKrC1Purw9BMmjnEm5K/B KWWC4CjdANB6rPeHFnqVp7+tLHEclcnRgZ/zA4RK7qjfNw/dfURBCQcjGPAjVxqVR+ih lw2K2h9o3Er9yZWuTF1xqocxlJWV1rXwFMxe3NtwcCBxHp46bVLKcx2kgIGmjaDpndvt Vg3H4JSKfRwy0CH/IPP59NglNzt0kYbd0FoZkYU0AJ6WxyDS88XgJFvIWxgifjk1UAL/ 020lvEG0Ac1ZF0Iu6VvnxKPT6JKlddD/TMTLjVlPZK9dsAWI+ASRbAeTDPJlj5ZvlKPb rd6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=V1xsG3UI; spf=pass (google.com: domain of linux-kernel+bounces-18087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18087-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dk15-20020a170906f0cf00b00a23382ae4c2si750300ejb.259.2024.01.05.08.49.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 08:49:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=V1xsG3UI; spf=pass (google.com: domain of linux-kernel+bounces-18087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18087-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CA29F1F236E1 for ; Fri, 5 Jan 2024 16:49:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C41A8321B8; Fri, 5 Jan 2024 16:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="V1xsG3UI" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE00C2E652 for ; Fri, 5 Jan 2024 16:49:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A39CC433C8; Fri, 5 Jan 2024 16:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1704473352; bh=yBEZyO9cmNSe7eUGAlx8l25OeQ5IowyYQAaA786v7DA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V1xsG3UIbgoXH8eDWj0UWzj8HxHu9glJsfJhUA/h7oi4aOWcBX8ofZnDfKjidBT20 USkR2ADcNSIrzIq96ywDguXoKUKwlqsllKnlF1Jow00FtpsHPMMk4rv6e07aXhkMH6 mKSA0oyiUx6okJHDgZEPH0wiR/if98XH/hnqRMUY= Date: Fri, 5 Jan 2024 08:49:11 -0800 From: Andrew Morton To: Huacai Chen Cc: Baoquan He , Vivek Goyal , Dave Young , Youling Tang , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kdump: Defer the insertion of crashkernel resources Message-Id: <20240105084911.b64f43b12b0c7e25436cb093@linux-foundation.org> In-Reply-To: <20231229080213.2622204-1-chenhuacai@loongson.cn> References: <20231229080213.2622204-1-chenhuacai@loongson.cn> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 29 Dec 2023 16:02:13 +0800 Huacai Chen wrote: > In /proc/iomem, sub-regions should be inserted after their parent, > otherwise the insertion of parent resource fails. But after generic > crashkernel reservation applied, in both RISC-V and ARM64 (LoongArch > will also use generic reservation later on), crashkernel resources are > inserted before their parent, which causes the parent disappear in > /proc/iomem. So we defer the insertion of crashkernel resources to an > early_initcall(). > > ... > > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -377,7 +377,6 @@ static int __init reserve_crashkernel_low(unsigned long long low_size) > > crashk_low_res.start = low_base; > crashk_low_res.end = low_base + low_size - 1; > - insert_resource(&iomem_resource, &crashk_low_res); > #endif > return 0; > } > @@ -459,8 +458,19 @@ void __init reserve_crashkernel_generic(char *cmdline, > > crashk_res.start = crash_base; > crashk_res.end = crash_base + crash_size - 1; > - insert_resource(&iomem_resource, &crashk_res); > } > + > +static __init int insert_crashkernel_resources(void) > +{ > + if (crashk_res.start < crashk_res.end) > + insert_resource(&iomem_resource, &crashk_res); > + > + if (crashk_low_res.start < crashk_low_res.end) > + insert_resource(&iomem_resource, &crashk_low_res); > + > + return 0; > +} > +early_initcall(insert_crashkernel_resources); > #endif > > int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map, I'm thinking Fixes: 0ab97169aa0 ("crash_core: add generic function to do reservation"). Also, is this a regression? Were earlier kernels OK?