|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v13 04/14] xen/percpu: defer freeing per-CPU areas after resume failures
On Mon, Nov 16, 2026 at 5:58 PM Jan Beulich <jbeulich@xxxxxxxx> wrote: > > On 16.11.2026 16:15, Mykola Kvach wrote: > > Hi Jan, > > > > Thank you for the review. > > > > On Tue, Nov 10, 2026 at 1:03 PM Jan Beulich <jbeulich@xxxxxxxx> wrote: > >> > >> On 27.10.2026 22:05, Mykola Kvach wrote: > >>> When a CPU fails to come back during system resume, cpu_up() sends > >>> CPU_UP_CANCELED. After trying the other CPUs, enable_nonboot_cpus() > >>> sends CPU_RESUME_FAILED for the same CPU. > >>> > >>> On architectures which do not park offline CPUs, both notifications > >>> queue free_percpu_area(). The release metadata, including the rcu_head, > >>> is stored in that CPU's per-CPU area. The first callback may already > >>> have freed the area when the second notification arrives, or the same > >>> rcu_head may be queued twice. The CPU_RESUME_FAILED callbacks also need > >>> the area to clean up timers and CPU-pool state. > >> > >> I think there's another change needed, for the change you presently do > >> to not cause a leak: If enable_nonboot_cpus() calls cpu_up() for a CPU > >> whose bit isn't set in frozen_cpus, and if that call fails, the CPU > >> later wouldn't have the CPU_RESUME_FAILED notification sent for it. > >> IOW the freeing would then not happen at all. Question is whether > >> simply setting the bit in frozen_cpus would be correct: Notify > >> handlers may not expect CPU_RESUME_FAILED for a CPU which wasn't > >> online at the point of suspend. > > > > CPUs outside frozen_cpus are only tried when park_offline_cpus is true. > > In that case, the existing !park_offline_cpus check already prevents > > freeing their per-CPU areas. > > > > When park_offline_cpus is false, CPUs outside frozen_cpus are skipped. > > A failed cpu_up() leaves the bit set, so CPU_RESUME_FAILED is sent. > > > > Am I missing a case where this patch would introduce a leak? > > No, you're right. What I'd like to ask for is an adjustment to the last > sentence of the description: "does not take this release path" is > ambiguous, because the notifiers are the same everywhere. What's skipped > (for both of the notifier codes of interest here) is the call to > free_percpu_area(). I'd appreciate if you could disambiguate that. Thanks, I'll clarify that in v14: x86 skips the call to free_percpu_area() for both notifications. Best regards, Mykola
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |