From: Dmitry Zogin Date: Mon, 19 Apr 2010 23:29:32 +0000 (-0700) Subject: b=22409 Spurious error messages from smp_processor_id() on preemptible kernel X-Git-Tag: 1.10.0.41~36 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=58fac30e99f428438a12c6a3f4f6989ef0ec5c22;p=fs%2Flustre-release.git b=22409 Spurious error messages from smp_processor_id() on preemptible kernel Disable a preemption by grabbing the lock in fs_trace_get_tcd() first. The function fs_trace_get_tcd() was moved up. o=andreas.dilger i=johann i=dmitry.zogin i=nathan.rutman --- diff --git a/libcfs/libcfs/tracefile.c b/libcfs/libcfs/tracefile.c index 5838f73..da566c0 100644 --- a/libcfs/libcfs/tracefile.c +++ b/libcfs/libcfs/tracefile.c @@ -261,10 +261,13 @@ int libcfs_debug_vmsg2(cfs_debug_limit_state_t *cdls, int subsys, int mask, if (strchr(file, '/')) file = strrchr(file, '/') + 1; + tcd = cfs_trace_get_tcd(); + /* cfs_trace_get_tcd() grabs a lock, which disables preemption and + * pins us to a particular CPU. This avoids an smp_processor_id() + * warning on Linux when debugging is enabled. */ cfs_set_ptldebug_header(&header, subsys, mask, line, CDEBUG_STACK()); - tcd = cfs_trace_get_tcd(); if (tcd == NULL) /* arch may not log in IRQ context */ goto console;