Skip to content

EDITME: cover title for b4/kunit-user-alloc

Brendan Jackman linux-kselftest linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected] change-id 20251223-b4-kunit-user-alloc-6ae8df0b8a92

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3kunit: test: Delete pointless resource API usagelib/kunit/user_alloc.c+6 -701 reply
2/3kthread: Add kthread_take_mm()include/linux/kthread.h kernel/fork.c kernel/kthread.c+30 -102 replies
3/3kunit: test: fix mm_struct leak in kunit_attach_mm()lib/kunit/user_alloc.c+1 -11 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDavid Gow
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] EDITME: cover title for b4/kunit-user-alloc

kunit_attach_mm() leaks an mm_struct (verified with dumb printf debugging). Fix that. In the process, add a new kthread mm operation, and clean up some nearby cleanup code in the KUnit lib.

---
Here's how I understand mm refcounts:

funcs | counter | manages lifecycle of...
--------------------------------------------------------
mmgrab()/mmdrop() | mm_count | mm_struct and PGD
--------------------------------------------------------
mmget()/mmput() | mm_users | userspace address space

All mm_users references share a single reference to the mm_struct.

---
Brendan Jackman (3):
kunit: test: Delete pointless resource API usage
kthread: Add kthread_take_mm()
kunit: test: fix mm_struct leak in kunit_attach_mm()

 include/linux/kthread.h |  1 +
 kernel/fork.c           |  3 +-
 kernel/kthread.c        | 36 +++++++++++++++++------
 lib/kunit/user_alloc.c  | 78 +++++--------------------------------------------
 4 files changed, 37 insertions(+), 81 deletions(-)

---
base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578
change-id: 20251223-b4-kunit-user-alloc-6ae8df0b8a92

Best regards,

Signature · 1 line
Brendan Jackman <[email protected]>