netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
[sfrench/cifs-2.6.git] / net / netfilter / nft_set_rbtree.c
index f250b5399344afac46bfca4014367bf57cf18ffe..70491ba98decba9575f429f562ebecb472453734 100644 (file)
@@ -622,8 +622,7 @@ static void nft_rbtree_gc(struct work_struct *work)
        if (!gc)
                goto done;
 
-       write_lock_bh(&priv->lock);
-       write_seqcount_begin(&priv->count);
+       read_lock_bh(&priv->lock);
        for (node = rb_first(&priv->root); node != NULL; node = rb_next(node)) {
 
                /* Ruleset has been updated, try later. */
@@ -673,8 +672,7 @@ dead_elem:
        gc = nft_trans_gc_catchall(gc, gc_seq);
 
 try_later:
-       write_seqcount_end(&priv->count);
-       write_unlock_bh(&priv->lock);
+       read_unlock_bh(&priv->lock);
 
        if (gc)
                nft_trans_gc_queue_async_done(gc);