diff options
| author | Gregory Price (Meta) <gourry@gourry.net> | 2026-10-31 22:13:33 -0400 |
|---|---|---|
| committer | Vlastimil Babka (SUSE) <vbabka@kernel.org> | 2026-11-05 10:58:52 +0100 |
| commit | 9c52ebe9c89d41c56fcb5d94efe9e539414175a9 (patch) | |
| tree | 46285765e5606cb79bc737ef59570136f011a46f /include/linux/workqueue_api.h | |
| parent | e5db040c3d09c5d85dda70f736d4d1a6714b741e (diff) | |
mm/mmzone: read the zoneref slot once in zonelist_zone()
Memory hotplug rebuilds zonelists in place while allocations walk them,
so a zoneref slot can change between two loads of it.
zonelist_zone() loads the slot with a plain access. The compiler may
load it again later instead of keeping the zone it already read, so a
caller can check one zone and then use another, or the NULL terminator.
Use READ_ONCE(). Callers that take a zone from a slot and keep using
it, such as get_page_from_freelist() with ac->preferred_zoneref, need
that single load.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-6-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'include/linux/workqueue_api.h')
0 files changed, 0 insertions, 0 deletions
