summaryrefslogtreecommitdiffstats
path: root/include/sys/debug.h
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-11-03 20:07:20 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-11-03 20:07:20 +0000
commitf6c81c5ea7ba171bdb9e6d3a29c9e2a7fa6896ad (patch)
tree4e4d7df1467f05d66f63d8302736aff4d3966344 /include/sys/debug.h
parentd50bd9e22179ec4c687bcb0d296a90c8039eeaae (diff)
Reviewed and applied spl-01-rm-gpl-symbol-set_cpus_allowed.patch
from Ricardo which removes a dependency on the GPL-only symbol set_cpus_allowed(). Using this symbol is simpler but in the name of portability we are adopting a spinlock based solution here to remove this dependency. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@160 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/sys/debug.h')
-rw-r--r--include/sys/debug.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/sys/debug.h b/include/sys/debug.h
index 41ce043fe..1c25083f3 100644
--- a/include/sys/debug.h
+++ b/include/sys/debug.h
@@ -157,6 +157,15 @@ union trace_data_union {
unsigned short tcd_type;
/* The factors to share debug memory. */
unsigned short tcd_pages_factor;
+
+ /*
+ * This spinlock is needed to workaround the problem of
+ * set_cpus_allowed() being GPL-only. Since we cannot
+ * schedule a thread on a specific CPU when dumping the
+ * pages, we must use the spinlock for mutual exclusion.
+ */
+ spinlock_t tcd_lock;
+ unsigned long tcd_lock_flags;
} tcd;
char __pad[L1_CACHE_ALIGN(sizeof(struct trace_cpu_data))];
};
@@ -168,9 +177,9 @@ extern union trace_data_union (*trace_data[TCD_TYPE_MAX])[NR_CPUS];
for (j = 0, ((tcd) = &(*trace_data[i])[j].tcd); \
j < num_possible_cpus(); j++, (tcd) = &(*trace_data[i])[j].tcd)
-#define tcd_for_each_type_lock(tcd, i) \
+#define tcd_for_each_type_lock(tcd, i, cpu) \
for (i = 0; trace_data[i] && \
- (tcd = &(*trace_data[i])[smp_processor_id()].tcd) && \
+ (tcd = &(*trace_data[i])[cpu].tcd) && \
trace_lock_tcd(tcd); trace_unlock_tcd(tcd), i++)
struct trace_page {