From mboxrd@z Thu Jan 1 00:00:00 1970 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 585D03EDADF for ; Thu, 19 Mar 2026 16:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773938105; cv=none; b=N4f1cxhw40zYnhHWi6PaBkHn/rycFfOkH5swBwzmCC3jRSb6KpsTky9Ffq5cEGMXL0+JbekEM6NqD9/wXIaeY2Ob2BcTX1F4wTf8Wj9R1J8hXfTvW0jnHpERPl45+jUk1NxWK0XgUWZpGUV+EzHmARiTWXdSObNrKeJnzuq1mrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773938105; c=relaxed/simple; bh=gY6VMd+3RUM8XufPoMrgfnG5Ab4Wsx/0i1ZcgPhZzsE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rWONbBADcwdI0K3kjA+L/55+TUYGqx+HM0/1xeIaH6AiLWcv2MZ3oAjIHnJeOuUFZuL8ecK8IclHnurpYtoNzMBmU9ZuHBO70GGfq7fbsVEoBWiMscVRp5/NZezrfrYguW63Bwc6rZUu6WSsnZ2JtDHECncbnF7/taAasQeT8eg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GfS0Rd0n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GfS0Rd0n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C5E6C19424; Thu, 19 Mar 2026 16:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773938104; bh=gY6VMd+3RUM8XufPoMrgfnG5Ab4Wsx/0i1ZcgPhZzsE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GfS0Rd0n2wCBdublXIfYfreIcoZEP/sUdrvPbrb46baZ0K3kSc3pP7HNKBgs0/fHm P7iZaQ8GMUyit38E9XYqTzeb0g7G2QQg5uvZIPuPFKs5hiK/0MGnjqYcqbYPTkpetv 7A21IrZhCbICFxrFfHU7mpapMcIU92DMDQl6nTh42mEscy3c/JjBsiDpc3ch3cNlZ3 rowHtKlBmp0MaUkSEMyh4W0Ckz072e6oMbe1/AAQaEkj2OQvYN5gvWmdHbdSvWiTKp ivSG7IJmO6s4bjswIrdne8v5sdkDuNlT1z2jrGAfhgMWoH1mqzVftJ+NMccGk0aGTl /yHJvccVHYlgA== Date: Thu, 19 Mar 2026 18:34:57 +0200 From: Mike Rapoport To: "Guilherme G. Piccoli" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, Andrew Morton , Steven Rostedt , SeongJae Park Subject: Re: [PATCH v3 2/2] mm/memblock: Add reserve_mem debugfs info Message-ID: References: <20260318190816.1811325-1-gpiccoli@igalia.com> <20260318190816.1811325-3-gpiccoli@igalia.com> 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-Disposition: inline In-Reply-To: <20260318190816.1811325-3-gpiccoli@igalia.com> On Wed, Mar 18, 2026 at 03:56:33PM -0300, Guilherme G. Piccoli wrote: > When using the "reserve_mem" parameter, users aim at having an > area that (hopefully) persists across boots, so pstore infrastructure > (like ramoops module) can make use of that to save oops/ftrace logs, > for example. > > There is no easy way to determine if this kernel parameter is properly > set though; the kernel doesn't show information about this memory in > memblock debugfs, neither in /proc/iomem nor dmesg. This is a relevant > information for tools like kdumpst[0], to determine if it's reliable > to use the reserved area as ramoops persistent storage; checking only > /proc/cmdline is not sufficient as it doesn't tell if the reservation > effectively succeeded or not. > > Add here a new file under memblock debugfs showing properly set memory > reservations, with name and size as passed to "reserve_mem". Notice that > if no "reserve_mem=" is passed on command-line or if the reservation > attempts fail, the file is not created. ... > -static int __init memblock_init_debugfs(void) > +static inline void memblock_debugfs_make_dirs(struct dentry *root) This does not make dirs but rather exposes files representing memblock arrays. How about calling this function memblock_debugfs_expose_arrays()? > { > - struct dentry *root = debugfs_create_dir("memblock", NULL); > - > - debugfs_create_file("memory", 0444, root, > - &memblock.memory, &memblock_debug_fops); > - debugfs_create_file("reserved", 0444, root, > - &memblock.reserved, &memblock_debug_fops); > #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP > debugfs_create_file("physmem", 0444, root, &physmem, > &memblock_debug_fops); > #endif > + debugfs_create_file("memory", 0444, root, > + &memblock.memory, &memblock_debug_fops); > + debugfs_create_file("reserved", 0444, root, > + &memblock.reserved, &memblock_debug_fops); No need to move these after PHYS_MAP attribute > +} -- Sincerely yours, Mike.