Skip to content

Commit

Permalink
netfilter: not mark a spinlock as __read_mostly
Browse files Browse the repository at this point in the history
when spinlock is locked/unlocked, its elements will be changed,
so marking it as __read_mostly is not suitable.

and remove a duplicate definition of nf_conntrack_locks_all_lock
strange that compiler does not complain.

Signed-off-by: Li RongQing <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
lrq-max authored and ummakynes committed Aug 27, 2019
1 parent d0a8d87 commit 44b63b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ struct conntrack_gc_work {
};

static __read_mostly struct kmem_cache *nf_conntrack_cachep;
static __read_mostly spinlock_t nf_conntrack_locks_all_lock;
static __read_mostly DEFINE_SPINLOCK(nf_conntrack_locks_all_lock);
static DEFINE_SPINLOCK(nf_conntrack_locks_all_lock);
static __read_mostly bool nf_conntrack_locks_all;

/* every gc cycle scans at most 1/GC_MAX_BUCKETS_DIV part of table */
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nf_conntrack_labels.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <net/netfilter/nf_conntrack_ecache.h>
#include <net/netfilter/nf_conntrack_labels.h>

static __read_mostly DEFINE_SPINLOCK(nf_connlabels_lock);
static DEFINE_SPINLOCK(nf_connlabels_lock);

static int replace_u32(u32 *address, u32 mask, u32 new)
{
Expand Down

0 comments on commit 44b63b0

Please sign in to comment.