All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: [PATCH 13/13] Revert "locking/lockdep, cpu/hotplug: Annotate AP thread"
Date: Wed,  7 Nov 2018 16:30:19 +0100	[thread overview]
Message-ID: <20181107153019.26401-13-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20181107153019.26401-1-daniel.vetter@ffwll.ch>

This reverts commit cb92173d1f0474784c6171a9d3fdbbca0ee53554.

This commit tries to shut up lockdep complaining about a
lockdep_assert_held check in the AP cpuhp bringup threads, while the
lock is actually held by the BP thread. Which is all kinda correct,
since BP does wait for all the AP threads to finish before it releases
the cpuhp locks, through a completion.

The only problem with this somewhat fake annotion is that
cross-release sees through the fog, and rightly complains that doing
this for real would totally deadlock.

One way to fix this would be to check that anyone is currently holding
the lock, and not just the current thread. But I'm not sure that's a
good option really. Hence just revert for now, which will result in a
lockdep_assert_held splat per non-boot cpu at boot-up (and anytime you
hotplug a cpu), but at least lockdep keeps working.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: "Peter Zijlstra (Intel)" <peterz@infraded.org>
Cc: Mukesh Ojha <mojha@codeaurora.org>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 kernel/cpu.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 3c7f3b4c453c..5ff05c284425 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -315,16 +315,6 @@ void lockdep_assert_cpus_held(void)
 	percpu_rwsem_assert_held(&cpu_hotplug_lock);
 }
 
-static void lockdep_acquire_cpus_lock(void)
-{
-	rwsem_acquire(&cpu_hotplug_lock.rw_sem.dep_map, 0, 0, _THIS_IP_);
-}
-
-static void lockdep_release_cpus_lock(void)
-{
-	rwsem_release(&cpu_hotplug_lock.rw_sem.dep_map, 1, _THIS_IP_);
-}
-
 /*
  * Wait for currently running CPU hotplug operations to complete (if any) and
  * disable future CPU hotplug (from sysfs). The 'cpu_add_remove_lock' protects
@@ -354,17 +344,6 @@ void cpu_hotplug_enable(void)
 	cpu_maps_update_done();
 }
 EXPORT_SYMBOL_GPL(cpu_hotplug_enable);
-
-#else
-
-static void lockdep_acquire_cpus_lock(void)
-{
-}
-
-static void lockdep_release_cpus_lock(void)
-{
-}
-
 #endif	/* CONFIG_HOTPLUG_CPU */
 
 #ifdef CONFIG_HOTPLUG_SMT
@@ -638,12 +617,6 @@ static void cpuhp_thread_fun(unsigned int cpu)
 	 */
 	smp_mb();
 
-	/*
-	 * The BP holds the hotplug lock, but we're now running on the AP,
-	 * ensure that anybody asserting the lock is held, will actually find
-	 * it so.
-	 */
-	lockdep_acquire_cpus_lock();
 	cpuhp_lock_acquire(bringup);
 
 	if (st->single) {
@@ -689,7 +662,6 @@ static void cpuhp_thread_fun(unsigned int cpu)
 	}
 
 	cpuhp_lock_release(bringup);
-	lockdep_release_cpus_lock();
 
 	if (!st->should_run)
 		complete_ap_thread(st, bringup);
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-11-07 15:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 15:30 [PATCH 01/13] locking/lockdep: restore cross-release checks Daniel Vetter
2018-11-07 15:30 ` [PATCH 02/13] kthread: finer-grained lockdep/cross-release completion Daniel Vetter
2018-11-07 15:30 ` [PATCH 03/13] lockdep: Remove GFP_NOLOCKDEP annotation Daniel Vetter
2018-11-07 15:30 ` [PATCH 04/13] kernel/lockdep: Make cross-release a config option Daniel Vetter
2018-11-07 15:30 ` [PATCH 05/13] mm: Check if mmu notifier callbacks are allowed to fail Daniel Vetter
2018-11-07 15:30 ` [PATCH 06/13] mm, notifier: Catch sleeping/blocking for !blockable Daniel Vetter
2018-11-07 15:30 ` [PATCH 07/13] mm, notifier: Add a lockdep map for invalidate_range_start Daniel Vetter
2018-11-07 15:30 ` [PATCH 08/13] dma-fence: cross-release annotations Daniel Vetter
2018-11-07 15:30 ` [PATCH 09/13] reservation: Annotate dma_fence waits Daniel Vetter
2018-11-07 15:30 ` [PATCH 10/13] drm/i915: " Daniel Vetter
2018-11-07 15:30 ` [PATCH 11/13] drm/i915: annotate intel_atomic_commit_fence_wait Daniel Vetter
2018-11-07 15:30 ` [PATCH 12/13] HAX FOR CI: Enable cross-release Daniel Vetter
2018-11-08  9:31   ` [PATCH] " Daniel Vetter
2018-11-08  9:41     ` Chris Wilson
2018-11-20 11:00       ` Daniel Vetter
2018-11-20 10:58     ` Daniel Vetter
2018-11-22 16:35       ` Daniel Vetter
2018-11-23  8:53         ` Daniel Vetter
2018-11-23 12:45           ` Daniel Vetter
2018-11-23 13:24             ` Daniel Vetter
2018-11-07 15:30 ` Daniel Vetter [this message]
2018-11-07 16:51 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/13] locking/lockdep: restore cross-release checks Patchwork
2018-11-07 16:57 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-07 17:07 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-11-08 10:04 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/13] locking/lockdep: restore cross-release checks (rev2) Patchwork
2018-11-08 10:10 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-08 10:21 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-11-20 12:33 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/13] locking/lockdep: restore cross-release checks (rev3) Patchwork
2018-11-20 12:39 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-20 12:53 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-11-22 16:39 ` ✗ Fi.CI.BAT: failure for series starting with [01/13] locking/lockdep: restore cross-release checks (rev4) Patchwork
2018-11-23  8:57 ` ✗ Fi.CI.BAT: failure for series starting with [01/13] locking/lockdep: restore cross-release checks (rev5) Patchwork
2018-11-23 12:51 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/13] locking/lockdep: restore cross-release checks (rev6) Patchwork
2018-11-23 12:57 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-23 13:08 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-11-23 13:55 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/13] locking/lockdep: restore cross-release checks (rev7) Patchwork
2018-11-23 14:01 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-23 14:12 ` ✗ Fi.CI.BAT: failure " Patchwork

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=20181107153019.26401-13-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.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.