From patchwork Wed Nov 7 15:30:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10672579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54A4C109C for ; Wed, 7 Nov 2018 15:30:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44AA12C6C5 for ; Wed, 7 Nov 2018 15:30:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4310A2C6C1; Wed, 7 Nov 2018 15:30:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C02FC2C663 for ; Wed, 7 Nov 2018 15:30:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47A096E1A4; Wed, 7 Nov 2018 15:30:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id DBF486E1D2 for ; Wed, 7 Nov 2018 15:30:43 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id h21-v6so13297006edq.9 for ; Wed, 07 Nov 2018 07:30:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=whNjJHX/SpsRomJ0kd7GfURnQr4HngzYncFsffwGZ6g=; b=TuK/3+Gpj4fnoF9QKEdED2z7me/ItWJbKVaVFaA0jZpI6NxBBLt+5R3cjEvbjPWqni IGjUL3i2JYlrE66E/nUDp9j93pacDLtknIRyd96ApD3py/cxf8xi3UUUGPle8H0T1uua jJNaM88F4yVzHl3V0BRwSRuU0UnruHcj1kC8R0MEO0HLiOkNAHo5rHdf4eT+fuE1plsi O49txCAbJbQWAxX1ejLastXjhUMwtojKS9uTSJ/cZDrO3ma3lBTinjBJOTcnRQvS6y0c ES4FKaScOug4sUgF5fjfcB7luwRTZ06+PjdhXoTluU4EI5vOHTqJBUvUhghlI+y0vXdl XMLQ== X-Gm-Message-State: AGRZ1gJ1DikAovRxczPa4cXB2KqHl8ENAsTYrQ4hiTcr4HpORDcH4EnQ ZLMLuAAXHQwU3sZqlU7q4vZz5ZQa5vc= X-Google-Smtp-Source: AJdET5c7Gkf5ZIwoKvhZRRAC69kCViIsOwyJVcPygu9KsNuynSHjxMHE4/D7FPeWL+A7ZoTY3HOM4g== X-Received: by 2002:a50:a506:: with SMTP id y6-v6mr565930edb.250.1541604642159; Wed, 07 Nov 2018 07:30:42 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id b48-v6sm322425edb.27.2018.11.07.07.30.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 07:30:41 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 7 Nov 2018 16:30:19 +0100 Message-Id: <20181107153019.26401-13-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181107153019.26401-1-daniel.vetter@ffwll.ch> References: <20181107153019.26401-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 13/13] Revert "locking/lockdep, cpu/hotplug: Annotate AP thread" X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Konrad Rzeszutek Wilk Cc: Josh Poimboeuf Cc: "Peter Zijlstra (Intel)" Cc: Mukesh Ojha Cc: Jiri Kosina Cc: Peter Zijlstra Cc: Lai Jiangshan Cc: Daniel Vetter Cc: Arnd Bergmann --- 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);