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 136DA3019DC for ; Wed, 13 May 2026 10:32:40 +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=1778668361; cv=none; b=lzXeM61SnX8VKX5YIVvSqvQbaBYgaOSoMw5lVRSRxFa3OYJpRQSwMesAh/jDyxbSxNF1mglG2QQpfyWZp5FsMr8Oa5e2pc7WwZHrk9lGnU3HpzXsCP3uw7sT5qeeoSTyJ/HwlNOJi55ThWCpvD/d+hh+o7pAK1gqtbbF4Sxq6QY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778668361; c=relaxed/simple; bh=ZzMQKwrs8B6u4WEOzanO567l+RO2hrydIn7OzIi6yAM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e4j55cVvCUKtmuom1dKv7/TUe78QMJsZcZmLv1bsvf3fYr5us00qyW8KRgJOGDZlVWOwAROaAX5WtdTwL44S6KECJibKcmos5cRWBOsbM5myabZykR6X1m6yZBxOnAQRaF1y5Y28FFgefSYUlIxPqcBklC7c8zGjo7m7UTpg28Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PkdigcFq; 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="PkdigcFq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23970C2BCB7; Wed, 13 May 2026 10:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778668360; bh=ZzMQKwrs8B6u4WEOzanO567l+RO2hrydIn7OzIi6yAM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PkdigcFqYg7kgngvmc1Zg+e8nSoebVC897YRbfvvcVJb338fBeXZLs8HdeIzRy354 SzKevcBnEP4R3NeTNSCKNCcQfv4lNzl0Nf4bWMNfIQLLzJ8IQOtb9tAwaJpqKbEuKm d6tvQ1P8fm/l9DZ3Oq94JuNh2/qbdFT4nVQneTibUmCVhcgQepdkHNVZqwadU3ZRv3 wNtg//yn0q1p8KhJlxevexxGaBX0RI6Gk3we/zAvKpKuw36Q2rX0CebFL/U/0trcCI GwD+B+a7LSlauF2OQVxcVbzB5Htoar2TJgBhYC88x2NIeSpViE3GfKmXsvtT+HDnwe 61/OXJ9VmdcBg== Date: Wed, 13 May 2026 13:32:32 +0300 From: Mike Rapoport To: Pratyush Yadav Cc: Pasha Tatashin , Alexander Graf , Muchun Song , Oscar Salvador , David Hildenbrand , Andrew Morton , Jason Miu , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/12] kho: generalize radix tree APIs Message-ID: References: <20260429133928.850721-1-pratyush@kernel.org> <20260429133928.850721-2-pratyush@kernel.org> <2vxz8q9pdib3.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: <2vxz8q9pdib3.fsf@kernel.org> On Mon, May 11, 2026 at 06:25:52PM +0200, Pratyush Yadav wrote: > On Mon, May 11 2026, Mike Rapoport wrote: > > > On Wed, Apr 29, 2026 at 03:39:03PM +0200, Pratyush Yadav wrote: > >> From: "Pratyush Yadav (Google)" > >> > >> The KHO radix tree is a data structure that can track the presence or > >> absence of an arbitrary key, with nothing inherently tied to KHO memory > >> preservation tracking. This was one of the design goals of the radix > >> tree. This was done to enable it to be re-used by other users of KHO. > >> > >> Despite that, the radix tree APIs are very closely tied to KHO memory > >> preservation tracking. Adding a key is done by kho_radix_add_page(), > >> which encodes it as a page tracking operation and takes in PFN and > >> order. kho_radix_del_page() does the same. These functions encode the > >> key internally that goes into the radix tree. kho_radix_walk_tree() does > >> the same by baking the PFN and order into the callback arguments. > >> > >> Generalize the APIs by taking the key directly and doing the encoding at > >> the callers. Rename the functions to kho_radix_add_key() and > >> kho_radix_del_key(). In practice, this removes a line each from the > >> functions and moves the encoding function call to the callers. > >> Similarly, update kho_radix_tree_walk_callback_t to take the key > >> directly. > >> > >> To keep the naming convention clearer, rename > >> kho_radix_{encode,decode}_key() to kho_{encode,decode}_radix_key(). > >> > >> Signed-off-by: Pratyush Yadav (Google) > >> --- > >> include/linux/kho_radix_tree.h | 18 +++---- > >> kernel/liveupdate/kexec_handover.c | 76 ++++++++++++++---------------- > >> 2 files changed, 42 insertions(+), 52 deletions(-) > >> > >> diff --git a/include/linux/kho_radix_tree.h b/include/linux/kho_radix_tree.h > >> index 84e918b96e53..f368f3b9f923 100644 > >> --- a/include/linux/kho_radix_tree.h > >> +++ b/include/linux/kho_radix_tree.h > >> @@ -85,7 +85,7 @@ static struct kho_out kho_out = { > >> }; > >> > >> /** > >> - * kho_radix_encode_key - Encodes a physical address and order into a radix key. > >> + * kho_encode_radix_key - Encodes a physical address and order into a radix key. > > > > Let's keep kho_radix_ prefix for namespasing please. > > This is the common practice these days. > > I am keeping the namespacing, just moving it out of the "kho_radix" > namespace to "kho" namespace. The mental model is that this function has > nothing to do with the radix tree. It is just something KHO uses for one > of its radix tree, so it should live in the "kho" namespace not > "kho_radix". > > Does that make sense? I can add this explanation to the commit message > as well. With this explanation it makes sense, with "to keep the naming convention clearer" it felt the opposite :) > -- > Regards, > Pratyush Yadav -- Sincerely yours, Mike.