All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 2/2] kobject: wait until kobject is cleaned up before freeing module
Date: Fri, 05 Nov 2021 22:54:36 +0800	[thread overview]
Message-ID: <YYVFrJe5e1EZHyxS@T590> (raw)
In-Reply-To: <202111052230.7LkeiKvG-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2691 bytes --]

On Fri, Nov 05, 2021 at 10:10:07PM +0800, kernel test robot wrote:
> Hi Ming,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on driver-core/driver-core-testing]
> [also build test ERROR on v5.15 next-20211105]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/Ming-Lei/kobject-avoid-to-cleanup-kobject-after-module-is-unloaded/20211105-144026
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 27e0bcd02990f7291adb0f111e300f06c495d509
> config: mips-buildonly-randconfig-r003-20211105 (attached as .config)
> compiler: mipsel-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://github.com/0day-ci/linux/commit/4a9e015dd3d3e39d5723ea46579ba21f5394806a
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Ming-Lei/kobject-avoid-to-cleanup-kobject-after-module-is-unloaded/20211105-144026
>         git checkout 4a9e015dd3d3e39d5723ea46579ba21f5394806a
>         # save the attached .config to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    lib/kobject.c: In function 'kobj_module_callback':
> >> lib/kobject.c:741:20: error: 'MODULE_STATE_GOING' undeclared (first use in this function)
>      741 |         if (val != MODULE_STATE_GOING)
>          |                    ^~~~~~~~~~~~~~~~~~
>    lib/kobject.c:741:20: note: each undeclared identifier is reported only once for each function it appears in

Hello,

Thanks for the report!

This must be triggered when CONFIG_MODULES is off, and the following patch
should kill the failure:


diff --git a/lib/kobject.c b/lib/kobject.c
index f5fd6017d8ce..c054dca0001a 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -738,8 +738,10 @@ static int kobj_module_callback(struct notifier_block *nb,
 {
 	LIST_HEAD(pending);
 
+#ifdef CONFIG_MODULES
 	if (val != MODULE_STATE_GOING)
 		return NOTIFY_DONE;
+#endif
 
 	spin_lock_irq(&kobj_cleanup_lock);
 	list_splice_init(&kobj_cleanup_list, &pending);


Thanks,
Ming

WARNING: multiple messages have this Message-ID (diff)
From: Ming Lei <ming.lei@redhat.com>
To: kernel test robot <lkp@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kbuild-all@lists.01.org, Petr Mladek <pmladek@suse.com>,
	linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>,
	Joe Lawrence <joe.lawrence@redhat.com>
Subject: Re: [PATCH 2/2] kobject: wait until kobject is cleaned up before freeing module
Date: Fri, 5 Nov 2021 22:54:36 +0800	[thread overview]
Message-ID: <YYVFrJe5e1EZHyxS@T590> (raw)
In-Reply-To: <202111052230.7LkeiKvG-lkp@intel.com>

On Fri, Nov 05, 2021 at 10:10:07PM +0800, kernel test robot wrote:
> Hi Ming,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on driver-core/driver-core-testing]
> [also build test ERROR on v5.15 next-20211105]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/Ming-Lei/kobject-avoid-to-cleanup-kobject-after-module-is-unloaded/20211105-144026
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 27e0bcd02990f7291adb0f111e300f06c495d509
> config: mips-buildonly-randconfig-r003-20211105 (attached as .config)
> compiler: mipsel-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://github.com/0day-ci/linux/commit/4a9e015dd3d3e39d5723ea46579ba21f5394806a
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Ming-Lei/kobject-avoid-to-cleanup-kobject-after-module-is-unloaded/20211105-144026
>         git checkout 4a9e015dd3d3e39d5723ea46579ba21f5394806a
>         # save the attached .config to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    lib/kobject.c: In function 'kobj_module_callback':
> >> lib/kobject.c:741:20: error: 'MODULE_STATE_GOING' undeclared (first use in this function)
>      741 |         if (val != MODULE_STATE_GOING)
>          |                    ^~~~~~~~~~~~~~~~~~
>    lib/kobject.c:741:20: note: each undeclared identifier is reported only once for each function it appears in

Hello,

Thanks for the report!

This must be triggered when CONFIG_MODULES is off, and the following patch
should kill the failure:


diff --git a/lib/kobject.c b/lib/kobject.c
index f5fd6017d8ce..c054dca0001a 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -738,8 +738,10 @@ static int kobj_module_callback(struct notifier_block *nb,
 {
 	LIST_HEAD(pending);
 
+#ifdef CONFIG_MODULES
 	if (val != MODULE_STATE_GOING)
 		return NOTIFY_DONE;
+#endif
 
 	spin_lock_irq(&kobj_cleanup_lock);
 	list_splice_init(&kobj_cleanup_list, &pending);


Thanks,
Ming


  reply	other threads:[~2021-11-05 14:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05  6:37 [PATCH 0/2] kobject: avoid to cleanup kobject after module is unloaded Ming Lei
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:10     ` kernel test robot
2021-11-05 14:54     ` Ming Lei [this message]
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=YYVFrJe5e1EZHyxS@T590 \
    --to=ming.lei@redhat.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.