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-next>] [day] [month] [year] [list]
Message-ID: <20241218043629.1142651-1-swapnil.sapkal@amd.com>
Date: Wed, 18 Dec 2024 04:36:23 +0000
From: Swapnil Sapkal <swapnil.sapkal@....com>
To: <peterz@...radead.org>, <mingo@...hat.com>, <juri.lelli@...hat.com>,
	<vincent.guittot@...aro.org>, <corbet@....net>
CC: <dietmar.eggemann@....com>, <rostedt@...dmis.org>, <bsegall@...gle.com>,
	<mgorman@...e.de>, <vschneid@...hat.com>, <iamjoonsoo.kim@....com>,
	<qyousef@...alina.io>, <sshegde@...ux.ibm.com>, <alexs@...nel.org>,
	<lukasz.luba@....com>, <gautham.shenoy@....com>, <kprateek.nayak@....com>,
	<ravi.bangoria@....com>, <linux-kernel@...r.kernel.org>,
	<doc@...r.kernel.org>, Swapnil Sapkal <swapnil.sapkal@....com>
Subject: [PATCH 0/6] Fixes and improvements in /proc/schedstat

This patch series adds fixes and improvements to /proc/schedstat. Patches
are based on top of tip/sched/core commit 7675361ff9a1
("sched: deadline: Cleanup goto label in pick_earliest_pushable_dl_task")

Patch 1 and 2: In /proc/schedstat, lb_hot_gained reports the number of
times cache-hot tasks were migrated as a part of load balancing. This
value is incremented in can_migrate_task() if the task is cache hot and
migratable. But after incrementing this value, it is possible that the
task won't get migrated, in which case this value will be incorrect.
Fix this by incrementing it in detach_task().

While at it, cleanup migrate_degrades_locality() by making it return an
enum instead of the {-1,0,1} to improve the readability of
can_migrate_task(). Previously these patches were sent here[1].

Patch 3: Adds new fields to /proc/schedstat. Previously this patch was
sent here[2]. This change is intended to be a part of v17 of
/proc/schedstat.

In /proc/schedstat, lb_imbalance reports the sum of imbalances discovered
in sched domains with each call to sched_balance_rq(), which is not very
useful because lb_imbalance does not mention whether the imbalance is due
to load, utilization, nr_tasks or misfit_tasks. Remove this field from
/proc/schedstat.

Currently there is no field in /proc/schedstat to report different types
of imbalances. Introduce new fields in /proc/schedstat to report the
total imbalances in load, utilization, nr_tasks or misfit_tasks.

Patch 4 and 5: Currently, there does not exist a straightforward way to
extract the names of the sched domains and match them to the per-cpu
domain entry in /proc/schedstat other than looking at the debugfs files
which are only visible after enabling "verbose" debug after commit
34320745dfc9 ("sched/debug: Put sched/domains files under the verbose flag")

Since tools like `perf sched stats`[3] requires displaying per-domain
information in user friendly manner, display the names of sched domain,
alongside their level in /proc/schedstat to aggregate domain level stats
if domain names are shown in /proc/schedstat. But sched domain name is
guarded by CONFIG_SCHED_DEBUG. As per the discussion[4], these patches
moves sched domain name out of CONFIG_SCHED_DEBUG and prints sched
domain name in /proc/schedstat.

Patch 6: Updates the Schedstat version to 17 as more fields are added to
report different kinds of imbalances in the sched domain. Domain fields
also started printing sched domain name.

[1] https://lore.kernel.org/all/20230614102224.12555-1-swapnil.sapkal@amd.com/
[2] https://lore.kernel.org/lkml/66f1e42c-9035-4f9b-8c77-976ab50638bd@amd.com/
[3] https://lore.kernel.org/lkml/20241122084452.1064968-1-swapnil.sapkal@amd.com/
[4] https://lore.kernel.org/lkml/fcefeb4d-3acb-462d-9c9b-3df8d927e522@amd.com/

K Prateek Nayak (1):
  sched/stats: Print domain name in /proc/schedstat

Peter Zijlstra (2):
  sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat
  sched/fair: Cleanup in migrate_degrades_locality() to improve
    readability

Swapnil Sapkal (3):
  sched: Report the different kinds of imbalances in /proc/schedstat
  sched: Move sched domain name out of CONFIG_SCHED_DEBUG
  docs: Update Schedstat version to 17

 Documentation/scheduler/sched-stats.rst | 126 ++++++++++++++----------
 include/linux/sched.h                   |   1 +
 include/linux/sched/topology.h          |  13 +--
 kernel/sched/fair.c                     |  77 ++++++++++-----
 kernel/sched/stats.c                    |  11 ++-
 kernel/sched/topology.c                 |   4 -
 6 files changed, 140 insertions(+), 92 deletions(-)

-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ