From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64D05C388F9 for ; Sat, 21 Nov 2020 10:57:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B93422240 for ; Sat, 21 Nov 2020 10:57:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LvrqpzvF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wLDMdlXt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbgKUKzv (ORCPT ); Sat, 21 Nov 2020 05:55:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727241AbgKUKzv (ORCPT ); Sat, 21 Nov 2020 05:55:51 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBC7C0613CF for ; Sat, 21 Nov 2020 02:55:50 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605956148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BCkWsAO8HdXHPUv8yMTxZeqvlxBLR/7KyglJTpA140M=; b=LvrqpzvFMxfGQrnOYU6RV8401R0k3mk35JAMQiXO+6FgKtmDIHQ6lw+iWlnc18A/zH1tA4 gTKCx146Zo1QGNGfohFBfZWNWAVPoSmkX/mr4cGE/m/q/6YD05hwhUFnRbXLD/lQNRnAmz pqciF1Bi5Cy8EKzuic+hvFkrW5xe+Bzsd6ZPa25E4KsPKIbtzVEw2xS0mYkQGZ0eKUsHs/ MndscG0bgF5eZgIY+9v79ZBjC29EAk7fQ8SzrVC5linarRRmhJ+wmlOmw5dbV7h9FBH0L1 eJ+P2LV9ZRPWnMRT5MtQNmo9wOOXRMtGBlBRtmw2IJCursyBzyIkLjLezABmvw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605956148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BCkWsAO8HdXHPUv8yMTxZeqvlxBLR/7KyglJTpA140M=; b=wLDMdlXtFR+13DEhxVJ7xMQSFCXDvvzENNBd12lIPcVYscOSugCSuX5Vqcw7N+odBzd/Kc ieqmFDQVKZGA5cAg== To: Peter Zijlstra , Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, Ben Skeggs , Mike Galbraith , Greg Kroah-Hartman Subject: Re: [PATCH 1/2] kthread: Move prio/affinite change into the newly created thread In-Reply-To: <20201117124503.GI3121406@hirez.programming.kicks-ass.net> References: <20201110113848.801379-1-bigeasy@linutronix.de> <20201110113848.801379-2-bigeasy@linutronix.de> <20201117124503.GI3121406@hirez.programming.kicks-ass.net> Date: Sat, 21 Nov 2020 11:55:48 +0100 Message-ID: <87a6vbnfm3.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17 2020 at 13:45, Peter Zijlstra wrote: > On Tue, Nov 10, 2020 at 12:38:47PM +0100, Sebastian Andrzej Siewior wrote: > > Moo... yes this is certainly the easiest solution, because nouveau is a > horrible rats nest. But when I spoke to Greg KH about this, he suggested > nouveau ought to be fixed. > > Ben, I got terminally lost when trying to untangle nouvea init, is there > any chance this can be fixed to not hold that nvkm_device::mutex thing > while doing request_irq() ? OTOH, creating a dependency chain vs. cpuset_rwsem and whatever lock is held by the caller via request_irq() or kthread_create() is not necessarily restricted to the nivea driver. struct device::mutex (not the nkvm_device::mutex) is always held when a driver is probed. The cpuset_rwsem -> mmap_lock dependency is a given, so we're one step away from a circular dependency vs. mmap_lock. That was my reasoning to move the stuff out into the thread context. Thanks, tglx