From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751331AbdIPPDA (ORCPT ); Sat, 16 Sep 2017 11:03:00 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:47899 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbdIPPC7 (ORCPT ); Sat, 16 Sep 2017 11:02:59 -0400 Date: Sat, 16 Sep 2017 17:02:34 +0200 (CEST) From: Thomas Gleixner To: YASUAKI ISHIMATSU cc: Kashyap Desai , Hannes Reinecke , Marc Zyngier , Christoph Hellwig , axboe@kernel.dk, mpe@ellerman.id.au, keith.busch@intel.com, peterz@infradead.org, LKML , linux-scsi@vger.kernel.org, Sumit Saxena , Shivasharan Srikanteshwara Subject: Re: system hung up when offlining CPUs In-Reply-To: Message-ID: References: <20170809124213.0d9518bb@why.wild-wind.fr.eu.org> <20170821131809.GA17564@lst.de> <8e0d76cd-7cd4-3a98-12ba-815f00d4d772@gmail.com> <2f2ae1bc-4093-d083-6a18-96b9aaa090c9@gmail.com> <8cb26204cb5402824496bbb6b636e0af@mail.gmail.com> <3ce6837a-9aba-0ff4-64b9-7ebca5afca13@gmail.com> 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 On Sat, 16 Sep 2017, Thomas Gleixner wrote: > On Thu, 14 Sep 2017, YASUAKI ISHIMATSU wrote: > > Here are one irq's info of megasas: > > > > - Before offline CPU > > /proc/irq/70/smp_affinity_list > > 24-29 > > > > /proc/irq/70/effective_affinity > > 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,3f000000 > > > > /sys/kernel/debug/irq/irqs/70 > > handler: handle_edge_irq > > status: 0x00004000 > > istate: 0x00000000 > > ddepth: 0 > > wdepth: 0 > > dstate: 0x00609200 > > IRQD_ACTIVATED > > IRQD_IRQ_STARTED > > IRQD_MOVE_PCNTXT > > IRQD_AFFINITY_SET > > IRQD_AFFINITY_MANAGED > > So this uses managed affinity, which means that once the last CPU in the > affinity mask goes offline, the interrupt is shut down by the irq core > code, which is the case: > > > dstate: 0x00a39000 > > IRQD_IRQ_DISABLED > > IRQD_IRQ_MASKED > > IRQD_MOVE_PCNTXT > > IRQD_AFFINITY_SET > > IRQD_AFFINITY_MANAGED > > IRQD_MANAGED_SHUTDOWN <--------------- > > So the irq core code works as expected, but something in the > driver/scsi/block stack seems to fiddle with that shut down queue. > > I only can tell about the inner workings of the irq code, but I have no > clue about the rest. Though there is something wrong here: > affinity: 24-29 > effectiv: 24-29 and after offlining: > affinity: 29 > effectiv: 29 But that should be: affinity: 24-29 effectiv: 29 because the irq core code preserves 'affinity'. It merily updates 'effective', which is where your interrupts are routed to. Is the driver issuing any set_affinity() calls? If so, that's wrong. Which driver are we talking about? Thanks, tglx