From: Jesse Gross Date: Mon, 18 Oct 2010 22:36:59 +0000 (-0700) Subject: datapath: #define local_bh_disable to preempt_disable on RT. X-Git-Tag: v1.1.0~975 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=22fcc4d5a5f2459b3edaa034dd69686399b41913;p=sliver-openvswitch.git datapath: #define local_bh_disable to preempt_disable on RT. We use local_bh_disable() to mean that we don't want to get preempted or interrupted and normally it covers both situations. However, on RT kernels local_bh_disable() becomes a no-op because bottom halves aren't interrupts any more. We still want the behavior of disabling preemption so #define them to be the same on these kernels. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/linux-2.6/Modules.mk b/datapath/linux-2.6/Modules.mk index 5a0e9ad47..3ffee5004 100644 --- a/datapath/linux-2.6/Modules.mk +++ b/datapath/linux-2.6/Modules.mk @@ -9,6 +9,7 @@ openvswitch_sources += \ openvswitch_headers += \ linux-2.6/compat-2.6/compat26.h \ linux-2.6/compat-2.6/include/asm-generic/bug.h \ + linux-2.6/compat-2.6/include/linux/bottom_half.h \ linux-2.6/compat-2.6/include/linux/cpumask.h \ linux-2.6/compat-2.6/include/linux/dmi.h \ linux-2.6/compat-2.6/include/linux/err.h \ diff --git a/datapath/linux-2.6/compat-2.6/include/linux/bottom_half.h b/datapath/linux-2.6/compat-2.6/include/linux/bottom_half.h new file mode 100644 index 000000000..59eb4bca6 --- /dev/null +++ b/datapath/linux-2.6/compat-2.6/include/linux/bottom_half.h @@ -0,0 +1,19 @@ +#ifndef __LINUX_BH_WRAPPER_H +#define __LINUX_BH_WRAPPER_H 1 + +#include_next + +/* This is not, strictly speaking, compatibility code in the sense that it is + * not needed by older kernels. However, it is used on kernels with the + * realtime patchset applied to create an environment more similar to what we + * would see on normal kernels. + */ + +#ifdef CONFIG_PREEMPT_HARDIRQS +#undef local_bh_disable +#define local_bh_disable preempt_disable +#undef local_bh_enable +#define local_bh_enable preempt_enable +#endif + +#endif