lkml.org 
[lkml]   [2023]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/3] delayacct: optimization & code simplify
Date
From: Chunguang Xu <chunguang.xu@shopee.com>

Since in some scenarios we still want to get the task delayacct
through taskstats, so commit <0cd7c741f01de> introduces a sysctl to
enable it dynamically. However, since task->delays is allocated
during fork(), task->delays will not be reallocated when delayacct
is enabled later. This will make we cannot get the delayacct of old
tasks, but the new tasks cans. This can easily lead to confusion.
Therefore, try to workaround this issue by convert task->delays to
an object, just like sched_statistics. Besides, try to simplify the
code of delayacct.

Chunguang Xu (3):
delayacct: introduce delayacct_enabled() to simplify implement
delayacct: convert task->delays to a object
delayacct: remove delayacct_on to simplify the code

include/linux/delayacct.h | 83 +++++-------------------
include/linux/sched.h | 3 +-
kernel/delayacct.c | 129 ++++++++++++++++++--------------------
kernel/fork.c | 7 +--
4 files changed, 81 insertions(+), 141 deletions(-)

--
2.25.1

\
 
 \ /
  Last update: 2023-10-08 19:19    [W:0.189 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site