From nobody Mon Feb 9 21:38:12 2026 Received: from mail-yx1-f52.google.com (mail-yx1-f52.google.com [74.125.224.52]) (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 254EE33F369 for ; Fri, 14 Nov 2025 15:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763135657; cv=none; b=hHeSJa9Ix4B/eeyCu78VV8M1SimCk5P+hRu3147JzZ9v3RxTBc3mbSBd/Uc/BUPiJxbT+O5a39QoFOnmjoY5XjTQqO10rSeZ/d6/Kwuzs20ZhdMGcoNTqp8WhkG+mEiYIg2rSdT5QyVNWDHIjJfmlL522O6Wqm6DqvH+86KcPcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763135657; c=relaxed/simple; bh=ABmu8pFYniLm7A0yQvX2RzE3jLyfoKROQuQDsi638f0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NjJKNR2Qb8z7j2eppG+A2FfRL40rF5+98+4MGf/lZ/E3Ym9D3ZLdnwJke7Yqz/1Jvj6yR4OfgR9FPzo4BN91xBWRKYOuFBn6Nc2CnNBoU2+8Wk4Vs5BHymPnFlBIeUNc/Y7h+ZB8PKaTxGUgvVCufki+//aUeMmtlozwm5a7ITk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=GvpzPS4O; arc=none smtp.client-ip=74.125.224.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="GvpzPS4O" Received: by mail-yx1-f52.google.com with SMTP id 956f58d0204a3-63bc1aeb427so1898363d50.3 for ; Fri, 14 Nov 2025 07:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1763135654; x=1763740454; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=kKhHd1KgPWmocj3LIkR2PSOdJapJ90TJO0FtGZ1fNlc=; b=GvpzPS4OllvpUazWYsYBYXKz1GFwIlxObqDh/HpRKVH8rfNalRj/q6KAQ6IXovbJIj 6lPWpAA0tgHNyoRnGErrbmLkoe0uZXEBaFTTD2mLQjPvkXHA2sVJpU1Bfn9WJuyT3QCM Ur6duXvvck9NXEiNM5x3ICktdshCebtoR2t3XtXm9KlU8YHE3VckbDXwn9+HYwIgvQRw CCVl+4P4A5uXPfUVFOdXk9VER7RpuQF0ZVVm/hUOzE75UAsDX2C4bML7MUFY3g1lRkrg 01jgKbx3VqlgZy0X5ROWN1EUHp4OYR6U6lBHMAjR+Tvdr4UQ3RQoirQBm3A97iJJgXoY ZOmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763135654; x=1763740454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=kKhHd1KgPWmocj3LIkR2PSOdJapJ90TJO0FtGZ1fNlc=; b=LRTxCr34IqppiWTMWvg/ZVnxgHyooj+BcNVBrK8TYMuPKBzRJcdBVNeSgTaxzb2k5d ihUQgC/Pys3VQHNBqtk135B0Mqtij7yjfyajsmc4Fpky/8jxw2IiG6SBaLVIp+bXE6kb mUmEoozRFceSqTDlU+xzHZ+ptzOSAJiSwzD6XdWBrX9Q59sUPVfro4yzSt0CEB2BrBGx 7vZkn/M7nV66/8ebaD38xtUk8iztevHGWEMP+LrJEevqOKSda9fvlQSDQGDQ78dZvRkE floJI4fajE4wKNk2IwJDJgdi4gs4BS6FgXsiLhClKKJY3sQGUiaX+NRDE73HGgXG9Fu7 kxYg== X-Forwarded-Encrypted: i=1; AJvYcCUxieu6okKwJFfG+74ZLfFkch2keejb4Bb6sxerWlnwWkCkUfvOvp/QoywfUZrvkK2ObhyYICFshswEu9w=@vger.kernel.org X-Gm-Message-State: AOJu0YxM4BT//+UTtqfG9OIIM8sopdXlxXzE+9OdBLW0jH28l+GScZ3Q 3YDmmljO9+3SeiTjuuB3U8vpKDRe3nSTvvISP5MUD4SPxdP2iXGTbTMQIJ7jb1HpoRU= X-Gm-Gg: ASbGncuVQ/KHzqHbSPmpVQkUTuVxU568cXAdBcRvOcw3TmyuR2mUpwtPJWTXtUKSIZy EG4rdrPsxjKiqoaUC2AsoEBUXQjPVg2Ah8lzHXk1Oio/p+M6VsQnzmsBVR1sE1UlfkC8exK/GlI H0hB6U4DKrd9IIGIIYjJFsqajelkwIcsOT1KEnBxHVDefc8rFi5ZttSZqGyZ/pp+LIyB6LTxGCS G4CwjpAK0aV8hXHSQ9oDo/HymYPDhr6EOW2GyK+Bvs8lo26HuUkt0Er+kQEhyP/+V8V6K8881B5 Y/v6wfZOSzK4Kt22IhD6mh6sT/KojQfGGRNpJ5jJDSw8EZZEByAjEHoOA3lTSi8MtMGvclxpI/2 xb5+0aae/IYmZPyLn7ov288WrVTpVCp25hLkFNi9GexqjrwJZ2Cnb4SNg/Ibbl/EPni6NoYr8Pm jIk8VV4XOo8yvd3kzDtg/iVcu8DdrAO/yQhepQDVLDjOhj8YpPicRZ3bkzriYHCb1Bo4tX X-Google-Smtp-Source: AGHT+IGiDMpoF1/OziCNFf3dCo0jW3YOO3Yc+5BO/O7YGqjVq/L6uWOIGV+2HHGmACM7asKY55998g== X-Received: by 2002:a05:690e:1508:b0:636:d4ab:a507 with SMTP id 956f58d0204a3-641e74d6eaemr2931309d50.16.1763135654039; Fri, 14 Nov 2025 07:54:14 -0800 (PST) Received: from soleen.c.googlers.com.com (182.221.85.34.bc.googleusercontent.com. [34.85.221.182]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78822125317sm16468577b3.37.2025.11.14.07.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 07:54:13 -0800 (PST) From: Pasha Tatashin To: akpm@linux-foundation.org, bhe@redhat.com, pasha.tatashin@soleen.com, rppt@kernel.org, jasonmiu@google.com, arnd@arndb.de, coxu@redhat.com, dave@vasilevsky.ca, ebiggers@google.com, graf@amazon.com, kees@kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org Subject: [PATCH v1 11/13] kho: Allow memory preservation state updates after finalization Date: Fri, 14 Nov 2025 10:53:56 -0500 Message-ID: <20251114155358.2884014-12-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.52.0.rc1.455.g30608eb744-goog In-Reply-To: <20251114155358.2884014-1-pasha.tatashin@soleen.com> References: <20251114155358.2884014-1-pasha.tatashin@soleen.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, kho_preserve_* and kho_unpreserve_* return -EBUSY if KHO is finalized. This enforces a rigid "freeze" on the KHO memory state. With the introduction of re-entrant finalization, this restriction is no longer necessary. Users should be allowed to modify the preservation set (e.g., adding new pages or freeing old ones) even after an initial finalization. The intended workflow for updates is now: 1. Modify state (preserve/unpreserve). 2. Call kho_finalize() again to refresh the serialized metadata. Remove the kho_out.finalized checks to enable this dynamic behavior. Signed-off-by: Pasha Tatashin --- kernel/liveupdate/kexec_handover.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index 27ef20565a5f..87e9b488237d 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -183,10 +183,6 @@ static int __kho_preserve_order(struct kho_mem_track *= track, unsigned long pfn, const unsigned long pfn_high =3D pfn >> order; =20 might_sleep(); - - if (kho_out.finalized) - return -EBUSY; - physxa =3D xa_load(&track->orders, order); if (!physxa) { int err; @@ -815,9 +811,6 @@ int kho_unpreserve_folio(struct folio *folio) const unsigned int order =3D folio_order(folio); struct kho_mem_track *track =3D &kho_out.track; =20 - if (kho_out.finalized) - return -EBUSY; - __kho_unpreserve_order(track, pfn, order); return 0; } @@ -885,9 +878,6 @@ int kho_unpreserve_pages(struct page *page, unsigned in= t nr_pages) const unsigned long start_pfn =3D page_to_pfn(page); const unsigned long end_pfn =3D start_pfn + nr_pages; =20 - if (kho_out.finalized) - return -EBUSY; - __kho_unpreserve(track, start_pfn, end_pfn); =20 return 0; @@ -1066,9 +1056,6 @@ EXPORT_SYMBOL_GPL(kho_preserve_vmalloc); */ int kho_unpreserve_vmalloc(struct kho_vmalloc *preservation) { - if (kho_out.finalized) - return -EBUSY; - kho_vmalloc_free_chunks(preservation); =20 return 0; --=20 2.52.0.rc1.455.g30608eb744-goog