public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/2] kobject: avoid to cleanup kobject after module is unloaded
@ 2021-11-29  3:45 Ming Lei
  2021-11-29  3:45 ` [PATCH V2 1/2] kobject: don't delay to cleanup module kobject Ming Lei
  2021-11-29  3:45 ` [PATCH V2 2/2] kobject: wait until kobject is cleaned up before freeing module Ming Lei
  0 siblings, 2 replies; 13+ messages in thread
From: Ming Lei @ 2021-11-29  3:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Petr Mladek, linux-kernel, Luis Chamberlain, Ming Lei

Hello,

The 1st patch improves CONFIG_DEBUG_KOBJECT_RELEASE, so that kobject
cleanup after unloading module can be triggered easily. With this patch,
'modprobe kset-example' can trigger the issue very quickly.

The 2nd patch fixes the issue of cleaning up object after module is
unloaded, since kobj->ktype and related callbacks are often allocated
as module static variable. We need to make sure kobject is really
cleaned up before freeing module. This issue is reported by Petr Mladek.

V2:
	- add comment on 1st patch, suggested by Greg, 1/2
	- fix build failure in case that CONFIG_MODULE is disabled, and add
	comment in kobj_module_callback(), 2/2


Ming Lei (2):
  kobject: don't delay to cleanup module kobject
  kobject: wait until kobject is cleaned up before freeing module

 include/linux/kobject.h |  1 +
 lib/kobject.c           | 82 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)

-- 
2.31.1


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

end of thread, other threads:[~2022-07-07  4:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-29  3:45 [PATCH V2 0/2] kobject: avoid to cleanup kobject after module is unloaded Ming Lei
2021-11-29  3:45 ` [PATCH V2 1/2] kobject: don't delay to cleanup module kobject Ming Lei
2021-12-03 15:08   ` Greg Kroah-Hartman
2021-12-07 13:58   ` kernel test robot
2021-11-29  3:45 ` [PATCH V2 2/2] kobject: wait until kobject is cleaned up before freeing module Ming Lei
2021-12-03 15:07   ` Greg Kroah-Hartman
2021-12-06  2:13     ` Ming Lei
2021-12-06  8:04       ` Greg Kroah-Hartman
2021-12-07  1:50         ` Ming Lei
2021-12-07 10:32         ` Petr Mladek
2021-12-07 12:51           ` Ming Lei
2021-12-07 14:02             ` Petr Mladek
2022-07-07  4:54               ` Ming Lei

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