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 8AA893845CD for ; Thu, 23 Apr 2026 12:25:44 +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=1776947146; cv=none; b=A1EGEcup53eF4SXhLquGLRLjWo+CMf71gWaq4GaqiRM44rHhwLPc3yGKfL5N5PXX+d5M1f2kKExNioPCfFS6Myw2Bfz4LXvKiWBJsOK/98DyEqFtPfEwHhQJdFWikuDgZRvifzB3jYtYZC0cDa3QdMReQ14XW+qoGEX70jlGK0o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776947146; c=relaxed/simple; bh=WZMxFTBr4NZimeUV/R117oNkOE8BKCnyM+81qGhlU90=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=Aaw7AUNNAfz1z7VrXDvKcHb6f0Cj8aQdU97QizpmtXJf/Vh+LpCZHohj2l41dUgNHvmabcG9mgrbKzHlAyA6/u3A/PcNfDf/DwndIZG+jousKbSl8FxKiXcIMMCr+/7SNC6QXaFBSif8AsJDYRnAL0CHI2j6Ue3WMBb4bDeOcXs= 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=BU23tdQJ; 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="BU23tdQJ" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-66ed15cab53so7172877a12.1 for ; Thu, 23 Apr 2026 05:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776947143; x=1777551943; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Fi9xSgYpoZ/qpCfid0/vii4Xij6h2WhXpELMzsBfSVU=; b=BU23tdQJCgYSLQJyUuPdfygKf5H4AfoS+VuzwJxHMDeKRt3i1xPe5i1XGd/96xYp5I k9PrNG9GtnIUcQeaB328VfCq4h2Lk2gdN9vOuR4boY3EBRj7HGbZk/j62fN8bT5nlMOF s/oyU0eJtNDio6mjtDzkzXzsj8NWuvWUZz0C0A0nJxjb6tsDFh7QRAcLO7drQipTyfpS DVSTK52Eqts48kT/PcVVjJrck+DtbQBIK74Zd4cjXC2b+CfO2W5Ypjp2XuKwpS2WOFSA Xlu4CijrHHYJ+TwujLQwFivZqUnpBUdNvJB/AJTm4llfpLAZRExRayJnzoj4OA1HpLj9 PGGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776947143; x=1777551943; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Fi9xSgYpoZ/qpCfid0/vii4Xij6h2WhXpELMzsBfSVU=; b=XuWmFncx9kWaVpjGidRd49w2qi9lBDaQO/9PYeL9WHMI1o5BAp1wtVT2et4CWNaBGq 4YVFRWtQIKl61pE4hxH7sDZOejhbUTLTeVDi8AWL7xTkKUuN/NAlrQOeSrcJKdhTJYNY zaGFVWPqvbLyuPiydmE2jgTCLLCf0NznCgA09UeWmeXnVmkUNJNbH5SxhMNyGj2hLcGm DZdSfEjxlCsaPrYjRJuzRloSOu/DUnolRnynlqC9gI3meNy7qRZOr93TDkFKi5ngCz+W g64vHLG9Y+G2SIwQkLgaM3FkKule3ZRaX9QI8l5gXNKKClY2lPHjaRN05ecnwXbttpMU xQJQ== X-Gm-Message-State: AOJu0YwNSQCjT7+EIlfUCqLoU+ErYuibeWwgtVxzno9sVc0LQ+6Tmj6I uXj3rPM9ynciEQqyLTCa71s2YNRinIQuhH2hBZdwi3SIJICsihODp4CkG80mAcDknAUslGD9V1+ +NnExE2Amli6jSGSnRgZBdg== X-Received: from edev7-n1.prod.google.com ([2002:a05:6402:a2c7:10b0:676:9c94:9878]) (user=mclapinski job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:1f01:b0:674:37b7:227c with SMTP id 4fb4d7f45d1cf-67437b722e4mr9379117a12.2.1776947142685; Thu, 23 Apr 2026 05:25:42 -0700 (PDT) Date: Thu, 23 Apr 2026 14:25:35 +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.rc2.533.g4f5dca5207-goog Message-ID: <20260423122538.140993-1-mclapinski@google.com> Subject: [PATCH v9 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 , 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. --- v9: - moved init_pageblock_migratetype from memmap_init_reserved_range to __init_page_from_nid - reduced number of ifdefs - new commit to test this feature 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. https://github.com/mclapinski/linux/commits/deferred_test/ 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 (2): kho: fix deferred initialization of scratch areas selftests: kho: test with deferred struct page init include/linux/memblock.h | 21 +++++++++- kernel/liveupdate/Kconfig | 2 - kernel/liveupdate/kexec_handover.c | 52 ++++++++++++------------- mm/memblock.c | 56 +++++++++++---------------- mm/mm_init.c | 30 +++++++------- tools/testing/selftests/kho/vmtest.sh | 4 ++ 6 files changed, 88 insertions(+), 77 deletions(-) -- 2.54.0.rc2.533.g4f5dca5207-goog