From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) (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 0BDDA3A6B79 for ; Thu, 16 Apr 2026 11:07:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776337623; cv=none; b=m1uLNFz/gSgHFEI4mWDQ53s0+oVE5T5HiJDxczzRAGNBsIJSF2dgaTjlg8QhINfNUlRgyme/JzVt1Q09rJavlSBH3FpLnLhlFdqxe5o+sK93+vCU6FxtqJnGToOm+emVbB3zYYduGRjweCxAlatKRjVbzxlDXOAM+Lz35/6PiHc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776337623; c=relaxed/simple; bh=OuuUfooQeUaQSA1DXx6P2XKiqbpRB+KyHmtRmXQdS3o=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=m8c9E2nXHOVguPLj//T/zeq0kCeMIpgi8QMR6KGAhfhZfjbhFx34GHc+IFR3jYD+9EbHLdLa7s9CQNZhLED2CE4CyJTOCnw4JXNuTWLE9PDzhXAZXzZDK9p3QF9r+xoZIQUvzp9mrxkcVWepHJ9SmhvHMOV+sywJ9swV5g5RFbw= 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=IQF6n5yY; arc=none smtp.client-ip=209.85.208.73 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="IQF6n5yY" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-6716a705fc2so4520092a12.3 for ; Thu, 16 Apr 2026 04:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776337620; x=1776942420; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=lKHwSeRo/ultSF+DvjG6BVyCb2GmqVTT5wmkO/QWglI=; b=IQF6n5yYI8jo2kgNphkCWC3rLlknPPhvnHEN0H0RE4eKQJR0y354kVLdx01Upf56/x CLkPZ9xohHJI7CewED0ifIJxt5FBwCqnLoc22lfjCU2fbIG8ZdH7XNKqo/t20tReosix UOxKlobFpw1/O1Z+lss0iYppJNX/lJ1haLnfjy4PPfyZqJvR+9W6zkXwaADjCcvBPiZV sxUa0QPIKy+BX0f3yR0haOIpTG/N1F/ou6XeWGyhb1PM1oU2P4Crw/sTVd8+iEUmm8VL WDXEyZJyi3T2heSn0F2OoSdf88GREyqfgP5PMMKjviudax5tpqNxSeYxUOlIg+34KnQC OzSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776337620; x=1776942420; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lKHwSeRo/ultSF+DvjG6BVyCb2GmqVTT5wmkO/QWglI=; b=oyEWF3k31NEASqhBI8t7Oc8YTNFRDscu1MuI1GeoclYrwih0g51KUz4KXFig8nOmon Th1kYfVXL2RSwlzgDcHYPtAFcSLMCoTcfVrWFBLv2sdhvKZf6XClFZ4e5bji1QfkMNEn E3yxjz2yaZyBbVsnFgM5QMq6ne2OCbt1s2Z1XvSYi8R1QVWDVDSAmZWNpZR6PFYT0dbG azsNg2JghLorC+8zP1+iD/cXBq5khX0+9xbDMzwBySrLR/Oedv5CdXGJHR9rAXCrHKne ZOgnCgl07xi48zswqDvbT7cHX7wsUpfop8uwIpesBbsQjwfvBPG8nGMAchn50oAK41sB pSnw== X-Gm-Message-State: AOJu0YzN+pFknasGipqAEfSdikQDrK1OVtHgD5mSHfjCzE+JRw5h2mkR iGwX3wIIZ5cDpAR9hDcFPP2c3TVStTor6gYfT610/qaPmcNQuA48BE8aNcEfdubZLdH/ldoY9tW fO0E1K3zSbZhb2TLJ+8f60w== X-Received: from educ13.prod.google.com ([2002:a05:6402:100d:b0:66e:cdad:9d95]) (user=mclapinski job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:2b99:b0:671:bc46:1b93 with SMTP id 4fb4d7f45d1cf-671bc461f4dmr6398522a12.18.1776337620197; Thu, 16 Apr 2026 04:07:00 -0700 (PDT) Date: Thu, 16 Apr 2026 13:06:52 +0200 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.54.0.rc1.555.g9c883467ad-goog Message-ID: <20260416110654.247398-1-mclapinski@google.com> Subject: [PATCH v8 0/2] 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 , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Michal Clapinski Content-Type: text/plain; charset="UTF-8" When CONFIG_DEFERRED_STRUCT_PAGE_INIT 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. --- v8: - moved overriding the migratetype from init_pageblock_migratetype to callsites 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. This patch probably doesn't apply onto anything currently. It's based on mm-new with "memblock: move reserve_bootmem_range() to memblock.c and make it static" cherrypicked from rppt/memblock. Evangelos Petrongonas (1): kho: make preserved pages compatible with deferred struct page init Michal Clapinski (1): kho: fix deferred initialization of scratch areas include/linux/memblock.h | 7 ++-- kernel/liveupdate/Kconfig | 2 -- kernel/liveupdate/kexec_handover.c | 52 +++++++++++++++--------------- mm/memblock.c | 41 +++++++++++------------ mm/mm_init.c | 27 +++++++++++----- 5 files changed, 69 insertions(+), 60 deletions(-) -- 2.54.0.rc1.555.g9c883467ad-goog