aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2011-05-24 20:13:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 11:39:45 -0400
commit4b060420a596095869a6d7849caa798d23839cd1 (patch)
treeebbbc25555d0358f73527f114f78691ac849ce3e /include
parente50c1f609c63223adaa38f5a79b18759a00adf72 (diff)
bitmap, irq: add smp_affinity_list interface to /proc/irq
Manually adjusting the smp_affinity for IRQ's becomes unwieldy when the cpu count is large. Setting smp affinity to cpus 256 to 263 would be: echo 000000ff,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > smp_affinity instead of: echo 256-263 > smp_affinity_list Think about what it looks like for cpus around say, 4088 to 4095. We already have many alternate "list" interfaces: /sys/devices/system/cpu/cpuX/indexY/shared_cpu_list /sys/devices/system/cpu/cpuX/topology/thread_siblings_list /sys/devices/system/cpu/cpuX/topology/core_siblings_list /sys/devices/system/node/nodeX/cpulist /sys/devices/pci***/***/local_cpulist Add a companion interface, smp_affinity_list to use cpu lists instead of cpu maps. This conforms to other companion interfaces where both a map and a list interface exists. This required adding a bitmap_parselist_user() function in a manner similar to the bitmap_parse_user() function. [akpm@linux-foundation.org: make __bitmap_parselist() static] Signed-off-by: Mike Travis <travis@sgi.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jack Steiner <steiner@sgi.com> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bitmap.h5
-rw-r--r--include/linux/cpumask.h15
2 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index daf8c480c786..dcafe0bf0005 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -55,7 +55,8 @@
55 * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf 55 * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf
56 * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf 56 * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf
57 * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf 57 * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf
58 * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list 58 * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf
59 * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf
59 * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region 60 * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region
60 * bitmap_release_region(bitmap, pos, order) Free specified bit region 61 * bitmap_release_region(bitmap, pos, order) Free specified bit region
61 * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region 62 * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region
@@ -129,6 +130,8 @@ extern int bitmap_scnlistprintf(char *buf, unsigned int len,
129 const unsigned long *src, int nbits); 130 const unsigned long *src, int nbits);
130extern int bitmap_parselist(const char *buf, unsigned long *maskp, 131extern int bitmap_parselist(const char *buf, unsigned long *maskp,
131 int nmaskbits); 132 int nmaskbits);
133extern int bitmap_parselist_user(const char __user *ubuf, unsigned int ulen,
134 unsigned long *dst, int nbits);
132extern void bitmap_remap(unsigned long *dst, const unsigned long *src, 135extern void bitmap_remap(unsigned long *dst, const unsigned long *src,
133 const unsigned long *old, const unsigned long *new, int bits); 136 const unsigned long *old, const unsigned long *new, int bits);
134extern int bitmap_bitremap(int oldbit, 137extern int bitmap_bitremap(int oldbit,
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index bae6fe24d1f9..b24ac56477b4 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -547,6 +547,21 @@ static inline int cpumask_parse_user(const char __user *buf, int len,
547} 547}
548 548
549/** 549/**
550 * cpumask_parselist_user - extract a cpumask from a user string
551 * @buf: the buffer to extract from
552 * @len: the length of the buffer
553 * @dstp: the cpumask to set.
554 *
555 * Returns -errno, or 0 for success.
556 */
557static inline int cpumask_parselist_user(const char __user *buf, int len,
558 struct cpumask *dstp)
559{
560 return bitmap_parselist_user(buf, len, cpumask_bits(dstp),
561 nr_cpumask_bits);
562}
563
564/**
550 * cpulist_scnprintf - print a cpumask into a string as comma-separated list 565 * cpulist_scnprintf - print a cpumask into a string as comma-separated list
551 * @buf: the buffer to sprintf into 566 * @buf: the buffer to sprintf into
552 * @len: the length of the buffer 567 * @len: the length of the buffer