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 67CFA3EBF08 for ; Sun, 22 Feb 2026 19:19:17 +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=1771787957; cv=none; b=MNzi3c7REFIi4/QUx6Iuo903JP1r1lmPtm8hv+iNxeDkr+Kqa0y8VPB2ePmAsPTD+Qay9ryNEx3OYygIujRJqE+aIqaW8N/0qXlM73eW0gYPhFwAlyyzM9QV4W+fwRNmK6neyH4iVbLX1pElm96fO0CsztGgnmYbph3FWzW+rH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771787957; c=relaxed/simple; bh=n/zIiLwTtWDrsA7tXCS8QVerjI0mo0TWT+TuUdTwBBs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=i0qdMCAseY3BAxtOZpg/u68imc2vqy2uib2m/n3fvQHneO6Sss8u0VQGCNA/oO4BnPJHD/wZUWH6REeQXWvxGGiNIPv1BUHUltxk6+6lpiAmdbly9DfLutCidF2eLC0WZeH9UemfYSdogWa7bD2iL0VEWlOYuNQH8yrc7kqkDL8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TNuLlp54; 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="TNuLlp54" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85B8AC116D0; Sun, 22 Feb 2026 19:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771787957; bh=n/zIiLwTtWDrsA7tXCS8QVerjI0mo0TWT+TuUdTwBBs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TNuLlp54ilYBBuwL0IgwinZ4vtTmJlwVmu0YGa3OrBJZbKmxfocxSAkVrYm9fSQVu 5TbImw6qCGGNujQJlFPygCedUJwn9E1OGGNQcyXMGT7weSttMmz4gZfMD9fl1cLseK yrpS2Y4JRQrkxw2xuFfbRRkhm2kWqDpkSbaLXP4R5+kJWYKhws2CRuOtqPaI0O3VAu vTfxfu+Yo6SEuHBJqii873lIhyBThO5nFH94hX09HbqD1sEAR3A2NZtBtUrNQ/IVqY NKR23yRaWQSflwHyHjI51s+18yoDH0dad1UWHLQ1zHN0xIwlDN9kL4pkmIfnS/2WUh B8lf7Z2TMm0Qg== Date: Sun, 22 Feb 2026 21:19:10 +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 Subject: Re: [PATCH 2/2] mm/memblock: Add reserve_mem debugfs info Message-ID: References: <20260217195816.861684-1-gpiccoli@igalia.com> <20260217195816.861684-3-gpiccoli@igalia.com> <20e28221-f9c7-47c0-43fa-72bb2e868386@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: <20e28221-f9c7-47c0-43fa-72bb2e868386@igalia.com> On Sun, Feb 22, 2026 at 10:58:27AM -0300, Guilherme G. Piccoli wrote: > Hi Mike, thanks a bunch for your review! Good ideas, I'll change the > implementation to follow the suggestions and improve the changelog, as > you suggested. I have some questions though, that I will comment inline, > below. > > First of all, what should we do regarding patch 1? Should I resubmit as > part of V2, even with no changes - or pick it now and I only submit > patch 2 as V2, with changes? Please resend both patches together. > On 21/02/2026 05:52, Mike Rapoport wrote: > > [...] > >> + string_get_size((u64)(map->size), 1, STRING_UNITS_2, txtsz, 16); > > > > phys_addr_t should be casted automatically to u64 IMO. > > And please, no magic numbers. > > Specifically here, by magic number you mean my choice of 16, right? What > do you suggest me to pick? It's the length of the string carrying the > size of reserved_mem, some number must be selected for this > length...lemme know WDYT. sizeof(txtsz) should work :) > > [...] > > You can define "reserve_mem" attribute separately, and leave the existing > > memblock_debug_show() as it was. > > > >> + } else > >> + memblock_debugfs_files(m); > >> + > >> return 0; > >> } > >> DEFINE_SHOW_ATTRIBUTE(memblock_debug); > >> @@ -2762,6 +2791,9 @@ static int __init memblock_init_debugfs(void) > >> { > >> struct dentry *root = debugfs_create_dir("memblock", NULL); > > > > No need to create memblock directory in debugfs if there's nothing to show. > > Could be something like > > > > if (i!(IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK) || reserved_mem_count)) > > return; > > > > root = debugfs_create_dir("memblock", NULL); > > Very good suggestions here, but just let me clarify: so I could continue > showing the "reserved_mem_param" inside the "/memblock" folder, > just using a different function for that attribute? Yes, something like static int memblock_reserve_mem_show(struct seq_file *m, void *private) { ... } DEFINE_SHOW_ATTRIBUTE(memblock_reserve_mem); > I understood that, based on your (good) suggestion to hide the memblock > folder if ARCH_KEEP_MEMBLOCK is not defined and there is no reserved_mem > set ... just want to confirm to follow-up the implementation. Yes, that's what I meant. > Cheers, > Guilherme -- Sincerely yours, Mike.