From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 9531A3B3C19 for ; Mon, 15 Jun 2026 19:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781552266; cv=none; b=VxXyKMVB+dR8YBPnTgjo/xw07uFszPdpG3Ruj8aVIQkgHmAkIL8bVJQDyTZ5RCYMOW2mo1V7YHUmyldCO2Lsb5j59DRseXJ2pEG9JX19HNRs+bpTS5qsaW5/6frHnScIsjMCQT4/Shxn9oBPy/tckLGIe1BYIbFml0ZRpIMu5uk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781552266; c=relaxed/simple; bh=GSo+9zp4de/NiH6rVtwBiGgcFeil1BPsy7Y3pjYsZkE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GbNu7MgG1LXWn09xMtUE0sUkrjtWpq7Eyp15jx0n9BeKy6VwhrxDvYPmPQZyoY+5x2IcuSQTEU28XRJu8WzhdtexwU73cDyMe9WY2KR5StazwZCWEZXLnUSiuMtoylIizse1MrrPrDyUmYXnAciUuGKm9gvVFTaeGc0IZR3702Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b1Bs2BrC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b1Bs2BrC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E2741F000E9; Mon, 15 Jun 2026 19:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781552265; bh=hFOp9Mnlyd+4upqc3Wy51fIoKW/HpZIdfJ39eZ9j+VY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=b1Bs2BrC22gb7aJjDlwlKGl27EOTCJpSbtDjlfGJ+IWNFvciHyzMIxhbXF0FDetVK 9iaUTPPSYdTNtlbI64bUtd5VRGoeGL7Py4s6z5xiNURCkdxF0gNQcQtCgdeaL/FA69 Av0aZZjWOQoGrbCPjAAAgR1SBMSwThJjKJMFQHy+CSee228Tze1GnPxCcOSaXq4vRJ fyX5Lrq0iZKLofhtPib1TD5bM1nhN8qcJj5iWy9NJ9bhqdESlJFkzfNyWV8bUSHAzD TC2Q7jlWtEmPGsi0kWVYBq4L8xo+enYpCPGWU3f7QLQeFU1aYM6Mm4RZyOYIZVFvCt bMPmBrYImjJOQ== Date: Mon, 15 Jun 2026 22:37:36 +0300 From: Mike Rapoport To: Pratyush Yadav Cc: Pasha Tatashin , Alexander Graf , Muchun Song , Oscar Salvador , David Hildenbrand , Andrew Morton , Jason Miu , Jork Loeser , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: Re: [PATCH v2 15/18] kho: extend scratch Message-ID: References: <20260605183501.3884950-1-pratyush@kernel.org> <20260605183501.3884950-16-pratyush@kernel.org> <178143855117.2123877.6330314807920146675.b4-review@b4> <2vxztsr4orvg.fsf@kernel.org> 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: <2vxztsr4orvg.fsf@kernel.org> On Mon, Jun 15, 2026 at 03:28:03PM +0200, Pratyush Yadav wrote: > On Sun, Jun 14 2026, Mike Rapoport wrote: > > On Fri, 05 Jun 2026 20:34:48 +0200, Pratyush Yadav wrote: > > > >> +{ > >> + struct kho_radix_tree *tree = data; > > > > Would be nice to say which tree in the variable name ;) > > How about preserved_mem_map? But this is the new tree, isn't it? Maybe keep the variable name and add a comment? > >> +/** > > > > I don't think we expose statics as kernel-doc somewhere, so this > > probably shouldn't be a kernel-doc comment > > This is a leftover from the previous version, where this was external. > > I think the documentation is still worthwhile though, so I suppose I'll > turn it into a normal comment by removing the /**. Yeah, I meant it should not be a kernel-doc, just a plain comment. > >> +static void __init kho_extend_scratch(void) > >> +{ > >> + const struct kho_radix_walk_cb kho_cb = { > >> + .leaf = kho_ext_walk_key, > >> + .node = kho_ext_walk_node, > >> + }; > >> + const struct kho_radix_walk_cb ext_cb = { > >> + .leaf = kho_ext_mark_scratch, > >> + }; > >> + struct kho_radix_tree radix; > > > > sashiko says: > > > > Is it possible for the radix variable to contain uninitialized stack memory > > here? > > If radix is uninitialized, tree->root might contain garbage data when passed > > to kho_radix_init_tree() > > > > and I agree :) > > > > This should be > > > > struct kho_radix_tree radix = { 0 }; > > Ugh, right. But at the same time, it is odd for an initialization > function to expect an initialized object. Perhaps I should move the > kho_radix_init_tree() from kho_mem_retrieve() to > kho_memory_init_early(). Then kho_extend_scratch() won't have to do the > init at all and I can remove the if (tree->root) check from > kho_radix_init_tree(). Sounds about right :) > -- > Regards, > Pratyush Yadav -- Sincerely yours, Mike.