From: Dimitri Sivanich <sivanich@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>,
Arjan van de Ven <arjan@infradead.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>,
"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
Yinghai Lu <yinghai@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
David Miller <davem@davemloft.net>,
Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH] Expose the irq_desc node in proc/irq
Date: Sat, 12 Dec 2009 05:51:48 -0600 [thread overview]
Message-ID: <20091212115148.GA13122@sgi.com> (raw)
In-Reply-To: <20091211141158.5da226a8.akpm@linux-foundation.org>
Expose the irq_desc node as /proc/irq/*/node.
This file provides device hardware locality information for apps desiring to
include hardware locality in irq mapping decisions.
Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
---
Documentation/filesystems/proc.txt | 4 ++++
kernel/irq/proc.c | 23 +++++++++++++++++++++++
2 files changed, 27 insertions(+)
Index: linux/kernel/irq/proc.c
===================================================================
--- linux.orig/kernel/irq/proc.c 2009-12-11 10:09:31.000000000 -0600
+++ linux/kernel/irq/proc.c 2009-12-12 05:25:51.000000000 -0600
@@ -146,6 +146,26 @@ static const struct file_operations defa
.release = single_release,
.write = default_affinity_write,
};
+
+static int irq_node_proc_show(struct seq_file *m, void *v)
+{
+ struct irq_desc *desc = irq_to_desc((long) m->private);
+
+ seq_printf(m, "%d\n", desc->node);
+ return 0;
+}
+
+static int irq_node_proc_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, irq_node_proc_show, PDE(inode)->data);
+}
+
+static const struct file_operations irq_node_proc_fops = {
+ .open = irq_node_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
#endif
static int irq_spurious_proc_show(struct seq_file *m, void *v)
@@ -230,6 +250,9 @@ void register_irq_proc(unsigned int irq,
/* create /proc/irq/<irq>/smp_affinity */
proc_create_data("smp_affinity", 0600, desc->dir,
&irq_affinity_proc_fops, (void *)(long)irq);
+
+ proc_create_data("node", 0444, desc->dir,
+ &irq_node_proc_fops, (void *)(long)irq);
#endif
proc_create_data("spurious", 0444, desc->dir,
Index: linux/Documentation/filesystems/proc.txt
===================================================================
--- linux.orig/Documentation/filesystems/proc.txt 2009-12-09 09:42:46.000000000 -0600
+++ linux/Documentation/filesystems/proc.txt 2009-12-12 05:39:52.000000000 -0600
@@ -558,6 +558,10 @@ The default_smp_affinity mask applies to
IRQs which have not yet been allocated/activated, and hence which lack a
/proc/irq/[0-9]* directory.
+The node file on an SMP system shows the node to which the device using the IRQ
+reports itself as being attached. This hardware locality information does not
+include information about any possible driver locality preference.
+
prof_cpu_mask specifies which CPUs are to be profiled by the system wide
profiler. Default value is ffffffff (all cpus).
prev parent reply other threads:[~2009-12-12 11:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-11 16:25 [PATCH] Expose the irq_desc node in proc/irq Dimitri Sivanich
2009-12-11 22:11 ` Andrew Morton
2009-12-12 11:51 ` Dimitri Sivanich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091212115148.GA13122@sgi.com \
--to=sivanich@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=peterz@infradead.org \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox