[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v14 04/15] xen/percpu: defer freeing per-CPU areas after resume failures
- To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Mykola Kvach <Mykola_Kvach@xxxxxxxx>
- From: Jürgen Groß <jgross@xxxxxxxx>
- Date: Thu, 19 Nov 2026 12:31:43 +0100
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
- Autocrypt: addr=jgross@xxxxxxxx; keydata= xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Thu, 19 Nov 2026 11:31:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 18.11.26 02:51, Volodymyr Babchuk wrote:
Hi,
CC'ed Juergen, because I have a question about cpupools.
Mykola Kvach <Mykola_Kvach@xxxxxxxx> writes:
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 don't see why CPU_RESUME_FAILED would free percpu data twice.
Even CPU_UP_CANCELED during resuming shouldn't cause a free of percpu
data.
When CPU_RESUME_FAILED is signaled, system_state should still be
SYS_STATE_suspend. Or am I overlooking something here?
A bit convoluted. As I see, problem is caused by the fact
CPU_UP_CANCELED is a terminal state in a "simple" CPU up sequence, but
is a transient state in a system resume sequence. As such, theoretically
other per_cpu callbacks might have a similar issue when they don't
expect one more "CPU state is bad" callback. I can see that
common/timer.c also tries to handle both callbacks as terminal
ones. Probably, you need a similar fix there as well.
Actually, I am not sure why do we need CPU_RESUME_FAILED in the first
place. As I can see, only cpupool handles it in a sensible way. Which
begs a question: why cpupool can't call cpupool_cpu_remove_forced() on
CPU_UP_CANCELED instead?
The difference is for the case of parked cpus: CPU_UP_CANCELED might be
called for parked cpus not coming up, while CPU_RESUME_FAILED will only
be used for non-parked cpus.
Juergen
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
|