On Sun, Jul 13, 2025 at 7:25 PM Tiwei Bie <tiwei....@linux.dev> wrote: > Here are some steps to try out SMP support in UML: > > 1. Build UML with CONFIG_SMP=y and, for example, CONFIG_NR_CPUS=8. > > 2. Launch a UML instance with, for example, 8 virtual CPUs. > > $ ./linux mem=16G ncpus=8 nohz=n seccomp=on init=/bin/sh \ > ubd0=$your_rootfs_image
That's pretty cool! The implementation looks *much* simpler than I have expected. Can you please explain a little more the details behind it? e.g. Why ptrace is not supported? Does it support true SMP (IOW SMP within the kernel)? I gave it a try on my machine and noticed that the UML process eats a lot of CPU time on the host side. Tracing showed that some (not all) CPU threads perform these syscalls over and over: rt_sigprocmask(SIG_UNBLOCK, 0xe081bdf0, NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, 0xe081bdf0, 0xe081be70, 8) = 0 timer_gettime(2, 0xe081bdd0) I'm also a bit surprised that using pthreads works for this. Traditionally UML uses it's own threading using raw clone(), so I expected some hassle.