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 7C57B313267 for ; Tue, 12 May 2026 09:11:23 +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=1778577083; cv=none; b=Z/siQ6LSXXVnv9OfoEneof+ewiDgFrDg8U7JU31WfzcFG6ku1IA/LE4GbIajhQ3Inn8JqyhIAGHpKyOq4/2MA7UtxGuD2lHlGi2ZlbvAN4ccE8uwQRoymY3PA/moG2/lHeyY8i8kjDtDf5wzMUjye+d4hWerC1AL9BwSFZmOupg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778577083; c=relaxed/simple; bh=4hEM1RL8Q3Ecwa5JN6pAuey/y8Z41JPI8moNXj27aEA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=nXJL2NPokmFPHuFMNaxLs3msEEJvPqqycuPfzkRc7uapaBQUm24cIP0EFbgEOAZN286RQt3+Zgdqft1RwiGaEErTuQbBr0X1rZ899mz8iUnzCE3LeCRP5JPyUipFEwEKSs3Wl/ARmaTroiORAmtnYp+OhC5bFS2oCkrS4z6K3r4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZxKzUQIV; 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="ZxKzUQIV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C522C2BCB0; Tue, 12 May 2026 09:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778577083; bh=4hEM1RL8Q3Ecwa5JN6pAuey/y8Z41JPI8moNXj27aEA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ZxKzUQIVFSSFvPwUMy6zzHWK6v1yyQI1+b+4Ay92xGyuOyc3XqxunISgVEJQvaKA4 Oy6Y4eYSvs12RXLwsN5+5j2dyT3SSF8wxviUh2MORKlbFblWTILDTl1PCORmQaP06Q fU8HEyQsgxqkQofnobPNrM08cCp5h37FBzg9Z9I1runT4dowCTEgpr6xHhuSzAyqyq 2VVUZViPyuAV3PeanymbGtGgDbVoYgo0LUdtA7a8UPQU3yRu12L5C2ECT/vLUUTrHZ vfSQiIi8AA8b12fYfn4+jW9dhw4wTBUFR8YeIfkTpKI3WHYIzOwaisWWs6FJSohkH8 M4kZPjXQkZ1Fw== From: Pratyush Yadav To: Mike Rapoport Cc: Pratyush Yadav , 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 In-Reply-To: (Mike Rapoport's message of "Tue, 12 May 2026 09:48:48 +0300") References: <20260429133928.850721-1-pratyush@kernel.org> <20260429133928.850721-4-pratyush@kernel.org> <2vxzzf25c39x.fsf@kernel.org> Date: Tue, 12 May 2026 11:11:19 +0200 Message-ID: <2vxz5x4tat6w.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, May 12 2026, Mike Rapoport wrote: > 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(). This one sounds nice. Will use it in v2. -- Regards, Pratyush Yadav