Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2812829imm; Sun, 24 Jun 2018 05:13:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIiWU7dk2fxIZf/Kmb9AmRhCLUi3ujsmmIb7JSBQjTQalwHe0FmIajIXIug+lfVCGzbd4zv X-Received: by 2002:a17:902:26:: with SMTP id 35-v6mr8500982pla.276.1529842432781; Sun, 24 Jun 2018 05:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529842432; cv=none; d=google.com; s=arc-20160816; b=e/iSz0dbxgUZIqzchS1HQSW9clk2Ov+phdp4KTbljJAsy4+V47cipxFfN9iiw6koC3 IlDRVa21aFNieU8dMv9yjA0z48/XBCCrFewPkuiMZ8rXGJ54dpOBr3IedoNC6Yh1ilkK iY/82O9N7Q8xIzbRYoBZfX2Jfhub1UBJ6PWQ2Dcr6oIkS4n/Br12QG+MqBUJd77PxbRL Vg3eWgMGbrVibDWu6do7lMDdva9nixMy49JqSc6tNWlHQwi+OYm9M+lUEBOeDL4wDPAP nGK4YNuAB6Ja0cn5WGvt01Ijfw9a1PqizEt4Oz8ecGmMf1aUy/CmB1x1L7m2DwWc+TH3 J8Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=c8bhoJVWEUnHzS5raLKvWNsqW9lYICOvAg27KvwF2RU=; b=O6CjN6DqqeqQttlC3HJIBfJEJx+eM+rm7Ub4fx+kNafZBINkCeyZGZDQ/py52Zpiwf C5R0uC85y2scTLdie40EJVS+yDbFaJp2gyWj+vWUBbLJ6R6y33V7J+iv5o6BjqDd3OD3 7UNcq3hr7R2WO1mhs5PIYZQU8XHqojCnaLGfL4d9nvirbF7T4yxrDssIwDuaethuF5CE 5HjxGrlWFdNFdYBU1sXIsm9nodw510TZvoB0oE1RYmslGbs6X/qZVCJ/3wPIgKZiRLhw PXB6SehpU5hJR+W3OutulgFsGBz3JlmOTyRYSamBhFmuwlzbSZZ6ubJyEBKZBskzI5gn TlbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6-v6si9526061pgq.18.2018.06.24.05.13.36; Sun, 24 Jun 2018 05:13:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751796AbeFXMMz (ORCPT + 99 others); Sun, 24 Jun 2018 08:12:55 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:44883 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbeFXMMy (ORCPT ); Sun, 24 Jun 2018 08:12:54 -0400 Received: from p4fea482e.dip0.t-ipconnect.de ([79.234.72.46] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fX3sw-0004pw-8Z; Sun, 24 Jun 2018 14:12:50 +0200 Date: Sun, 24 Jun 2018 14:12:49 +0200 (CEST) From: Thomas Gleixner To: Lukas Wunner cc: Bjorn Helgaas , Mika Westerberg , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH v2 2/2] genirq: Synchronize only with single thread on free_irq() In-Reply-To: <20180624113403.GA22016@wunner.de> Message-ID: References: <32fc25aa35ecef4b2692f57687bb7fc2a57230e2.1529828292.git.lukas@wunner.de> <20180624113403.GA22016@wunner.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 24 Jun 2018, Lukas Wunner wrote: > On Sun, Jun 24, 2018 at 11:49:10AM +0200, Thomas Gleixner wrote: > > On Sun, 24 Jun 2018, Lukas Wunner wrote: > > > When pciehp is converted to threaded IRQ handling, removal of unplugged > > > devices below a PCIe hotplug port happens synchronously in the IRQ > > > thread. Removal of devices typically entails a call to free_irq() by > > > their drivers. > > > > Is this an actual mainline problem or did you discover that in course of > > upcoming work? > > It's needed for upcoming work, specifically the pciehp event handling > rework which will hopefully appear in 4.19, so nothing urgent. > Doesn't hurt at all to let this bake in linux-next for a few weeks. Good. > There is something else, you introduced irq_wake_thread() four years ago > with a92444c6b222 for sdhci/sdio, but for some reason it was never used. > Before you or anyone else deletes it for lack of callers, please be aware > that I'm making heavy use of it now in pciehp. Ha! I was looking at it yesterday for unrelated reasons and was wondering about the huge amount of users .... > I forgot to cc you on the relevant patch [17/32], but I'll bounce it to > you in a minute in case you want to take a look at it. Sure > Of course this begs the question how irq_wake_thread() is serialized > against __free_irq(), but it seems that's safe because irq_wake_thread() > searches the action list while holding desc->lock: If it grabs the lock > before __free_irq(), it'll just wake the thread normally. If it grabs > the lock after __free_irq(), the action will be gone from the list, > so irq_wake_thread() essentially becomes a no-op. Exactly. Thanks, tglx