linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Cleanup and Fix for wrong accounting of migrated cache hot tasks
@ 2023-06-14 10:22 Swapnil Sapkal
  2023-06-14 10:22 ` [PATCH 1/2] sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat Swapnil Sapkal
  2023-06-14 10:22 ` [PATCH 2/2] sched/fair: Cleanup in migrate_degrades_locality() to improve readability Swapnil Sapkal
  0 siblings, 2 replies; 7+ messages in thread
From: Swapnil Sapkal @ 2023-06-14 10:22 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, bristot, vschneid,
	iamjoonsoo.kim, linux-kernel, gautham.shenoy, kprateek.nayak,
	wyes.karny, Swapnil Sapkal

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().

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

 kernel/sched/fair.c | 100 +++++++++++++++++++++++++++++---------------
 1 file changed, 66 insertions(+), 34 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-21  4:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 10:22 [PATCH 0/2] Cleanup and Fix for wrong accounting of migrated cache hot tasks Swapnil Sapkal
2023-06-14 10:22 ` [PATCH 1/2] sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat Swapnil Sapkal
2023-06-19  9:22   ` Peter Zijlstra
2023-06-21  4:38     ` Swapnil Sapkal
2023-06-14 10:22 ` [PATCH 2/2] sched/fair: Cleanup in migrate_degrades_locality() to improve readability Swapnil Sapkal
2023-06-19  9:45   ` Peter Zijlstra
2023-06-21  4:44     ` Swapnil Sapkal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).