Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46457C3525C for ; Thu, 16 Dec 2021 11:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231820AbhLPLRM (ORCPT ); Thu, 16 Dec 2021 06:17:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231509AbhLPLRK (ORCPT ); Thu, 16 Dec 2021 06:17:10 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A459CC061574; Thu, 16 Dec 2021 03:17:08 -0800 (PST) Received: from zn.tnic (dslb-088-067-202-008.088.067.pools.vodafone-ip.de [88.67.202.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1BBCD1EC02B9; Thu, 16 Dec 2021 12:17:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1639653423; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=kQgrnGxARMUmyWS4ZfbhCjy6YQvkkQnXAJvFOuNC060=; b=L7MnPaZko5wjUZrAPnMPC6e3uSYv1aMq0IAniLsPJilq9W1kTVuyfjf4+ZNI6J1mv7HS4A N2X1sI2WKXceFI5DHsGIbX4rmNDKoFEGNjdLWKdUE/dwPPGPOY+xNdzDPuLsDgsi81DAF+ DcXUeSCqYPaVbT0x03Pra/MXzPt5fB4= Date: Thu, 16 Dec 2021 12:17:10 +0100 From: Borislav Petkov To: Zhen Lei Cc: Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, Dave Young , Baoquan He , Vivek Goyal , Eric Biederman , kexec@lists.infradead.org, Catalin Marinas , 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 Subject: Re: [PATCH v17 05/10] x86: kdump: move reserve_crashkernel[_low]() into crash_core.c Message-ID: References: <20211210065533.2023-1-thunder.leizhen@huawei.com> <20211210065533.2023-6-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211210065533.2023-6-thunder.leizhen@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 10, 2021 at 02:55:28PM +0800, Zhen Lei wrote: > + * reserve_crashkernel() - reserves memory for crash kernel > + * > + * This function reserves memory area given in "crashkernel=" kernel command > + * line parameter. The memory reserved is used by dump capture kernel when > + * primary kernel is crashing. > + */ > +void __init reserve_crashkernel(void) As I've already alluded to in another mail, ontop of this there should be a patch or multiple patches which clean this up more and perhaps even split it into separate functions doing stuff in this order: 1. Parse all crashkernel= cmdline options 2. Do all crash_base, crash_size etc checks 3. Do the memory reservations And all that supplied with comments explaining why stuff is being done. This set of functions is a mess and there's no better time for cleaning it up and documenting it properly than when you move it to generic code. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette