[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f078db9c-e557-408e-a1ee-73f2bc89e915@intel.com>
Date: Thu, 3 Apr 2025 10:49:30 +0800
From: "Chen, Yu C" <yu.c.chen@...el.com>
To: K Prateek Nayak <kprateek.nayak@....com>, Peter Zijlstra
<peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, Juri Lelli
<juri.lelli@...hat.com>, Vincent Guittot <vincent.guittot@...aro.org>, "Mel
Gorman" <mgorman@...e.de>, Johannes Weiner <hannes@...xchg.org>, Michal Hocko
<mhocko@...nel.org>, Roman Gushchin <roman.gushchin@...ux.dev>, Shakeel Butt
<shakeel.butt@...ux.dev>, Muchun Song <muchun.song@...ux.dev>, Andrew Morton
<akpm@...ux-foundation.org>
CC: Tim Chen <tim.c.chen@...el.com>, Aubrey Li <aubrey.li@...el.com>, "Rik van
Riel" <riel@...riel.com>, Raghavendra K T <raghavendra.kt@....com>, "Baolin
Wang" <baolin.wang@...ux.alibaba.com>, Xunlei Pang
<xlpang@...ux.alibaba.com>, <linux-kernel@...r.kernel.org>,
<cgroups@...r.kernel.org>, <linux-mm@...ck.org>, Chen Yu
<yu.chen.surf@...mail.com>
Subject: Re: [PATCH] sched/numa: Add statistics of numa balance task migration
and swap
On 4/3/2025 1:35 AM, K Prateek Nayak wrote:
> Hello Chenyu,
>
> On 4/2/2025 6:36 AM, Chen Yu wrote:
>> On system with NUMA balancing enabled, it is found that tracking
>> the task activities due to NUMA balancing is helpful. NUMA balancing
>> has two mechanisms for task migration: one is to migrate the task to
>> an idle CPU in its preferred node, the other is to swap tasks on
>> different nodes if they are on each other's preferred node.
>>
>> The kernel already has NUMA page migration statistics in
>> /sys/fs/cgroup/mytest/memory.stat and /proc/{PID}/sched.
>> but does not have statistics for task migration/swap.
>> Add the task migration and swap count accordingly.
>>
>> The following two new fields:
>>
>> numa_task_migrated
>> numa_task_swapped
>>
>> will be displayed in both
>> /sys/fs/cgroup/{GROUP}/memory.stat and /proc/{PID}/sched
>
> Running sched-messaging with schedstats enabled, I could see both
> "numa_task_migrated" and "numa_task_swapped" being populated for the
> sched-messaging threads:
>
> $ for i in $(ls /proc/4030/task/); do grep "numa_task_migrated" /proc/
> $i/sched; done | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c
> 400 0
> 231 1
> 10 2
>
> $ for i in $(ls /proc/4030/task/); do grep "numa_task_swapped" /proc/$i/
> sched; done | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c
> 389 0
> 193 1
> 47 2
> 11 3
> 1 4
>
>>
>> Previous RFC version can be found here:
>> https://lore.kernel.org/
>> lkml/1847c5ef828ad4835a35e3a54b88d2e13bce0eea.1740483690.git.yu.c.chen@...el.com/
>>
>> Signed-off-by: Chen Yu <yu.c.chen@...el.com>
>
> Feel free to add:
>
> Tested-by: K Prateek Nayak <kprateek.nayak@....com>
>
Thanks Prateek!
Thanks,
Chenyu
Powered by blists - more mailing lists