linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Petr Mladek <pmladek@suse.com>,
	linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Ming Lei <ming.lei@redhat.com>
Subject: [PATCH 0/2] kobject: avoid to cleanup kobject after module is unloaded
Date: Fri,  5 Nov 2021 14:37:08 +0800	[thread overview]
Message-ID: <20211105063710.4092936-1-ming.lei@redhat.com> (raw)

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.


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           | 67 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)

-- 
2.31.1


             reply	other threads:[~2021-11-05  6:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05  6:37 Ming Lei [this message]
2021-11-05  6:37 ` [PATCH 1/2] kobject: don't delay to cleanup module kobject Ming Lei
2021-11-26 16:08   ` Greg Kroah-Hartman
2021-11-26 16:28     ` Ming Lei
2021-11-26 16:33       ` Greg Kroah-Hartman
2021-11-29  2:38         ` Ming Lei
2021-11-05  6:37 ` [PATCH 2/2] kobject: wait until kobject is cleaned up before freeing module Ming Lei
2021-11-05 14:10   ` kernel test robot
2021-11-05 14:54     ` Ming Lei
2021-11-08 17:26   ` Petr Mladek
2021-11-09  2:00     ` Ming Lei
2021-11-09 13:14       ` Petr Mladek
2021-11-10  1:20         ` Ming Lei
2021-11-10  7:03           ` Greg Kroah-Hartman
2021-11-10  9:05             ` Petr Mladek
2021-11-10  9:19               ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211105063710.4092936-1-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe.lawrence@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).