public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] taskstats: fix TGID dead-thread stat retention
@ 2026-04-12 19:18 Yiyang Chen
  2026-04-12 19:18 ` [PATCH v2 1/2] taskstats: retain dead thread stats in TGID queries Yiyang Chen
  2026-04-12 19:18 ` [PATCH v2 2/2] selftests/acct: add taskstats TGID retention test Yiyang Chen
  0 siblings, 2 replies; 5+ messages in thread
From: Yiyang Chen @ 2026-04-12 19:18 UTC (permalink / raw)
  To: Balbir Singh, Yang Yang, Wang Yaxin
  Cc: linux-kernel, Oleg Nesterov, Dr . Thomas Orgis, Andrew Morton,
	Yiyang Chen

This series fixes a taskstats TGID aggregation bug where fields added in
the TGID query path were not preserved after thread exit, and adds a
kselftest covering the regression.

The first patch keeps the cached TGID aggregate used for dead threads in
step with the fields already accumulated for live threads, and also fixes
the final TGID exit notification emitted when group_dead is true.

The second patch adds a kselftest that verifies TGID CPU stats do not
regress after a worker thread exits and has been reaped.

Yiyang Chen (2):
  taskstats: retain dead thread stats in TGID queries
  selftests/acct: add taskstats TGID retention test

 kernel/taskstats.c                            |  62 +--
 tools/testing/selftests/acct/.gitignore       |   3 +-
 tools/testing/selftests/acct/Makefile         |   5 +-
 .../acct/taskstats_fill_stats_tgid.c          | 375 ++++++++++++++++++
 4 files changed, 414 insertions(+), 31 deletions(-)
 create mode 100644 tools/testing/selftests/acct/taskstats_fill_stats_tgid.c

---
v1: <https://lore.kernel.org/lkml/6f4ed79d96c389a9a1d67d5ced96c6326eda82ae.1774552296.git.cyyzero16@gmail.com/>

Changes in v2:
- add Fixes tags for the two commits that introduced the regression
- clarify that the regression affects both TGID queries and the final
  TGID exit notification
- add a kselftest that checks TGID CPU stats do not regress after
  thread exit

-- 
2.43.0


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

end of thread, other threads:[~2026-04-13  3:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-12 19:18 [PATCH v2 0/2] taskstats: fix TGID dead-thread stat retention Yiyang Chen
2026-04-12 19:18 ` [PATCH v2 1/2] taskstats: retain dead thread stats in TGID queries Yiyang Chen
2026-04-13  3:00   ` Balbir Singh
2026-04-12 19:18 ` [PATCH v2 2/2] selftests/acct: add taskstats TGID retention test Yiyang Chen
2026-04-13  3:04   ` Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox