From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Tom Herbert <therbert@google.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Greg Kroah-Hartman <gregkh@suse.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 17/36] net,rcu: convert call_rcu(xps_map_release) to kfree_rcu()
Date: Fri, 18 Mar 2011 12:02:20 +0800 [thread overview]
Message-ID: <4D82D94C.2090507@cn.fujitsu.com> (raw)
The rcu callback xps_map_release() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(xps_map_release).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
net/core/net-sysfs.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 21e9208..9ae2e1d 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -876,13 +876,6 @@ static ssize_t show_xps_map(struct netdev_queue *queue,
return len;
}
-static void xps_map_release(struct rcu_head *rcu)
-{
- struct xps_map *map = container_of(rcu, struct xps_map, rcu);
-
- kfree(map);
-}
-
static void xps_dev_maps_release(struct rcu_head *rcu)
{
struct xps_dev_maps *dev_maps =
@@ -987,7 +980,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
map = dev_maps ?
xmap_dereference(dev_maps->cpu_map[cpu]) : NULL;
if (map && xmap_dereference(new_dev_maps->cpu_map[cpu]) != map)
- call_rcu(&map->rcu, xps_map_release);
+ kfree_rcu(map, rcu);
if (new_dev_maps->cpu_map[cpu])
nonempty = 1;
}
@@ -1062,7 +1055,7 @@ static void netdev_queue_release(struct kobject *kobj)
else {
RCU_INIT_POINTER(dev_maps->cpu_map[i],
NULL);
- call_rcu(&map->rcu, xps_map_release);
+ kfree_rcu(map, rcu);
map = NULL;
}
}
--
1.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Tom Herbert <therbert@go
Subject: [PATCH 17/36] net,rcu: convert call_rcu(xps_map_release) to kfree_rcu()
Date: Fri, 18 Mar 2011 12:02:20 +0800 [thread overview]
Message-ID: <4D82D94C.2090507@cn.fujitsu.com> (raw)
The rcu callback xps_map_release() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(xps_map_release).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
net/core/net-sysfs.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 21e9208..9ae2e1d 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -876,13 +876,6 @@ static ssize_t show_xps_map(struct netdev_queue *queue,
return len;
}
-static void xps_map_release(struct rcu_head *rcu)
-{
- struct xps_map *map = container_of(rcu, struct xps_map, rcu);
-
- kfree(map);
-}
-
static void xps_dev_maps_release(struct rcu_head *rcu)
{
struct xps_dev_maps *dev_maps =
@@ -987,7 +980,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
map = dev_maps ?
xmap_dereference(dev_maps->cpu_map[cpu]) : NULL;
if (map && xmap_dereference(new_dev_maps->cpu_map[cpu]) != map)
- call_rcu(&map->rcu, xps_map_release);
+ kfree_rcu(map, rcu);
if (new_dev_maps->cpu_map[cpu])
nonempty = 1;
}
@@ -1062,7 +1055,7 @@ static void netdev_queue_release(struct kobject *kobj)
else {
RCU_INIT_POINTER(dev_maps->cpu_map[i],
NULL);
- call_rcu(&map->rcu, xps_map_release);
+ kfree_rcu(map, rcu);
map = NULL;
}
}
--
1.7.4
next reply other threads:[~2011-03-18 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 4:02 Lai Jiangshan [this message]
2011-03-18 4:02 ` [PATCH 17/36] net,rcu: convert call_rcu(xps_map_release) to kfree_rcu() Lai Jiangshan
2011-03-18 19:36 ` 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=4D82D94C.2090507@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=eric.dumazet@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=therbert@google.com \
/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.