* [PATCH] netfilter: not mark a spinlock as __read_mostly
@ 2019-08-23 7:42 Li RongQing
2019-08-27 16:07 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Li RongQing @ 2019-08-23 7:42 UTC (permalink / raw)
To: netfilter-devel
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 <lirongqing@baidu.com>
---
net/netfilter/nf_conntrack_core.c | 3 +--
net/netfilter/nf_conntrack_labels.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 81a8ef42b88d..0c63120b2db2 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -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 */
diff --git a/net/netfilter/nf_conntrack_labels.c b/net/netfilter/nf_conntrack_labels.c
index d1c6b2a2e7bd..522792556632 100644
--- a/net/netfilter/nf_conntrack_labels.c
+++ b/net/netfilter/nf_conntrack_labels.c
@@ -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)
{
--
2.16.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netfilter: not mark a spinlock as __read_mostly
2019-08-23 7:42 [PATCH] netfilter: not mark a spinlock as __read_mostly Li RongQing
@ 2019-08-27 16:07 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2019-08-27 16:07 UTC (permalink / raw)
To: Li RongQing; +Cc: netfilter-devel
On Fri, Aug 23, 2019 at 03:42:48PM +0800, Li RongQing wrote:
> 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
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-27 16:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 7:42 [PATCH] netfilter: not mark a spinlock as __read_mostly Li RongQing
2019-08-27 16:07 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).