[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb60195d-24cb-f800-399c-8da888ca6385@intel.com>
Date: Tue, 9 Feb 2021 15:45:55 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Oscar Salvador <osalvador@...e.de>,
Dave Hansen <dave.hansen@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
yang.shi@...ux.alibaba.com, rientjes@...gle.com,
ying.huang@...el.com, dan.j.williams@...el.com, david@...hat.com
Subject: Re: [RFC][PATCH 06/13] mm/migrate: update migration order during on
hotplug events
On 2/2/21 3:42 AM, Oscar Salvador wrote:
>> +static int __meminit migrate_on_reclaim_callback(struct notifier_block *self,
>> + unsigned long action, void *arg)
>> +{
>> + switch (action) {
>> + case MEM_GOING_OFFLINE:
>> + /*
>> + * Make sure there are not transient states where
>> + * an offline node is a migration target. This
>> + * will leave migration disabled until the offline
>> + * completes and the MEM_OFFLINE case below runs.
>> + */
>> + disable_all_migrate_targets();
>> + break;
>> + case MEM_OFFLINE:
>> + case MEM_ONLINE:
>> + /*
>> + * Recalculate the target nodes once the node
>> + * reaches its final state (online or offline).
>> + */
>> + __set_migration_target_nodes();
>> + break;
>> + case MEM_CANCEL_OFFLINE:
>> + /*
>> + * MEM_GOING_OFFLINE disabled all the migration
>> + * targets. Reenable them.
>> + */
>> + __set_migration_target_nodes();
>> + break;
>> + case MEM_GOING_ONLINE:
>> + case MEM_CANCEL_ONLINE:
>> + break;
>> + }
>> +
>> + return notifier_from_errno(0);
>> +}
> This looks good, and I kinda like it.
> But in this case, all we care about is whether NUMA node does or does
> not have memory, so we have to remove/added into the demotion list.
> So, would make more sense to have a kinda helper in
> node_states_{set,clear}_node that calls the respective functions
> (disable_all_migrate_targets and __set_migration_target_nodes)?
Of, you're saying that we could do this in the hotplug code itself
instead of from a notifier? I agree, we *could*. That would be more
efficient. But, I do like the idea of doing this from a notifier
because it's a bit less brittle.
Do you feel strongly about this one?
Powered by blists - more mailing lists