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 346D438D for ; Tue, 12 May 2026 06:48:56 +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=1778568537; cv=none; b=BLjooWUlBMKdmXimIW9otKjqPvsA1QyopE7sMXOwLx6qDcwNEC0QygyREa0kiz34IrsBpxw6KltUI6rjpAtFxj+SEGTATu5gZcZdr3TOpeXPlPU7G+GC0YHZYKRCdsmHjJv0VXX7UYwXZljtTu1ggziGjUEdgaGOO/KcwgHQsQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778568537; c=relaxed/simple; bh=7xqrAItGMPFyfU6pVB+y7187hkbW+5r5jDMYDqJoTiQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qEatd829x0kMfQwfSwjnGf/8Z5TBqy6kU5Al/2kpJuV+lKylNvGOGIX+2J4JaFP1U89+RBNNBNTPkPXWsh9C4QJDyDq7iyhseoFOdYKFb6EZquSl3MwdaBo/9usy5SGzQkQ/mTyIlGiAULxqEhaWuxpkXC1V6O7Ul6DTpiIOvXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fS1MMDK/; 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="fS1MMDK/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33335C2BCB0; Tue, 12 May 2026 06:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778568535; bh=7xqrAItGMPFyfU6pVB+y7187hkbW+5r5jDMYDqJoTiQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fS1MMDK/QN+dzfCxgYeQoTcjMJ6ttyRYGb+GSjpCa2iG+uGxKaqxoEaqAY7XgpLqj h7gUD3lvWerOn0JiTixBa6c19jpcru3ryNOL92poGX3XMSk1iRVr+IZnyFSMn7o7EV EHiWqSP27esFnTSHl9Vxf/76IRsntTbyDzIF/9pucqUWazVu/9m2QRMtcjEwNsJBu+ ML7cfHnDWBi/7OR5wTxB6MpCzVeZH47EHccjWxf4mrJcm6pyMhLYCveiPX3vPceR4Z vq8d/Z6DZ+GeD2vrRL20SRAT3tW5YhAY2yZCz7B/NDHxTUN+Z8LVjZLJUE+dNqebCY 62nm+RXEgU0sg== Date: Tue, 12 May 2026 09:48:48 +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 03/12] kho: add a struct for radix callbacks Message-ID: References: <20260429133928.850721-1-pratyush@kernel.org> <20260429133928.850721-4-pratyush@kernel.org> <2vxzzf25c39x.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: <2vxzzf25c39x.fsf@kernel.org> On Mon, May 11, 2026 at 06:35:54PM +0200, Pratyush Yadav wrote: > On Mon, May 11 2026, Mike Rapoport wrote: > > > On Wed, Apr 29, 2026 at 03:39:05PM +0200, Pratyush Yadav wrote: > >> From: "Pratyush Yadav (Google)" > >> > >> A future commit will add more callbacks for the KHO radix tree. Add a > >> struct for collecting the callbacks. > >> > >> Signed-off-by: Pratyush Yadav (Google) > >> --- > [...] > >> --- a/kernel/liveupdate/kexec_handover.c > >> +++ b/kernel/liveupdate/kexec_handover.c > >> @@ -266,16 +266,18 @@ void kho_radix_del_key(struct kho_radix_tree *tree, unsigned long key) > >> } > >> EXPORT_SYMBOL_GPL(kho_radix_del_key); > >> > >> -static int kho_radix_walk_leaf(struct kho_radix_leaf *leaf, > >> - unsigned long key, > >> - kho_radix_tree_walk_callback_t cb) > >> +static int kho_radix_walk_leaf(struct kho_radix_leaf *leaf, unsigned long key, > >> + const struct kho_radix_walk_cb *cb) > >> { > >> unsigned long *bitmap = (unsigned long *)leaf; > >> unsigned int i; > >> int err; > >> > >> + if (!cb->key) > >> + return 0; > >> + > >> for_each_set_bit(i, bitmap, PAGE_SIZE * BITS_PER_BYTE) { > >> - err = cb(key | i); > >> + err = cb->key(key | i); > > > > key(key) reads weird :) > > Can't say I have a good name, maybe key_action()? > > I thought the context of it being under a callback struct would make it > more obvious. I don't like key_action() much better TBH, but I don't > have a strong opinion. Perhaps Pasha can suggest a 3rd option and we > pick on randomly ;-) Another option I thought is to call them ->leaf() and ->node(). > > > >> if (err) > >> return err; > >> } > > -- > Regards, > Pratyush Yadav -- Sincerely yours, Mike.