All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
To: netfilter-devel@vger.kernel.org
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Subject: [PATCH 3/8] netfilter: ipset: Introduce RCU locking in the bitmap types
Date: Fri, 12 Dec 2014 22:58:04 +0100	[thread overview]
Message-ID: <1418421489-17411-4-git-send-email-kadlec@blackhole.kfki.hu> (raw)
In-Reply-To: <1418421489-17411-1-git-send-email-kadlec@blackhole.kfki.hu>

Bit operations are atomic, nothing much needed.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
---
 net/netfilter/ipset/ip_set_bitmap_gen.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h
index 6f024a8..136f20b 100644
--- a/net/netfilter/ipset/ip_set_bitmap_gen.h
+++ b/net/netfilter/ipset/ip_set_bitmap_gen.h
@@ -260,7 +260,7 @@ mtype_gc(unsigned long ul_set)
 
 	/* We run parallel with other readers (test element)
 	 * but adding/deleting new entries is locked out */
-	read_lock_bh(&set->lock);
+	spin_lock_bh(&set->lock);
 	for (id = 0; id < map->elements; id++)
 		if (mtype_gc_test(id, map, set->dsize)) {
 			x = get_ext(set, map, id);
@@ -269,7 +269,7 @@ mtype_gc(unsigned long ul_set)
 				ip_set_ext_destroy(set, x);
 			}
 		}
-	read_unlock_bh(&set->lock);
+	spin_unlock_bh(&set->lock);
 
 	map->gc.expires = jiffies + IPSET_GC_PERIOD(set->timeout) * HZ;
 	add_timer(&map->gc);
-- 
1.8.5.1


  parent reply	other threads:[~2014-12-12 21:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 21:58 [PATCH 0/8] ipset patches for nf-next, v3 Jozsef Kadlecsik
2014-12-12 21:58 ` [PATCH 1/8] netfilter: ipset: Remove rbtree from hash:net,iface in order to run under RCU Jozsef Kadlecsik
2014-12-12 21:58 ` [PATCH 2/8] netfilter: ipset: Prepare ipset core for RCU locking instead of rwlock per set Jozsef Kadlecsik
2014-12-18 18:38   ` Pablo Neira Ayuso
2014-12-21 11:52     ` Jozsef Kadlecsik
2014-12-21 12:23       ` Jozsef Kadlecsik
2014-12-12 21:58 ` Jozsef Kadlecsik [this message]
2014-12-12 21:58 ` [PATCH 4/8] netfilter: ipset: Introduce RCU locking in the list type Jozsef Kadlecsik
2014-12-12 21:58 ` [PATCH 5/8] netfilter: ipset: Introduce RCU locking in the hash types Jozsef Kadlecsik
2014-12-12 21:58 ` [PATCH 6/8] netfilter: ipset: styles warned by checkpatch.pl fixed Jozsef Kadlecsik
2014-12-12 21:58 ` [PATCH 7/8] netfilter: ipset: Fix parallel resizing and listing of the same set Jozsef Kadlecsik
2014-12-12 21:58 ` [PATCH 8/8] netfilter: ipset: Fix sparse warning Jozsef Kadlecsik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1418421489-17411-4-git-send-email-kadlec@blackhole.kfki.hu \
    --to=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.