summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux
diff options
context:
space:
mode:
authorSerhey Popovych <serhe.popovych@gmail.com>2019-11-29 11:21:28 +0200
committerJozsef Kadlecsik <kadlec@netfilter.org>2019-12-09 11:01:14 +0100
commitbb750b8ded015c4447cc2eee601709f50d06574e (patch)
tree3281b6270ee3f3e29b293020b4b41e070437a133 /kernel/include/linux
parenta1ccbae83744041bddf4038323a3428e8a20ef72 (diff)
configure.ac: Add cond_resched_rcu() checks
It was introduced with commit f6f3c437d09e ("sched: add cond_resched_rcu() helper") since v3.11 upstream kernel. To support building on older kernels add implementation to ip_set_compat.h. Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com> Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Diffstat (limited to 'kernel/include/linux')
-rw-r--r--kernel/include/linux/netfilter/ipset/ip_set_compat.h.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
index 5f12ad8..f4d7acc 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
@@ -50,6 +50,7 @@
#@HAVE_STRSCPY@ HAVE_STRSCPY
#@HAVE_SYNCHRONIZE_RCU_BH@ HAVE_SYNCHRONIZE_RCU_BH
#@HAVE_LOCKDEP_NFNL_IS_HELD@ HAVE_LOCKDEP_NFNL_IS_HELD
+#@HAVE_COND_RESCHED_RCU@ HAVE_COND_RESCHED_RCU
#ifdef HAVE_EXPORT_SYMBOL_GPL_IN_MODULE_H
#include <linux/module.h>
@@ -148,6 +149,17 @@ do { \
#endif
#endif
+#ifndef HAVE_COND_RESCHED_RCU
+static inline void cond_resched_rcu(void)
+{
+#if defined(CONFIG_DEBUG_ATOMIC_SLEEP) || !defined(CONFIG_PREEMPT_RCU)
+ rcu_read_unlock();
+ cond_resched();
+ rcu_read_lock();
+#endif
+}
+#endif
+
#if defined(CONFIG_NETFILTER_NETLINK) || defined(CONFIG_NETFILTER_NETLINK_MODULE)
#else
#error "NETFILTER_NETLINK must be enabled: select NFACCT/NFQUEUE/LOG over NFNETLINK"