Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5163941ybl; Wed, 22 Jan 2020 11:30:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzVcB5GhKGMjUo7xkMTgfC4DFLdxCghFramYdkiDHMmbzhFgIUOg3oasy6eLYD5ypAtwcPl X-Received: by 2002:aca:d5d3:: with SMTP id m202mr7637938oig.161.1579721437118; Wed, 22 Jan 2020 11:30:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579721437; cv=none; d=google.com; s=arc-20160816; b=GVj54aIM9Rrz91IQYHgdj6Kc42/fEI+2KKPCmX4Sn7wvnoRQsQ+UMWV9wz3CYU2dfs TAbnD6XaOQo2OQWyU30z5t0GdXxspfUgv+M1BTfv91t2ExJc8VJFTmVhdhfNawYXRFCc C9Zq1MeZd5kEbwUpwFc0aDM62ZFzS/8huJe6jfEYs88tE+EUCYgRGr5vaD7WAjxMpBf8 rzxVYgw4kfzbJ1Fw0Yeh7S4WyNPSgsncN7A7fRKijy8+xiPOLgJ6+sn5pFBSkLdXQ/0x JLLoeukhPd3mnSPdh8FsnxM8ty/ki93s9uOclDk8pX7tnuk86ncbDdkkgTv7tB/Scmo4 9xbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Hg8qzIMUbkIDJeeIgu3Fl+ttNVjIefmIRVWaOSIFDj4=; b=uiTK9Xgl36kliezshjzsPRE6jA99nyMdfQZTT7MIHZVKIhSbVtL0awGQ7qRoWhcy9z me6i5NA1bUiHx8BEeTAy2RRACuxdZzJp0Junv9/HrRDfHJVpi23xtkpctxUYxvZemUX5 qSUDzu7N5K7V9EURXefHutGLLg4fIPZ5oayAslG0FDjWLcoNJtfiM99FF4FcfT/75pil HyW/mmLspYU4yRdfNj29kQox1APag/GcyH8SFytLlWrKoVm8Onl9U+vtUcXGBp2h8vQa r1imhFhtvVTaIthc+1koRtMlJwKQp8T8OalFGqYil8DkfK4rJyjOv4iYCuBZuMOVZq1L Rsig== 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 u18si27784544otg.201.2020.01.22.11.30.23; Wed, 22 Jan 2020 11:30:37 -0800 (PST) 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 S1726227AbgAVT3R (ORCPT + 99 others); Wed, 22 Jan 2020 14:29:17 -0500 Received: from charlotte.tuxdriver.com ([70.61.120.58]:46775 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbgAVT3Q (ORCPT ); Wed, 22 Jan 2020 14:29:16 -0500 Received: from [62.209.224.147] (helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1iuLgR-0005vX-EF; Wed, 22 Jan 2020 14:29:06 -0500 Date: Wed, 22 Jan 2020 14:28:56 -0500 From: Neil Horman To: Thomas Gleixner Cc: l00520965 , linfeilong@huawei.com, hushiyuan@huawei.com, linux-kernel@vger.kernel.org, PJ Waskiewicz Subject: Re: [RFC] irq: Skip printing irq when desc->action is null even if any_count is not zero Message-ID: <20200122192856.GA2852@localhost.localdomain> References: <20200121130959.22589-1-liuchao173@huawei.com> <87k15jek6v.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k15jek6v.fsf@nanos.tec.linutronix.de> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Score: -2.9 (--) X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 22, 2020 at 01:42:48PM +0100, Thomas Gleixner wrote: > Chao, > > l00520965 writes: > > > When desc->action is empty, there is no need to print out the irq and its' > > count in each cpu. The desc is not alloced in request_irq or freed in > > free_irq. > > request/free_irq() never allocate/free irq descriptors. > > > So some PCI devices, such as rtl8139, uses request_irq and free_irq, > > All PCI devices use some variant of request_irq()/free_irq(). The > interrupt descriptors are allocated by the underlying PCI > machinery. They are only allocated/freed when the device driver is > loaded/removed. > > And this property exists for _ALL_ interrupts independent of PCI. > > > which only modify the action of desc. So /proc/interrupts could be > > like this: > > I think you want to explain: > > If an interrupt is released via free_irq() without removing the > underlying irq descriptor, the interrupt count of the irq descriptor > is not reset. /proc/interrupt shows such interrupts with an empty > action handler name: > > > CPU0 CPU1 > > 38: 46 0 GICv3 36 Level ehci_hcd:usb1 > > 39: 66 0 GICv3 37 Level > > irqbalance fails to detect that this interrupt is not longer in use > and parses the last word in the line 'Level' as the action handler > name. > > > Irqbalance gets the list of interrupts according to /proc/interrupts. In > > this case, irqbalance does not remove the interrupt from the balance list, > > and the last string in this line,which is Level, is used as irq_name. > > Right, this is historic behaviour and I don't know how irqbalance dealt > with that in the past 20+ years. At least I haven't seen any complaints. > > I'm not opposed to suppress the output, but I really want the opinion of > the irqbalance maintainers on that. > Actually, irqbalance ignores the trailing irq name (or it should at least), so you should be able to drop that portion of /proc/irqbalance, though I cant speak for any other users of it. > > Or we can clear desc->kstat_irqs in each cpu in free_irq when > > desc->action is null? > > No, we can't. The historic behaviour is that the total interrupt count > for a device is maintained independent of the number of > request/free_irq() pairs. > > > Signed-off-by: LiuChao > > Reviewed-by: Thomas Gleixner > > I really can't remember that I have reviewed this patch already. Please > don't add tags which claim that some one has reviewed or acked your > patch unless you really got that Reviewed-by or Acked-by from that > person. > > Thanks, > > tglx >