Question re: __mlog_cpu_guess in fs/ocfs2/cluster/masklog.h

From: Lee Revell
Date: Mon May 22 2006 - 19:44:34 EST


I am puzzled by this code and comment:

/*
* smp_processor_id() "helpfully" screams when called outside preemptible
* regions in current kernels. sles doesn't have the variants that don't
* scream. just do this instead of trying to guess which we're building
* against.. *sigh*.
*/
#define __mlog_cpu_guess ({ \
unsigned long _cpu = get_cpu(); \
put_cpu(); \
_cpu; \
})

First I think you mean "inside preemptible regions". Second, it screams
because it's a bug to call smp_processor_id() from preemptible code!

Am I missing something?

Lee

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/