diff options
| author | David Hildenbrand (Arm) <david@kernel.org> | 2026-10-31 10:40:15 +0100 |
|---|---|---|
| committer | David Hildenbrand (Arm) <david@kernel.org> | 2026-11-03 20:20:53 +0100 |
| commit | 500624f28eca441e35f978979ccfb373202fefd3 (patch) | |
| tree | 0aa1aae7f012a0992860445de56c6186ec9e665a /tools/perf/scripts/python | |
| parent | e8abc61d8a549a91c8fa639f68be2ef13d5fa63b (diff) | |
mm/memory-tiers: unregister empty tiers outside memory_tier_lock
When offlining a node's last memory empties its tier,
clear_node_memory_tier() calls device_unregister() while holding
memory_tier_lock. A concurrent sysfs read can hold a kernfs active
reference and block in nodelist_show() on that mutex. device_unregister()
then waits in kernfs_drain() for the read to finish and release its active
reference, while the reader waits for the offlining task to release the
mutex.
Return the node's former tier from clear_node_memory_tier(), making the
helper more similar to set_node_memory_tier(), which also returns a
memory_tier pointer. Let the caller unlink an empty tier under
memory_tier_lock before rebuilding demotion targets, then unregister its
device after dropping the lock.
Fixes: 9832fb87834e ("mm/demotion: expose memory tier details via sysfs")
Cc: stable@vger.kernel.org
Reported-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-46-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
