[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31aa40f3-ca75-4e44-a1d0-e2ab3ce17fdd@linux.ibm.com>
Date: Wed, 2 Apr 2025 23:38:53 +0530
From: Madadi Vineeth Reddy <vineethr@...ux.ibm.com>
To: K Prateek Nayak <kprateek.nayak@....com>
Cc: 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>,
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>, Chen Yu <yu.c.chen@...el.com>,
Madadi Vineeth Reddy <vineethr@...ux.ibm.com>
Subject: Re: [PATCH] sched/numa: Add statistics of numa balance task migration
and swap
On 02/04/25 22:53, K Prateek Nayak wrote:
> On 4/2/2025 7:03 PM, Madadi Vineeth Reddy wrote:
>> Hi Chen Yu,
>>
>> On 02/04/25 06:36, 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
>>
>> I applied this patch, but I still don't see the two new fields
>> in /proc/{PID}/sched.
>>
>> Am I missing any additional steps?
>
> You also need to enable schedstats:
>
> echo 1 > /proc/sys/kernel/sched_schedstats
>
> After that it should be visible:
Thanks, Prateek! I had missed enabling schedstats. Now that it's enabled,
I can see the fields.
Thanks,
Madadi Vineeth Reddy
>
> $ cat /proc/4030/sched
> sched-messaging (4030, #threads: 641)
> -------------------------------------------------------------------
> se.exec_start : 283818.948537
>
> ...
>
> nr_forced_migrations : 0
> numa_task_migrated : 0
> numa_task_swapped : 0
> nr_wakeups : 0
>
> ...
>
Powered by blists - more mailing lists