From: sashiko-bot@kernel.org
To: "Gregory Price" <gourry@gourry.net>
Cc: nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org
Subject: Re: [PATCH v7 04/10] mm/memory_hotplug: export mhp_get_default_online_type
Date: Sun, 12 Jul 2026 15:56:18 +0000 [thread overview]
Message-ID: <20260712155618.835AD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260712154505.3564379-5-gourry@gourry.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] add_memory_resource() caches mhp_get_default_online_type() at the start but re-reads it for the final condition check, potentially ignoring concurrent sysfs policy changes.
--
--- Patch [4]: [PATCH v7 04/10] mm/memory_hotplug: export mhp_get_default_online_type ---
commit d037ee754b46e2d238e974dbf3f6ebb2ab7882bc
Author: Gregory Price <gourry@gourry.net>
mm/memory_hotplug: export mhp_get_default_online_type
Drivers which may pass hotplug policy down to DAX need MMOP_ symbols
and the mhp_get_default_online_type function for hotplug use cases.
This commit exports mhp_get_default_online_type to allow these drivers
to build when hotplug is disabled and still use the DAX use case.
[ ... ]
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 6833208cc17cb..4942570540956 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -239,6 +239,7 @@ enum mmop mhp_get_default_online_type(void)
>
> return mhp_default_online_type;
> }
> +EXPORT_SYMBOL_GPL(mhp_get_default_online_type);
[Severity: Medium]
In add_memory_resource(), mhp_get_default_online_type() is cached at the
start of the function, but then re-read for the final condition check:
mm/memory_hotplug.c:add_memory_resource() {
enum mmop online_type = mhp_get_default_online_type();
...
/* online pages if requested */
if (mhp_get_default_online_type() != MMOP_OFFLINE)
walk_memory_blocks(start, size, &online_type,
online_memory_block);
}
If a system administrator modifies the auto-online sysfs policy concurrently
while a memory hot-add operation is in progress, could this re-read cause
the operation to silently ignore the user's explicit online policy
(e.g., online_movable), onlining the memory into the default zone instead?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260712154505.3564379-1-gourry@gourry.net?part=4
next prev parent reply other threads:[~2026-07-12 15:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-12 15:44 [PATCH v7 00/10] dax/kmem: atomic whole-device hotplug via sysfs Gregory Price
2026-07-12 15:44 ` [PATCH v7 01/10] mm/memory: add memory_block_aligned_range() helper Gregory Price
2026-07-12 15:52 ` sashiko-bot
2026-07-12 15:44 ` [PATCH v7 02/10] mm/memory_hotplug: add mhp_online_type_to_str() and export string helpers Gregory Price
2026-07-12 15:44 ` [PATCH v7 03/10] mm/memory_hotplug: pass online_type to online_memory_block() via arg Gregory Price
2026-07-12 15:53 ` sashiko-bot
2026-07-12 15:44 ` [PATCH v7 04/10] mm/memory_hotplug: export mhp_get_default_online_type Gregory Price
2026-07-12 15:56 ` sashiko-bot [this message]
2026-07-12 15:44 ` [PATCH v7 05/10] mm/memory_hotplug: add __add_memory_driver_managed() with online_type arg Gregory Price
2026-07-12 15:45 ` [PATCH v7 06/10] mm/memory_hotplug: add offline_and_remove_memory_ranges() Gregory Price
2026-07-12 15:53 ` sashiko-bot
2026-07-12 15:45 ` [PATCH v7 07/10] dax/kmem: resolve default online type at probe time Gregory Price
2026-07-12 15:56 ` sashiko-bot
2026-07-12 15:45 ` [PATCH v7 08/10] dax/kmem: extract hotplug/hotremove helper functions Gregory Price
2026-07-12 15:54 ` sashiko-bot
2026-07-12 15:45 ` [PATCH v7 09/10] dax/kmem: add sysfs interface for atomic whole-device hotplug Gregory Price
2026-07-12 15:45 ` [PATCH v7 10/10] selftests/dax: add dax/kmem hotplug sysfs regression test Gregory Price
2026-07-12 16:48 ` [PATCH v7 00/10] dax/kmem: atomic whole-device hotplug via sysfs Gregory Price
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260712155618.835AD1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gourry@gourry.net \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.