mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: Peter Zijlstra <peterz@infradead.org>,
	mingo@kernel.org, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org,
	Byungchul Park <max.byungchul.park@gmail.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [PATCH 2/2] smp/hotplug,lockdep: Annotate cpuhp_state
Date: Tue, 05 Sep 2017 14:59:21 +0200	[thread overview]
Message-ID: <1504616361.6605.27.camel@gmx.de> (raw)
In-Reply-To: <20170905075351.745979795@infradead.org>

Mm, wants a build bandaid for !CONFIG_LOCKDEP

kernel/cpu.c: In function ‘_cpu_down’:
kernel/cpu.c:720:43: error: ‘cpuhp_state_down_key’ undeclared (first use in this function)
  lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-down",
                                           ^
kernel/cpu.c:720:43: note: each undeclared identifier is reported only once for each function it appears in
kernel/cpu.c: In function ‘_cpu_up’:
kernel/cpu.c:836:41: error: ‘cpuhp_state_up_key’ undeclared (first use in this function)
  lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-up",
                                         ^
scripts/Makefile.build:311: recipe for target 'kernel/cpu.o' failed
make[1]: *** [kernel/cpu.o] Error 1
Makefile:1666: recipe for target 'kernel/cpu.o' failed
make: *** [kernel/cpu.o] Error 2

(mine below, fold or vaporize as you see fit)

---
 kernel/cpu.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -545,7 +545,7 @@ void __init cpuhp_threads_init(void)
  * Must be macro to ensure we have two different call sites.
  */
 #ifdef CONFIG_LOCKDEP
-#define lockdep_reinit_st_done()				\
+#define lockdep_reinit_st_done(up)				\
 do {								\
 	int __cpu;						\
 	for_each_possible_cpu(__cpu) {				\
@@ -553,9 +553,17 @@ do {								\
 			per_cpu_ptr(&cpuhp_state, __cpu);	\
 		init_completion(&st->done);			\
 	}							\
+	if (up)							\
+		lockdep_init_map(&cpuhp_state_lock_map,		\
+				 "cpuhp_state-up",		\
+				 &cpuhp_state_up_key, 0);	\
+	else							\
+		lockdep_init_map(&cpuhp_state_lock_map,		\
+				 "cpuhp_state-down",		\
+				 &cpuhp_state_down_key, 0);	\
 } while(0)
 #else
-#define lockdep_reinit_st_done()
+#define lockdep_reinit_st_done(up)
 #endif
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -716,9 +724,7 @@ static int __ref _cpu_down(unsigned int
 
 	cpus_write_lock();
 
-	lockdep_reinit_st_done();
-	lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-down",
-			 &cpuhp_state_down_key, 0);
+	lockdep_reinit_st_done(0);
 
 	cpuhp_tasks_frozen = tasks_frozen;
 
@@ -832,9 +838,7 @@ static int _cpu_up(unsigned int cpu, int
 
 	cpus_write_lock();
 
-	lockdep_reinit_st_done();
-	lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-up",
-			 &cpuhp_state_up_key, 0);
+	lockdep_reinit_st_done(1);
 
 	if (!cpu_present(cpu)) {
 		ret = -EINVAL;

  reply	other threads:[~2017-09-05 13:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05  7:52 [PATCH 0/2] smp/hotplug annotations Peter Zijlstra
2017-09-05  7:52 ` [PATCH 1/2] smp/hotplug,lockdep: Annotate st->done Peter Zijlstra
2017-09-05  7:52 ` [PATCH 2/2] smp/hotplug,lockdep: Annotate cpuhp_state Peter Zijlstra
2017-09-05 12:59   ` Mike Galbraith [this message]
2017-09-19 17:57   ` Paul E. McKenney
2017-09-05 13:31 ` [PATCH 0/2] smp/hotplug annotations Thomas Gleixner
2017-09-05 13:36   ` Thomas Gleixner
2017-09-06 17:08     ` Peter Zijlstra

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=1504616361.6605.27.camel@gmx.de \
    --to=efault@gmx.de \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.byungchul.park@gmail.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome