linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: <20250402010611.3204674-1-yu.c.chen@intel.com>,
	Chen Yu <yu.c.chen@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	"Muchun Song" <muchun.song@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Tim Chen" <tim.c.chen@intel.com>,
	Aubrey Li <aubrey.li@intel.com>, Rik van Riel <riel@surriel.com>,
	Raghavendra K T <raghavendra.kt@amd.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Xunlei Pang <xlpang@linux.alibaba.com>,
	<linux-kernel@vger.kernel.org>, <cgroups@vger.kernel.org>,
	<linux-mm@kvack.org>, Chen Yu <yu.chen.surf@foxmail.com>,
	"Madadi Vineeth Reddy" <vineethr@linux.ibm.com>
Subject: Re: [PATCH] sched/numa: Add statistics of numa balance task migration and swap
Date: Wed, 2 Apr 2025 22:53:21 +0530	[thread overview]
Message-ID: <57f5803b-11e5-4b91-a4c3-9be191fbf8d3@amd.com> (raw)
In-Reply-To: <3ba327b9-3020-4a63-9623-e6eea0120056@linux.ibm.com>

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:

$ 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

...

-- 
Thanks and Regards,
Prateek

> 
> Thanks,
> Madadi Vineeth Reddy
> 
>>
>> Previous RFC version can be found here:
>> https://lore.kernel.org/lkml/1847c5ef828ad4835a35e3a54b88d2e13bce0eea.1740483690.git.yu.c.chen@intel.com/
>>
>> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
>> ---
>> RFC->v1: Rename the nr_numa_task_migrated to
>>           numa_task_migrated, and nr_numa_task_swapped
>>           numa_task_swapped in /proc/{PID}/sched,
>>           so both cgroup's memory.stat and task's
>>           sched have the same field name.
>> ---
>>   include/linux/sched.h         |  4 ++++
>>   include/linux/vm_event_item.h |  2 ++
>>   kernel/sched/core.c           | 10 ++++++++--
>>   kernel/sched/debug.c          |  4 ++++
>>   mm/memcontrol.c               |  2 ++
>>   mm/vmstat.c                   |  2 ++
>>   6 files changed, 22 insertions(+), 2 deletions(-)
> 
> 




  reply	other threads:[~2025-04-02 17:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02  1:06 Chen Yu
2025-04-02 13:24 ` Michal Koutný
2025-04-02 17:43   ` K Prateek Nayak
2025-04-03 17:57     ` Michal Koutný
2025-04-03  2:47   ` Chen, Yu C
2025-04-03 18:03     ` Michal Koutný
2025-04-02 13:33 ` Madadi Vineeth Reddy
2025-04-02 17:23   ` K Prateek Nayak [this message]
2025-04-02 18:08     ` Madadi Vineeth Reddy
2025-04-02 17:35 ` K Prateek Nayak
2025-04-03  2:49   ` Chen, Yu C
2025-04-02 18:50 ` Madadi Vineeth Reddy
2025-04-03  2:52   ` Chen, Yu C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57f5803b-11e5-4b91-a4c3-9be191fbf8d3@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=20250402010611.3204674-1-yu.c.chen@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=aubrey.li@intel.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=mingo@redhat.com \
    --cc=muchun.song@linux.dev \
    --cc=peterz@infradead.org \
    --cc=raghavendra.kt@amd.com \
    --cc=riel@surriel.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=tim.c.chen@intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vineethr@linux.ibm.com \
    --cc=xlpang@linux.alibaba.com \
    --cc=yu.c.chen@intel.com \
    --cc=yu.chen.surf@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox