From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDC6723A9BD for ; Tue, 17 Mar 2026 14:15:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773756944; cv=none; b=bjp9NPN7i1b4g5uFHxxYF4rYkxGxfvAdiewoaSuj7oTZEhv8BsaTqH+yArkPMSOoBl9g49JVXzZ0GV9A2bh6yVlIvLolAAwYc/zFYbKgjYZgvDEEFzS15OQ9+YSWqttnuXgVRMwOZD3eDzFWM1kx1s0bgeQKiaZVIvzHDAApN8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773756944; c=relaxed/simple; bh=Jx2gsqQG6ImyUMH2d71fBghxpYZ3hqSRbvB8Mm+s+T8=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=DhgU4KJCki7LyC8oMf5ejV006Z/vvfJO+zH38lrHs9+WZCeHUb7iqMFrivrkfut4WT+aWLlCk6Q/8ZP05K9niAiJ/BVthoz43wIqIADtkGZbL/CrExQx2r7voeKwFSsej2VVfP1ARJjksW+tAvJ/2XVVG0iHMyDRUrYWwTD8/os= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--mclapinski.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=feLKoaC0; arc=none smtp.client-ip=209.85.208.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--mclapinski.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="feLKoaC0" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-661ad73d41eso7789006a12.0 for ; Tue, 17 Mar 2026 07:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773756941; x=1774361741; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Lm1/04AucX09o7Vc1s8OzOzNp6FWCOos1z+TBuLIodY=; b=feLKoaC0ivuOQNG4j8iQ4qLfBz9x23DzkfD5PAw7MMxzl3yXFsl3ALDsmE3/Ei6mHK H2v7LKJ2TCtXEK+xGXyLKkcKx0RrQgURTQlcX0LFj6vcMDxCD7gZfxDHCqKewSc+3J4y h2HY/BmaiZt0xEGifP4ArS0Am/8bkkaDAf5FjoXrudzlQU4SkGogMf+QFI6AT8ObRAc0 fm4AEmNi4HdSSCjpqUpt9KZU+fb57E1oc5M7F/4dkVarzTnAz5I4HDpWaZEVzAE/Z0JI h4PREga2HoHJ3rV3e+ZveIsFdSmi5O1qXSZF1AD9cesKU9o+Ao2QQTiNSR+92eW6/bJA FCYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773756941; x=1774361741; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Lm1/04AucX09o7Vc1s8OzOzNp6FWCOos1z+TBuLIodY=; b=HhDTmpQBL10ZUdPPljAkjfHswlPs3ZRaY+eG4XUDULmIF/iea3GDhK0oHzJ2eDKG0s CE9lrE7Lt0lgtVQBSt+qzsFxMqnmGfPlLXVtiGOfDaVIAeme7KW34RQ2kkIR5DeualMc e5XQZmwKJo4YRScSp5BXW0uvx0GOjAMqljWaT13RipqMzoRxY3E61PXIsVf8wu4KEaA2 xIc2wjg2bP8ZoSwNYEqBXDJiwhn7e0VcRcNDzKESzDT7HuqppRTrzvBFiMTn4FMLJnT9 C24Far6o4zERxvHwQoaeEYLjTuLrtjYG9x19H/CShjKT82OguXFhxxehVObSk0AExXOZ p7qQ== X-Gm-Message-State: AOJu0YwzED1a9PJXzkeetdEwJYRRCf8iTK8JmItPqm+eOGNzmrokqMjn USj7S2rM62GHqjXFX4CM1C/FhyRXH5I26NpFRfHMgH5AlMpQ04YbmDCaVJ18941M9ZebTmVofEV UM/NdN2Uq6nFMGSItVz/vWQ== X-Received: from edya2.prod.google.com ([2002:aa7:cf02:0:b0:667:8c6d:ee30]) (user=mclapinski job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:2809:b0:662:f12c:257b with SMTP id 4fb4d7f45d1cf-663babc560emr10556033a12.12.1773756940594; Tue, 17 Mar 2026 07:15:40 -0700 (PDT) Date: Tue, 17 Mar 2026 15:15:31 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.53.0.851.ga537e3e6e9-goog Message-ID: <20260317141534.815634-1-mclapinski@google.com> Subject: [PATCH v7 0/3] kho: add support for deferred struct page init From: Michal Clapinski To: Evangelos Petrongonas , Pasha Tatashin , Mike Rapoport , Pratyush Yadav , Alexander Graf , Samiullah Khawaja , kexec@lists.infradead.org, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Andrew Morton , Michal Clapinski Content-Type: text/plain; charset="UTF-8" When CONFIG_DEFERRED_STRUCT_PAGE_INIT (hereinafter DEFERRED) is enabled, struct page initialization is deferred to parallel kthreads that run later in the boot process. Currently, KHO is incompatible with DEFERRED. This series fixes that incompatibility. --- v7: - reimplemented the initialization of kho scratch again v6: - reimplemented the initialization of kho scratch v5: - rebased v4: - added a new commit to fix deferred init of kho scratch - switched to ulong when refering to pfn v3: - changed commit msg - don't invoke early_pfn_to_nid if CONFIG_DEFERRED_STRUCT_PAGE_INIT=n v2: - updated a comment I took Evangelos's test code: https://git.infradead.org/?p=users/vpetrog/linux.git;a=shortlog;h=refs/heads/kho-deferred-struct-page-init and then modified it to this monster test that does 2 allocations: at core_initcall (early) and at module_init (late). Then kexec, then 2 more allocations at these points, then restore the original 2, then kexec, then restore the other 2. Basically I test preservation of early and late allocation both on cold and on warm boot. Tested it both with and without DEFERRED. Evangelos Petrongonas (1): kho: make preserved pages compatible with deferred struct page init Michal Clapinski (2): kho: make kho_scratch_overlap usable outside debugging kho: fix deferred init of kho scratch include/linux/kexec_handover.h | 6 ++ include/linux/memblock.h | 2 - kernel/liveupdate/Kconfig | 2 - kernel/liveupdate/Makefile | 1 - kernel/liveupdate/kexec_handover.c | 65 ++++++++++++++++++--- kernel/liveupdate/kexec_handover_debug.c | 25 -------- kernel/liveupdate/kexec_handover_internal.h | 7 ++- mm/memblock.c | 22 ------- mm/page_alloc.c | 7 +++ 9 files changed, 74 insertions(+), 63 deletions(-) delete mode 100644 kernel/liveupdate/kexec_handover_debug.c -- 2.53.0.851.ga537e3e6e9-goog