linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] EDITME: cover title for b4/kunit-user-alloc
@ 2025-12-23 16:18 Brendan Jackman
  2025-12-23 16:18 ` [PATCH 1/3] kunit: test: Delete pointless resource API usage Brendan Jackman
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Brendan Jackman @ 2025-12-23 16:18 UTC (permalink / raw)
  To: Brendan Higgins, David Gow, Rae Moar, Kees Cook, Ingo Molnar,
	Peter Zijlstra, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
	Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko
  Cc: linux-kselftest, kunit-dev, linux-kernel, linux-mm, Brendan Jackman

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,
-- 
Brendan Jackman <jackmanb@google.com>



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

end of thread, other threads:[~2025-12-23 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-23 16:18 [PATCH 0/3] EDITME: cover title for b4/kunit-user-alloc Brendan Jackman
2025-12-23 16:18 ` [PATCH 1/3] kunit: test: Delete pointless resource API usage Brendan Jackman
2025-12-23 16:18 ` [PATCH 2/3] kthread: Add kthread_take_mm() Brendan Jackman
2025-12-23 16:18 ` [PATCH 3/3] kunit: test: fix mm_struct leak in kunit_attach_mm() Brendan Jackman
2025-12-23 16:46 ` [PATCH 0/3] EDITME: cover title for b4/kunit-user-alloc Brendan Jackman

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