Skip to content

delayacct: optimization & code simplify

brookxu.cn lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3delayacct: introduce delayacct_enabled() to simplify implementinclude/linux/delayacct.h kernel/delayacct.c+21 -552 replies
2/3delayacct: convert task->delays to a objectinclude/linux/delayacct.h include/linux/sched.h kernel/delayacct.c +1 more+60 -797 replies
3/3delayacct: remove delayacct_on to simplify the codeinclude/linux/delayacct.h kernel/delayacct.c+4 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] delayacct: optimization & code simplify

From: Chunguang Xu <[email protected]>

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(-)
Signature · 1 line
2.25.1