From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754709AbcIIMmX (ORCPT ); Fri, 9 Sep 2016 08:42:23 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:48486 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753033AbcIIMmU (ORCPT ); Fri, 9 Sep 2016 08:42:20 -0400 Date: Fri, 9 Sep 2016 14:39:54 +0200 (CEST) From: Thomas Gleixner To: Craig Gallek cc: Randy Dunlap , David Decotigny , LKML Subject: Re: [PATCH v3] genirq: Machine-parsable version of /proc/interrupts In-Reply-To: Message-ID: References: <1473356083-14601-1-git-send-email-kraigatgoog@gmail.com> <1473366347-142493-1-git-send-email-kraigatgoog@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 8 Sep 2016, Craig Gallek wrote: > On Thu, Sep 8, 2016 at 6:00 PM, Randy Dunlap wrote: > > On 09/08/16 13:25, Craig Gallek wrote: > >> From: Craig Gallek > >> > >> Add struct kobject to struct irq_desc to allow for easy export > >> to sysfs. This allows for much simpler userspace-parsing of > >> the information contained in struct irq_desc. > >> > >> Note that sysfs is not available at the time of early irq initialization. > >> These interrupts are accounted for using a postcore_initcall callback. > >> > >> Examples: > >> /sys/kernel/irq/18/actions: i801_smbus,ehci_hcd:usb1,uhci_hcd:usb7 > >> /sys/kernel/irq/18/chip_name: IR-IO-APIC > >> /sys/kernel/irq/18/hwirq: 18 > >> /sys/kernel/irq/18/name: fasteoi > >> /sys/kernel/irq/18/per_cpu_count: 0,0 > >> /sys/kernel/irq/18/type: level > >> > >> /sys/kernel/irq/25/actions: ahci0 > >> /sys/kernel/irq/25/chip_name: IR-PCI-MSI > >> /sys/kernel/irq/25/hwirq: 512000 > >> /sys/kernel/irq/25/name: edge > >> /sys/kernel/irq/25/per_cpu_count: 29036,0 > >> /sys/kernel/irq/25/type: edge > > > > Thanks for the update. > > > > One concern: > > > > This per_cpu_count is for online CPUs only. > > How does this help when the online CPUs change? > > > > E.g., above could be for CPUs 1 and 5. > > The next time that it is read it could be for CPUs 0 and 3. > > Seems that it could be confusing even for software reading it. > > Thanks for the feedback. I imagine most use cases for this will simply > add up all the values to obtain a total. There's not a lot of use for > the individual elements unless you additionally know something about > the CPU id layout, interrupt pinning, and/or CPU online state. The > /proc/interrupts interface has this same issue, but additionally uses > column headers. There's really know way to give a similar consistent > view of all of this data using multiple sysfs files. Given this lack > of atomicity, across files, I don't think it's unreasonable for the > counter order to change when the system's online CPUs change. Can you please spell that out in the documentation? Thanks, tglx