Re: [RFC PATCH v3 bpf-next 3/5] sched: add helpers for numa balancing
From: bot+bpf-ci
Date: Mon Oct 19 2026 - 03:15:32 EST
> sched: add helpers for numa balancing
TL;DR: Nits only: redundant parentheses around the new numab_in_tiering_mode()
helper calls in should_numa_migrate_memory() and migrate_misplaced_folio()
could be dropped.
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 71dc47d6114d..066818498c76 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
[ ... ]
> @@ -2963,8 +2965,8 @@ bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio,
> this_cpupid = cpu_pid_to_cpupid(dst_cpu, current->pid);
> last_cpupid = folio_xchg_last_cpupid(folio, this_cpupid);
>
> - if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) &&
> - !node_is_toptier(src_nid) && !cpupid_valid(last_cpupid))
> + if (!(numab_in_tiering_mode()) && !node_is_toptier(src_nid) &&
> + !cpupid_valid(last_cpupid))
> return false;
this isn't a bug, but could the extra parentheses in
!(numab_in_tiering_mode()) be dropped here? They were needed around the
old bitwise test, and the other converted sites such as
task_numa_fault() call the helper without them.
[ ... ]
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 15b45832bcfa..a622df9a9b42 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
[ ... ]
> @@ -2770,7 +2771,7 @@ int migrate_misplaced_folio(struct folio *folio, int node)
> if (nr_succeeded) {
> count_vm_numa_events(NUMA_PAGE_MIGRATE, nr_succeeded);
> count_memcg_events(memcg, NUMA_PAGE_MIGRATE, nr_succeeded);
> - if ((sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING)
> + if ((numab_in_tiering_mode())
> && !node_is_toptier(folio_nid(folio))
> && node_is_toptier(node))
> mod_lruvec_state(lruvec, PGPROMOTE_SUCCESS, nr_succeeded);
The same applies to the parentheses in
if ((numab_in_tiering_mode()) here.
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/39213018427