lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c6224ca-c0da-7ba9-1396-a2e74c4a40e8@amd.com>
Date:   Wed, 23 Feb 2022 10:13:50 -0600
From:   Carlos Bilbao <carlos.bilbao@....com>
To:     Phil Auld <pauld@...hat.com>, Peter Zijlstra <peterz@...radead.org>
Cc:     Peter Zijlstra <peterz@...radead.org>, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, mingo@...hat.com,
        dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
        mgorman@...e.de, bristot@...hat.com, linux-kernel@...r.kernel.org
Subject: [PATCH v2] kernel/sched: Update schedstats when migrating threads

The kernel manages per-task scheduler statistics or schedstats. Update
function migrate_task_to() to increase the counter for migrations.

Signed-off-by: Carlos Bilbao <carlos.bilbao@....com>
---
Changelog:
	v2: Update commit message, don't reinitialize sched fields.
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fcf0c180617c..1360e501c737 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8751,7 +8751,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu)
 	if (!cpumask_test_cpu(target_cpu, p->cpus_ptr))
 		return -EINVAL;
 
-	/* TODO: This is not properly updating schedstats */
+	schedstat_inc(p->stats.nr_migrations_cold);
 
 	trace_sched_move_numa(p, curr_cpu, target_cpu);
 	return stop_one_cpu(curr_cpu, migration_cpu_stop, &arg);
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ