tsacct-skip-all-kernel-threads.patch removed from -mm tree
The quilt patch titled
Subject: tsacct: skip all kernel threads
has been removed from the -mm tree. Its filename was
tsacct-skip-all-kernel-threads.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Mathieu Desnoyers <[email protected]>
Subject: tsacct: skip all kernel threads
Date: Wed, 24 Dec 2025 12:38:10 -0500
This patch is a preparation step for HPCC, for the OOM killer improvements. I suspect that this patch is useful on its own, because it really makes no sense to sum up accounting statistics of use_mm within kernel threads which are only temporarily using those mm.
When we hit acct_account_cputime within a irq handler over a kthread that happens to use a userspace mm, we end up summing up the mm's RSS into the tsk acct_rss_mem1, which eventually decays.
I don't see a good rationale behind tracking the mm's rss in that way when a kthread use a userspace mm temporarily through use_mm.
It causes issues with init_mm and efi_mm which only partially initialize their mm_struct when introducing the new hierarchical percpu counters to replace RSS counters, which requires a pointer dereference when reading the approximate counter sum. The current percpu counters simply load a zeroed atomic counter, which happen to work.
Skip all kernel threads in acct_account_cputime(), not just those that happen to have a NULL mm.
This is a preparation step before introducing the hierarchical percpu counters.
---
kernel/tsacct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/tsacct.c renamed from kernel/tsacct.c~tsacct-skip-all-kernel-threads +1 -1
@@ -125,7 +125,7 @@ static void __acct_update_integrals(stru {u64 time, delta; -if (!likely (tsk->mm)) +if (unlikely (!tsk->mm || (tsk->flags &PF_KTHREAD )))return ; time = stime + utime;
_
Patches currently in -mm which might be from [email protected] are
mm-fix-oom-killer-inaccuracy-on-large-many-core-systems.patch