From patchwork Tue Oct 28 13:31:24 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 6091 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 0D0B2DDEDE for ; Wed, 29 Oct 2008 00:28:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752599AbYJ1N2E (ORCPT ); Tue, 28 Oct 2008 09:28:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752614AbYJ1N2B (ORCPT ); Tue, 28 Oct 2008 09:28:01 -0400 Received: from ey-out-2122.google.com ([74.125.78.24]:7088 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751568AbYJ1N2A (ORCPT ); Tue, 28 Oct 2008 09:28:00 -0400 Received: by ey-out-2122.google.com with SMTP id 6so1027315eyi.37 for ; Tue, 28 Oct 2008 06:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=/JJ6ggNWk9aRgo72+xofsyVPk4YKGQcFYROFe/DOywQ=; b=iRiGB9oHGLZnf0tWQ35gvnEfDhcQLYeGCznefAqIdKKZ7hFXFGWn2Cdg5k0818YVD2 sDN6ZQ4huMWigs8QK2Fjg7hCYxqG5f4dUqQpuEeEu1Qvn4FDh3CYHe6lEPokByhlba4Q e4Xo/ossaRQBBsALvlBQcjMSYJtp6us/0YPCQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=hPllOWFcha8rqyFJqzbkkADgoBsGlkV2krRuauv+Jq/UPGqNnYnJDxgtMB+4MDOMm2 fczdrGnwRSfuyl9osL6dtbh7Kt/w0/mto5ozQT6bG+wzrOI9FDDfRCtEEfKElFAQQhMs 1f4vy47OJXGW5BhzxnvTHH4u2kMjoXm8c+z0A= Received: by 10.210.16.16 with SMTP id 16mr8346126ebp.81.1225200478612; Tue, 28 Oct 2008 06:27:58 -0700 (PDT) Received: from localhost (gw.zunet.ru [217.67.117.64]) by mx.google.com with ESMTPS id 33sm898678nfu.7.2008.10.28.06.27.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 28 Oct 2008 06:27:57 -0700 (PDT) Date: Tue, 28 Oct 2008 16:31:24 +0300 From: Alexey Dobriyan To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [PATCH] net: don't use INIT_RCU_HEAD Message-ID: <20081028133124.GA3006@x200.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org call_rcu() will unconditionally rewrite RCU head anyway. Applies to struct neigh_parms struct neigh_table struct net struct cipso_v4_doi struct in_ifaddr struct in_device rt->u.dst Signed-off-by: Alexey Dobriyan Acked-by: Paul E. McKenney --- net/core/neighbour.c | 2 -- net/core/net_namespace.c | 2 -- net/ipv4/cipso_ipv4.c | 1 - net/ipv4/devinet.c | 9 +-------- net/ipv4/route.c | 1 - 5 files changed, 1 insertion(+), 14 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1340,7 +1340,6 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev, if (p) { p->tbl = tbl; atomic_set(&p->refcnt, 1); - INIT_RCU_HEAD(&p->rcu_head); p->reachable_time = neigh_rand_reach_time(p->base_reachable_time); @@ -1412,7 +1411,6 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl) tbl->parms.net = &init_net; #endif atomic_set(&tbl->parms.refcnt, 1); - INIT_RCU_HEAD(&tbl->parms.rcu_head); tbl->parms.reachable_time = neigh_rand_reach_time(tbl->parms.base_reachable_time); --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -47,7 +47,6 @@ static __net_init int setup_net(struct net *net) goto out; ng->len = INITIAL_NET_GEN_PTRS; - INIT_RCU_HEAD(&ng->rcu); rcu_assign_pointer(net->gen, ng); error = 0; @@ -446,7 +445,6 @@ int net_assign_generic(struct net *net, int id, void *data) */ ng->len = id; - INIT_RCU_HEAD(&ng->rcu); memcpy(&ng->ptr, &old_ng->ptr, old_ng->len); rcu_assign_pointer(net->gen, ng); --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c @@ -490,7 +490,6 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def) } atomic_set(&doi_def->refcount, 1); - INIT_RCU_HEAD(&doi_def->rcu); spin_lock(&cipso_v4_doi_list_lock); if (cipso_v4_doi_search(doi_def->doi) != NULL) --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -112,13 +112,7 @@ static inline void devinet_sysctl_unregister(struct in_device *idev) static struct in_ifaddr *inet_alloc_ifa(void) { - struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL); - - if (ifa) { - INIT_RCU_HEAD(&ifa->rcu_head); - } - - return ifa; + return kzalloc(sizeof(struct in_ifaddr), GFP_KERNEL); } static void inet_rcu_free_ifa(struct rcu_head *head) @@ -161,7 +155,6 @@ static struct in_device *inetdev_init(struct net_device *dev) in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); if (!in_dev) goto out; - INIT_RCU_HEAD(&in_dev->rcu_head); memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, sizeof(in_dev->cnf)); in_dev->cnf.sysctl = NULL; --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1386,7 +1386,6 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, /* Copy all the information. */ *rt = *rth; - INIT_RCU_HEAD(&rt->u.dst.rcu_head); rt->u.dst.__use = 1; atomic_set(&rt->u.dst.__refcnt, 1); rt->u.dst.child = NULL;