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 99F13280338 for ; Wed, 11 Mar 2026 12:55:50 +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=1773233752; cv=none; b=XyO5yodgpK2JBPvG2Rt9CwnD7zUlJTa70fsQneyw5BuW6sE7j9DyDH4JdIRMW2tDeG55Mvlsh0Gyg60pX1+wi9iEj8ZGtvuEpT8N3zoR0PHN5/0aW0Yf0xnA/7HHY0LpO5jHjFBSMbwG4gstYO8AoDUvdzqplCi3Opj7zTXR7cA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773233752; c=relaxed/simple; bh=eBDeMtbDsUx+cJZ/bHD/K14zx2B7zvRJejjDmc3wZ9Y=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=CdGnmMCdJJzOww+Dt3ZSEv41Ef/q+l3A9YlA9e1gHpcp0G9OBhA9VogpS/VHpvLVxz/mVNIfWC/jmOIChCKpg20oddcM1e7sLjuPxaSM4tmRcJ0wNFHdXrR233ghw/lCOIXqatidM/48seljBJec9sicdlia1NT8KNRGZx3g18Q= 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=lH09WD7Q; 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="lH09WD7Q" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-66326bcb376so475358a12.2 for ; Wed, 11 Mar 2026 05:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773233749; x=1773838549; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=2Y9gskyCpeZiaybJRnS79bVzWhSmmn3pZfV0wtEdZDk=; b=lH09WD7QbxT+630ioIO56P5YqyQxEJocpfUJYfvJqMn3XGvPfDfh8ZKCAXBoWjLffr s7F2kAeMlkC8em9JpStSuZxGtPIEDoe/cHG7j/XEDYnBT9+J27SwiQoymnjMrMnR4zSZ 6LkZdRJPGieLSo9sXf46Cyjr29Vyb2IiVUsxZnkG4CUTtHdPhCJUyUxYDtC4mf4TzNmT m4M4tDwrWWkbU4lk+zpxPfIHx55RroWniC5CXfybz0n0VhxiSxouVHUiqO0T85xfc6ad AtVEZJ8lG95qCuqUOsRNSNXtXAVJn5st0cazvrH2yUx+s+h/KLOfTkjt9A05J4DL0ri4 m7xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773233749; x=1773838549; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2Y9gskyCpeZiaybJRnS79bVzWhSmmn3pZfV0wtEdZDk=; b=kR1ceB00/UoONqoibprSpmf8WTJybBdlfNL6mBcFXRdYYhMdQWcCLt0WoF3591VKTx FLL3WGrkUJAAxBFxC+kSTUw2P0K289Elt5FWJOR15hAkOAUQE9ZqkaADRPOurDkIRH2e fREkFzYg84Gifq0Fa+6D9hE5p0QGgUEmpJCroUN7cT7MQGV4afpYf78RzYHTPRIYZRZC YdHRLQeeA1ZkFZu3BxyIhyl6s3TiGd756zJfST9J7XFbFE7ysP+8d4AXEsHaxIWNCBF1 pzl+uEBbnC9sQnQIU98cg07uL5H3BJgs2FBbYoPf96b6BZkRLwtbVkg0f7aSmRPHVTtl HaGQ== X-Gm-Message-State: AOJu0YxH8/HoK4Y4ZO4gTmQowbc1IpYN5CPGPMwywt/63XPfjW0sx1XX GvwNRA6G8JJzfQwg/Lcz5JU4VMNdW1CXQFFThBp1taEQ9SNBlOXB6EKiA09t0LoQ302Co3vOZ40 2tbuzoxJ+PNAGylzynCjhQQ== X-Received: from ejpi2.prod.google.com ([2002:a17:906:4442:b0:b93:57db:4eba]) (user=mclapinski job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:f495:b0:b93:62dd:a4a4 with SMTP id a640c23a62f3a-b972e6a5b85mr118824966b.51.1773233748733; Wed, 11 Mar 2026 05:55:48 -0700 (PDT) Date: Wed, 11 Mar 2026 13:55:37 +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.473.g4a7958ca14-goog Message-ID: <20260311125539.4123672-1-mclapinski@google.com> Subject: [PATCH v6 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 , 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. --- 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 (1): kho: fix deferred init of kho scratch include/linux/kexec_handover.h | 6 +++ include/linux/memblock.h | 2 - kernel/liveupdate/Kconfig | 2 - kernel/liveupdate/kexec_handover.c | 62 +++++++++++++++++++++++++++++- mm/memblock.c | 22 ----------- mm/mm_init.c | 17 +++++--- 6 files changed, 78 insertions(+), 33 deletions(-) -- 2.53.0.473.g4a7958ca14-goog