All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Expose the irq_desc node in proc/irq
@ 2009-12-11 16:25 Dimitri Sivanich
  2009-12-11 22:11 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Dimitri Sivanich @ 2009-12-11 16:25 UTC (permalink / raw
  To: linux-kernel
  Cc: akpm, Peter P Waskiewicz Jr, Arjan van de Ven, Eric W. Biederman,
	Thomas Gleixner, Peter Zijlstra, Ingo Molnar, Siddha, Suresh B,
	Yinghai Lu, H. Peter Anvin, David Miller, Jesse Barnes

Expose the irq_desc node as /proc/irq/*/node.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>

---

 kernel/irq/proc.c |   23 +++++++++++++++++++++++
 1 file changed, 23 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-11 10:15:28.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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Expose the irq_desc node in proc/irq
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2009-12-11 22:11 UTC (permalink / raw
  To: Dimitri Sivanich
  Cc: linux-kernel, Peter P Waskiewicz Jr, Arjan van de Ven,
	Eric W. Biederman, Thomas Gleixner, Peter Zijlstra, Ingo Molnar,
	Siddha, Suresh B, Yinghai Lu, H. Peter Anvin, David Miller,
	Jesse Barnes

On Fri, 11 Dec 2009 10:25:32 -0600
Dimitri Sivanich <sivanich@sgi.com> wrote:

> Expose the irq_desc node as /proc/irq/*/node.
> 

:(

If the changelog provides no reason for the change, the recipient has
no reason to apply the patch.

>
> ...
> +	return single_open(file, irq_node_proc_show,  PDE(inode)->data);

I'd have expected checkpatch to complain about the double-space, but it
doesn't.

> ...
>  	/* 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,

This should be documented in Documentation/filesystems/proc.txt,
alongside smp_affinity.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Expose the irq_desc node in proc/irq
  2009-12-11 22:11 ` Andrew Morton
@ 2009-12-12 11:51   ` Dimitri Sivanich
  0 siblings, 0 replies; 3+ messages in thread
From: Dimitri Sivanich @ 2009-12-12 11:51 UTC (permalink / raw
  To: Andrew Morton
  Cc: linux-kernel, Peter P Waskiewicz Jr, Arjan van de Ven,
	Eric W. Biederman, Thomas Gleixner, Peter Zijlstra, Ingo Molnar,
	Siddha, Suresh B, Yinghai Lu, H. Peter Anvin, David Miller,
	Jesse Barnes

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).
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-12 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.