From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>, Jens Axboe <axboe@kernel.dk>,
Robert Love <robert.w.love@intel.com>,
"James E.J. Bottomley" <James.Bottom>
Subject: [PATCH 08/36] net,rcu: convert call_rcu(ip_sf_socklist_reclaim) to kfree_rcu()
Date: Fri, 18 Mar 2011 11:44:46 +0800 [thread overview]
Message-ID: <4D82D52E.1010501@cn.fujitsu.com> (raw)
In-Reply-To: <4D82D3FF.2080303@cn.fujitsu.com>
The rcu callback ip_sf_socklist_reclaim() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(ip_sf_socklist_reclaim).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
net/ipv4/igmp.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index cf187b6..cf98a36 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1830,12 +1830,6 @@ done:
}
EXPORT_SYMBOL(ip_mc_join_group);
-static void ip_sf_socklist_reclaim(struct rcu_head *rp)
-{
- kfree(container_of(rp, struct ip_sf_socklist, rcu));
- /* sk_omem_alloc should have been decreased by the caller*/
-}
-
static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
struct in_device *in_dev)
{
@@ -1852,7 +1846,7 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
rcu_assign_pointer(iml->sflist, NULL);
/* decrease mem now to avoid the memleak warning */
atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc);
- call_rcu(&psf->rcu, ip_sf_socklist_reclaim);
+ kfree_rcu(psf, rcu);
return err;
}
@@ -2020,7 +2014,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
newpsl->sl_addr[i] = psl->sl_addr[i];
/* decrease mem now to avoid the memleak warning */
atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
- call_rcu(&psl->rcu, ip_sf_socklist_reclaim);
+ kfree_rcu(psl, rcu);
}
rcu_assign_pointer(pmc->sflist, newpsl);
psl = newpsl;
@@ -2121,7 +2115,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
psl->sl_count, psl->sl_addr, 0);
/* decrease mem now to avoid the memleak warning */
atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
- call_rcu(&psl->rcu, ip_sf_socklist_reclaim);
+ kfree_rcu(psl, rcu);
} else
(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
0, NULL, 0);
--
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>, Jens Axboe <axboe@kernel.dk>,
Robert Love <robert.w.love@intel.com>,
"James E.J. Bottomley" <James.Bottomley@suse.de>,
Neil Horman <nhorman@tuxdriver.com>,
"David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
"Pekka Savola (ipv6)" <pekkas@netcore.fi>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Stephen Hemminger <shemminger@vyatta.com>,
Tejun Heo <tj@kernel.org>, Jarek Poplawski <jarkao2@gmail.com>,
linux-kernel@vger.kernel.org, devel@open-fcoe.org,
linux-scsi@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 08/36] net,rcu: convert call_rcu(ip_sf_socklist_reclaim) to kfree_rcu()
Date: Fri, 18 Mar 2011 11:44:46 +0800 [thread overview]
Message-ID: <4D82D52E.1010501@cn.fujitsu.com> (raw)
In-Reply-To: <4D82D3FF.2080303@cn.fujitsu.com>
The rcu callback ip_sf_socklist_reclaim() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(ip_sf_socklist_reclaim).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
net/ipv4/igmp.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index cf187b6..cf98a36 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1830,12 +1830,6 @@ done:
}
EXPORT_SYMBOL(ip_mc_join_group);
-static void ip_sf_socklist_reclaim(struct rcu_head *rp)
-{
- kfree(container_of(rp, struct ip_sf_socklist, rcu));
- /* sk_omem_alloc should have been decreased by the caller*/
-}
-
static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
struct in_device *in_dev)
{
@@ -1852,7 +1846,7 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
rcu_assign_pointer(iml->sflist, NULL);
/* decrease mem now to avoid the memleak warning */
atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc);
- call_rcu(&psf->rcu, ip_sf_socklist_reclaim);
+ kfree_rcu(psf, rcu);
return err;
}
@@ -2020,7 +2014,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
newpsl->sl_addr[i] = psl->sl_addr[i];
/* decrease mem now to avoid the memleak warning */
atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
- call_rcu(&psl->rcu, ip_sf_socklist_reclaim);
+ kfree_rcu(psl, rcu);
}
rcu_assign_pointer(pmc->sflist, newpsl);
psl = newpsl;
@@ -2121,7 +2115,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
psl->sl_count, psl->sl_addr, 0);
/* decrease mem now to avoid the memleak warning */
atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
- call_rcu(&psl->rcu, ip_sf_socklist_reclaim);
+ kfree_rcu(psl, rcu);
} else
(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
0, NULL, 0);
--
1.7.4
next prev parent reply other threads:[~2011-03-18 3:43 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4D82D071.5020703@cn.fujitsu.com>
2011-03-18 3:39 ` [PATCH 01/36] net,rcu: convert call_rcu(free_dm_hw_stat) to kfree_rcu() Lai Jiangshan
2011-03-18 3:39 ` Lai Jiangshan
2011-03-18 3:41 ` [PATCH 02/36] scsi,rcu: convert call_rcu(fc_rport_free_rcu) " Lai Jiangshan
2011-03-22 17:28 ` Robert Love
2011-03-23 6:50 ` Paul E. McKenney
2011-03-23 11:22 ` Matthew Wilcox
[not found] ` <20110323112257.GD13806-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
2011-03-23 13:30 ` [PATCH 02/36] scsi, rcu: " Paul E. McKenney
2011-03-23 13:30 ` Paul E. McKenney
2011-03-23 13:30 ` [PATCH 02/36] scsi,rcu: " Paul E. McKenney
2011-03-23 14:05 ` James Bottomley
2011-03-23 22:24 ` Paul E. McKenney
2011-03-23 22:45 ` James Bottomley
2011-03-24 0:32 ` Paul E. McKenney
2011-03-23 23:19 ` Matthew Wilcox
2011-03-18 3:42 ` [PATCH 03/36] net,rcu: " Lai Jiangshan
2011-03-18 3:42 ` Lai Jiangshan
2011-03-18 3:42 ` Lai Jiangshan
2011-03-18 19:35 ` David Miller
2011-03-18 3:42 ` [PATCH 04/36] net,rcu: convert call_rcu(__leaf_info_free_rcu) " Lai Jiangshan
2011-03-18 3:42 ` Lai Jiangshan
2011-03-18 3:42 ` Lai Jiangshan
[not found] ` <4D82D4AA.2080601-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-18 19:35 ` [PATCH 04/36] net, rcu: " David Miller
2011-03-18 19:35 ` [PATCH 04/36] net,rcu: " David Miller
2011-03-18 3:42 ` [PATCH 05/36] block,rcu: convert call_rcu(disk_free_ptbl_rcu_cb) " Lai Jiangshan
2011-03-18 3:42 ` Lai Jiangshan
2011-03-18 3:42 ` Lai Jiangshan
2011-03-18 6:59 ` Jens Axboe
2011-03-18 11:20 ` Matthew Wilcox
2011-03-18 3:43 ` [PATCH 06/36] net,rcu: convert call_rcu(__gen_kill_estimator) " Lai Jiangshan
2011-03-18 3:43 ` Lai Jiangshan
2011-03-18 3:43 ` Lai Jiangshan
2011-03-18 19:35 ` David Miller
2011-03-18 3:44 ` [PATCH 07/36] net,rcu: convert call_rcu(ip_mc_list_reclaim) " Lai Jiangshan
2011-03-18 3:44 ` Lai Jiangshan
2011-03-18 3:44 ` Lai Jiangshan
[not found] ` <4D82D508.5080901-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-18 19:35 ` [PATCH 07/36] net, rcu: " David Miller
2011-03-18 19:35 ` [PATCH 07/36] net,rcu: " David Miller
2011-03-18 3:44 ` Lai Jiangshan [this message]
2011-03-18 3:44 ` [PATCH 08/36] net,rcu: convert call_rcu(ip_sf_socklist_reclaim) " Lai Jiangshan
2011-03-18 19:35 ` David Miller
2011-03-18 3:44 ` Lai Jiangshan
2011-03-18 3:45 ` [PATCH 09/36] net,rcu: convert call_rcu(ip_mc_socklist_reclaim) " Lai Jiangshan
2011-03-18 3:45 ` Lai Jiangshan
[not found] ` <4D82D544.6090509-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-18 19:36 ` [PATCH 09/36] net, rcu: " David Miller
2011-03-18 19:36 ` [PATCH 09/36] net,rcu: " David Miller
2011-03-18 3:45 ` Lai Jiangshan
2011-03-18 15:24 ` [PATCH 01/36] net,rcu: convert call_rcu(free_dm_hw_stat) " Neil Horman
2011-03-18 19:35 ` David Miller
2011-03-18 3:39 ` Lai Jiangshan
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=4D82D52E.1010501@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=axboe@kernel.dk \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.com \
--cc=robert.w.love@intel.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.