Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751763AbdHaVYU (ORCPT ); Thu, 31 Aug 2017 17:24:20 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:34946 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbdHaVYT (ORCPT ); Thu, 31 Aug 2017 17:24:19 -0400 Date: Thu, 31 Aug 2017 23:24:13 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Borislav Petkov , Sebastian Andrzej Siewior , lkml Subject: Re: WARNING: possible circular locking dependency detected In-Reply-To: Message-ID: References: <20170825100304.5cwrlrfwi7f3zcld@pd.tnic> <20170828145808.btuqpe2bvxymljyg@hirez.programming.kicks-ass.net> <20170829194948.GD32112@worktop.programming.kicks-ass.net> <20170830054730.GF32112@worktop.programming.kicks-ass.net> <20170831073739.ytexc7omldyb5lgy@hirez.programming.kicks-ass.net> <20170831080922.daaypuxatenmpkfo@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 31 On Thu, 31 Aug 2017, Thomas Gleixner wrote: > On Thu, 31 Aug 2017, Peter Zijlstra wrote: > > > On Thu, Aug 31, 2017 at 09:55:57AM +0200, Thomas Gleixner wrote: > > > > Arghh!!! > > > > > > > > And allowing us to create events for offline CPUs (possible I think, but > > > > maybe slightly tricky) won't solve that, because we're already holding > > > > the hotplug_lock during PREPARE. > > > > > > There are two ways to cure that: > > > > > > 1) Have a pre cpus_write_lock() stage which is serialized via > > > cpus_add_remove_lock, which is the outer lock for hotplug. > > > > > > There we can sanely create stuff and fail with all consequences. > > > > True, if you're willing to add more state to that hotplug thing I'll try > > and make that perf patch that allows attaching to offline CPUs. > > Now that I think more about it. That's going to be an interesting exercise > vs. the hotplug state registration which relies on cpus_read_lock() > serialization..... We could have that for built-in stuff which is guaranteed to be never unregistered. Pretty restricted, but for cases like that it could work. Famous last work ... Thanks, tglx