From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 5/8] netfilter: not mark a spinlock as __read_mostly
Date: Thu, 5 Sep 2019 18:03:57 +0200 [thread overview]
Message-ID: <20190905160400.25399-6-pablo@netfilter.org> (raw)
In-Reply-To: <20190905160400.25399-1-pablo@netfilter.org>
From: Li RongQing <lirongqing@baidu.com>
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
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.11.0
next prev parent reply other threads:[~2019-09-05 16:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 16:03 [PATCH 0/8] Netfilter updates for net-next Pablo Neira Ayuso
2019-09-05 16:03 ` [PATCH 1/8] netfilter: nf_tables: Introduce new 64-bit helper register functions Pablo Neira Ayuso
2019-09-05 16:03 ` [PATCH 2/8] netfilter: nft_meta: support for time matching Pablo Neira Ayuso
2019-09-05 16:03 ` [PATCH 3/8] netfilter: nfnetlink_log: add support for VLAN information Pablo Neira Ayuso
2019-09-05 16:03 ` [PATCH 4/8] netfilter: nft_dynset: support for element deletion Pablo Neira Ayuso
2019-09-05 16:03 ` Pablo Neira Ayuso [this message]
2019-09-05 16:03 ` [PATCH 6/8] netfilter: nf_tables: Introduce stateful object update operation Pablo Neira Ayuso
2019-09-05 16:03 ` [PATCH 7/8] netfilter: nft_quota: add quota object update support Pablo Neira Ayuso
2019-09-05 16:04 ` [PATCH 8/8] netfilter: nf_tables: fix possible null-pointer dereference in object update Pablo Neira Ayuso
2019-09-07 14:34 ` [PATCH 0/8] Netfilter updates for net-next David Miller
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=20190905160400.25399-6-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.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 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).