diff mbox series

[v3,5/7] mm: demotion: Build demotion list based on N_DEMOTION_TARGETS

Message ID 20220422195516.10769-6-jvgediya@linux.ibm.com (mailing list archive)
State New
Headers show
Series mm: demotion: Introduce new node state N_DEMOTION_TARGETS | expand

Commit Message

Jagdish Gediya April 22, 2022, 7:55 p.m. UTC
Only nodes which has state N_DEMOTION_TARGETS should be
used as demotion targets, make nodes which are not in demotion
targets as source nodes while building demotion target list
so that demotion targets are only chosen from N_DEMOTION_TARGETS.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Jagdish Gediya <jvgediya@linux.ibm.com>
---
 mm/migrate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Wei Xu April 22, 2022, 8:39 p.m. UTC | #1
On Fri, Apr 22, 2022 at 12:55 PM Jagdish Gediya <jvgediya@linux.ibm.com> wrote:
>
> Only nodes which has state N_DEMOTION_TARGETS should be
> used as demotion targets, make nodes which are not in demotion
> targets as source nodes while building demotion target list
> so that demotion targets are only chosen from N_DEMOTION_TARGETS.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> Signed-off-by: Jagdish Gediya <jvgediya@linux.ibm.com>
> ---

Acked-by: Wei Xu <weixugc@google.com>

>  mm/migrate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 8bbe1e478122..5b92a09fbe4a 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -2366,10 +2366,10 @@ static void __set_migration_target_nodes(void)
>         disable_all_migrate_targets();
>
>         /*
> -        * Allocations go close to CPUs, first.  Assume that
> -        * the migration path starts at the nodes with CPUs.
> +        * Some systems can have DRAM(fast memory) only NUMA nodes, demotion targets
> +        * need to be found for them as well.
>          */
> -       next_pass = node_states[N_CPU];
> +       nodes_andnot(next_pass, node_states[N_ONLINE], node_states[N_DEMOTION_TARGETS]);
>  again:
>         this_pass = next_pass;
>         next_pass = NODE_MASK_NONE;
> --
> 2.35.1
>
diff mbox series

Patch

diff --git a/mm/migrate.c b/mm/migrate.c
index 8bbe1e478122..5b92a09fbe4a 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2366,10 +2366,10 @@  static void __set_migration_target_nodes(void)
 	disable_all_migrate_targets();
 
 	/*
-	 * Allocations go close to CPUs, first.  Assume that
-	 * the migration path starts at the nodes with CPUs.
+	 * Some systems can have DRAM(fast memory) only NUMA nodes, demotion targets
+	 * need to be found for them as well.
 	 */
-	next_pass = node_states[N_CPU];
+	nodes_andnot(next_pass, node_states[N_ONLINE], node_states[N_DEMOTION_TARGETS]);
 again:
 	this_pass = next_pass;
 	next_pass = NODE_MASK_NONE;