linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] liveupdate: separate memfd support into LIVEUPDATE_MEMFD
@ 2025-12-23 20:15 Pasha Tatashin
  2025-12-29 20:51 ` Pratyush Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Pasha Tatashin @ 2025-12-23 20:15 UTC (permalink / raw)
  To: akpm, pasha.tatashin, rppt, linux-kernel, linux-mm, pratyush

Decouple memfd preservation support from the core Live Update
Orchestrator configuration.

Previously, enabling CONFIG_LIVEUPDATE forced a dependency on
CONFIG_SHMEM and unconditionally compiled memfd_luo.o. However, Live
Update may be used for purposes that do not require memfd-backed memory
preservation.

Introduce CONFIG_LIVEUPDATE_MEMFD to gate memfd_luo.o. This moves the
SHMEM and MEMFD_CREATE dependencies to the specific feature that needs
them, allowing the base LIVEUPDATE option to be selected independently
of shared memory support.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
 kernel/liveupdate/Kconfig | 16 +++++++++++++++-
 mm/Makefile               |  2 +-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/kernel/liveupdate/Kconfig b/kernel/liveupdate/Kconfig
index d2aeaf13c3ac..9a1a8cdcf16c 100644
--- a/kernel/liveupdate/Kconfig
+++ b/kernel/liveupdate/Kconfig
@@ -54,7 +54,6 @@ config KEXEC_HANDOVER_ENABLE_DEFAULT
 config LIVEUPDATE
 	bool "Live Update Orchestrator"
 	depends on KEXEC_HANDOVER
-	depends on SHMEM
 	help
 	  Enable the Live Update Orchestrator. Live Update is a mechanism,
 	  typically based on kexec, that allows the kernel to be updated
@@ -73,4 +72,19 @@ config LIVEUPDATE
 
 	  If unsure, say N.
 
+config LIVEUPDATE_MEMFD
+	bool "Live update support for memfd"
+	depends on LIVEUPDATE
+	depends on MEMFD_CREATE
+	depends on SHMEM
+	help
+	  Enable live update support for memfd regions. This allows preserving
+	  memfd-backed memory across kernel live updates.
+
+	  This can be used to back VM memory with memfds, allowing the guest
+	  memory to persist, or for other user workloads needing to preserve
+	  pages.
+
+	  If unsure, say N.
+
 endmenu
diff --git a/mm/Makefile b/mm/Makefile
index 9175f8cc6565..798f04233d71 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -100,7 +100,7 @@ obj-$(CONFIG_NUMA) += memory-tiers.o
 obj-$(CONFIG_DEVICE_MIGRATION) += migrate_device.o
 obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o khugepaged.o
 obj-$(CONFIG_PAGE_COUNTER) += page_counter.o
-obj-$(CONFIG_LIVEUPDATE) += memfd_luo.o
+obj-$(CONFIG_LIVEUPDATE_MEMFD) += memfd_luo.o
 obj-$(CONFIG_MEMCG_V1) += memcontrol-v1.o
 obj-$(CONFIG_MEMCG) += memcontrol.o vmpressure.o
 ifdef CONFIG_SWAP

base-commit: cc3aa43b44bdb43dfbac0fcb51c56594a11338a8
-- 
2.52.0.351.gbe84eed79e-goog



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] liveupdate: separate memfd support into LIVEUPDATE_MEMFD
  2025-12-23 20:15 [PATCH v1] liveupdate: separate memfd support into LIVEUPDATE_MEMFD Pasha Tatashin
@ 2025-12-29 20:51 ` Pratyush Yadav
  2025-12-30 14:54   ` Pasha Tatashin
  0 siblings, 1 reply; 3+ messages in thread
From: Pratyush Yadav @ 2025-12-29 20:51 UTC (permalink / raw)
  To: Pasha Tatashin; +Cc: akpm, rppt, linux-kernel, linux-mm, pratyush

Hi Pasha,

On Tue, Dec 23 2025, Pasha Tatashin wrote:

> Decouple memfd preservation support from the core Live Update
> Orchestrator configuration.
>
> Previously, enabling CONFIG_LIVEUPDATE forced a dependency on
> CONFIG_SHMEM and unconditionally compiled memfd_luo.o. However, Live
> Update may be used for purposes that do not require memfd-backed memory
> preservation.

I initially didn't add a new config mainly because there was no other
user of LUO. So disabling LIVEUPDATE_MEMFD makes LUO entirely useless.

Anyway, we will eventually get other subsystems and this config will
start making sense then. Might as well do it now.

>
> Introduce CONFIG_LIVEUPDATE_MEMFD to gate memfd_luo.o. This moves the
> SHMEM and MEMFD_CREATE dependencies to the specific feature that needs
> them, allowing the base LIVEUPDATE option to be selected independently
> of shared memory support.
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
> ---
>  kernel/liveupdate/Kconfig | 16 +++++++++++++++-
>  mm/Makefile               |  2 +-

I think you should also update tools/testing/selftests/liveupdate/config
to enable this config.

With that,

Reviewed-by: Pratyush Yadav <pratyush@kernel.org>

>  2 files changed, 16 insertions(+), 2 deletions(-)
>
[...]

-- 
Regards,
Pratyush Yadav


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] liveupdate: separate memfd support into LIVEUPDATE_MEMFD
  2025-12-29 20:51 ` Pratyush Yadav
@ 2025-12-30 14:54   ` Pasha Tatashin
  0 siblings, 0 replies; 3+ messages in thread
From: Pasha Tatashin @ 2025-12-30 14:54 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: akpm, rppt, linux-kernel, linux-mm

On Mon, Dec 29, 2025 at 3:52 PM Pratyush Yadav <pratyush@kernel.org> wrote:
>
> Hi Pasha,
>
> On Tue, Dec 23 2025, Pasha Tatashin wrote:
>
> > Decouple memfd preservation support from the core Live Update
> > Orchestrator configuration.
> >
> > Previously, enabling CONFIG_LIVEUPDATE forced a dependency on
> > CONFIG_SHMEM and unconditionally compiled memfd_luo.o. However, Live
> > Update may be used for purposes that do not require memfd-backed memory
> > preservation.
>
> I initially didn't add a new config mainly because there was no other
> user of LUO. So disabling LIVEUPDATE_MEMFD makes LUO entirely useless.
>
> Anyway, we will eventually get other subsystems and this config will
> start making sense then. Might as well do it now.
>
> >
> > Introduce CONFIG_LIVEUPDATE_MEMFD to gate memfd_luo.o. This moves the
> > SHMEM and MEMFD_CREATE dependencies to the specific feature that needs
> > them, allowing the base LIVEUPDATE option to be selected independently
> > of shared memory support.
> >
> > Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
> > ---
> >  kernel/liveupdate/Kconfig | 16 +++++++++++++++-
> >  mm/Makefile               |  2 +-
>
> I think you should also update tools/testing/selftests/liveupdate/config
> to enable this config.

Done

>
> With that,
>
> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>

Thanks.

Pasha


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-30 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-23 20:15 [PATCH v1] liveupdate: separate memfd support into LIVEUPDATE_MEMFD Pasha Tatashin
2025-12-29 20:51 ` Pratyush Yadav
2025-12-30 14:54   ` Pasha Tatashin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox