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 9B24033F5BA for ; Mon, 11 May 2026 16:36: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=1778517416; cv=none; b=RCcp02MXneYRjamkBtGLdpdgwWYbZJr6hjcQyC74JdraO53WyAmTfdDPg7+x78Dx4biHsUrRUtAfANkX4eNGZNUAUqtc3nFpbFuXKSVKl1f6z/Gwv8u5FPNBIRTzBP5ZYaYcfVkRHPlnXiO+uXfUlw743kkkl0yGwluYIQqvP0U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778517416; c=relaxed/simple; bh=liPuemz24Vdu+80R1AYC85Gv4AyR8Vh8AkBScYnpciU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=JsB6avEOqitnqnAUnzW0vYvXgjAOQjA8DVgauqJ2wUspoKsEK0vX6lykQJNBWvFBjGazfe4mYxUcPWhRkEltZbCYaiZdtYKTLYyGkr3jsndHMfJFfnr1wXQiLZOpMY0+hz/JdAuiFoVTXYmBOo6NE06uH7xyJNIWCKkPQIf4DPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CssK/dWw; 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="CssK/dWw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8450FC2BCB0; Mon, 11 May 2026 16:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778517416; bh=liPuemz24Vdu+80R1AYC85Gv4AyR8Vh8AkBScYnpciU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CssK/dWwTimpC0aZZ9E7Ph0ahQ4YbAFQmTr+YCk9pB9grCLntPdvXVjuNkuHr4eWP kR/KsrpwUC6c2NGFnw06WCYjYSN9MbkO8PRMIUtxb/KeC16cpNOdpHUdmiJsgC2TKj K5LnaPhVF03y5S+x9JVfvBfBRXe9v4MtnZ41QwPJHTRNprNhXO5kY42pmXe0xJH7pa l9bYGB0mzmZ1/dghLPz+7xXoNaFB9ZjK+csJnvKcKectbSoX9wYAGtTfT3oi9IALsq x3jfpQetglC0Pdf+KR1MfbCZFvcN4v1rcQTGlaR46UBaeYH+BlTizT8xCAE9nExguH pCdkBTN8HLh4A== 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 04/12] kho: add callback for table pages In-Reply-To: (Mike Rapoport's message of "Mon, 11 May 2026 14:50:06 +0300") References: <20260429133928.850721-1-pratyush@kernel.org> <20260429133928.850721-5-pratyush@kernel.org> Date: Mon, 11 May 2026 18:36:53 +0200 Message-ID: <2vxzv7ctc38a.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 Mon, May 11 2026, Mike Rapoport wrote: > On Wed, Apr 29, 2026 at 03:39:06PM +0200, Pratyush Yadav wrote: >> From: "Pratyush Yadav (Google)" >> >> The KHO memory preservation radix tree does not mark the table pages >> themselves as scratch. This is done to avoid a circular dependency where >> preserving a page can lead of allocating other preserved pages. This >> means any walker looking for free ranges of memory outside of scratch >> areas will ignore the table >> >> Add a table callback that is invoked for each table page. The callback > > A sentence why a table callback helps would be nice here :) The main reason is that a later patch will create a radix tree for short use and will need to destroy it afterwards. Will add that here. > >> is given the physical address of the table page. >> >> Signed-off-by: Pratyush Yadav (Google) >> --- >> include/linux/kho_radix_tree.h | 3 +++ >> kernel/liveupdate/kexec_handover.c | 12 ++++++++++++ >> 2 files changed, 15 insertions(+) >> >> diff --git a/include/linux/kho_radix_tree.h b/include/linux/kho_radix_tree.h >> index 030da6399d28..fe7151d89361 100644 >> --- a/include/linux/kho_radix_tree.h >> +++ b/include/linux/kho_radix_tree.h >> @@ -37,12 +37,15 @@ struct kho_radix_tree { >> /** >> * struct kho_radix_walk_cb - Callbacks for KHO radix tree walk. >> * @key: Called on each present key in the radix tree. >> + * @table: Called on each table of the radix tree itself. Receives the >> + * physical address of the page containing the table. >> * >> * For each callback, a return value of 0 continues the walk and a non-zero >> * return value is directly returned to the caller. >> */ >> struct kho_radix_walk_cb { >> int (*key)(unsigned long key); >> + int (*table)(phys_addr_t phys); > > Naming is hard ;-) Yes :-/ > >> }; >> -- Regards, Pratyush Yadav