The following commit has been merged in the linux branch:
commit 730021845ccda3a34169d35b05dd677127794b34
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sat Sep 18 20:09:37 2010 +0200
Staging: batman-adv: Remove rcu todo
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/drivers/staging/batman-adv/TODO b/drivers/staging/batman-adv/TODO
index 76b2acd..5913731 100644
--- a/drivers/staging/batman-adv/TODO
+++ b/drivers/staging/batman-adv/TODO
@@ -1,8 +1,3 @@
- * Rework usage of RCU
- - don't leak pointers from rcu out of rcu critical area which may
- get freed
- - check were synchronize_rcu must be used
- - go through Documentation/RCU/checklist.txt
* Request a new review
* Process the comments from the review
* Move into mainline proper
--
linux integration
The tag, GregKH-20100918 has been updated
to 63eace1ea2cc4da3d06e10dcc62f499f684586cb (commit)
from b1c4725374d4f02c50f26b822da0dbf717bc4ce5
- Shortlog ------------------------------------------------------------
commit 63eace1ea2cc4da3d06e10dcc62f499f684586cb
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sat Sep 18 20:09:37 2010 +0200
Staging: batman-adv: Remove rcu todo
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
-----------------------------------------------------------------------
--
linux integration
The following commit has been merged in the linux branch:
commit 63eace1ea2cc4da3d06e10dcc62f499f684586cb
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sat Sep 18 20:09:37 2010 +0200
Staging: batman-adv: Remove rcu todo
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/drivers/staging/batman-adv/TODO b/drivers/staging/batman-adv/TODO
index 76b2acd..5913731 100644
--- a/drivers/staging/batman-adv/TODO
+++ b/drivers/staging/batman-adv/TODO
@@ -1,8 +1,3 @@
- * Rework usage of RCU
- - don't leak pointers from rcu out of rcu critical area which may
- get freed
- - check were synchronize_rcu must be used
- - go through Documentation/RCU/checklist.txt
* Request a new review
* Process the comments from the review
* Move into mainline proper
--
linux integration
The tag, GregKH-20100918 has been created
at b1c4725374d4f02c50f26b822da0dbf717bc4ce5 (commit)
- Shortlog ------------------------------------------------------------
commit b1c4725374d4f02c50f26b822da0dbf717bc4ce5
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sat Sep 18 19:38:23 2010 +0200
Staging: batman-adv: Move mailing list address to .org
The official mailing list is run on lists.open-mesh.org and it should be
avoided to sent them to lists.open-mesh.net to reduce the number of
receipents and double posts.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
-----------------------------------------------------------------------
--
linux integration
The following commit has been merged in the linux branch:
commit b1c4725374d4f02c50f26b822da0dbf717bc4ce5
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sat Sep 18 19:38:23 2010 +0200
Staging: batman-adv: Move mailing list address to .org
The official mailing list is run on lists.open-mesh.org and it should be
avoided to sent them to lists.open-mesh.net to reduce the number of
receipents and double posts.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/drivers/staging/batman-adv/README b/drivers/staging/batman-adv/README
index cab178b..ec16967 100644
--- a/drivers/staging/batman-adv/README
+++ b/drivers/staging/batman-adv/README
@@ -229,8 +229,9 @@ CONTACT
Please send us comments, experiences, questions, anything :)
IRC: #batman on irc.freenode.org
-Mailing-list: b.a.t.m.a.n(a)open-mesh.org (optional subscription
- at https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
+Mailing-list: b.a.t.m.a.n@b.a.t.m.a.n@lists.open-mesh.org
+ (optional subscription at
+ https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
You can also contact the Authors:
--
linux integration
The following commit has been merged in the next branch:
commit 192668bd8ed24c47c8e0e1664af0b2bebfd4833b
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sat Sep 18 15:35:45 2010 +0000
batman-adv: Track references of batman_if in set_primary_if
set_primary_if exchanges the current primary interfaces with a new one.
This is a new reference and thus we have to count it and decrease the
count of the old primary interface.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/hard-interface.c b/hard-interface.c
index f519b4b..942a44a 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -113,9 +113,17 @@ static void set_primary_if(struct bat_priv *bat_priv,
{
struct batman_packet *batman_packet;
struct vis_packet *vis_packet;
+ struct batman_if *old_if;
+ if (batman_if)
+ hardif_hold(batman_if);
+
+ old_if = bat_priv->primary_if;
bat_priv->primary_if = batman_if;
+ if (old_if)
+ hardif_put(old_if);
+
if (!bat_priv->primary_if)
return;
--
batman-adv
The following commit has been merged in the next branch:
commit 553d0da3361c4df3d0a1de20f356a97cf9a9197b
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sat Sep 18 15:35:40 2010 +0000
batman-adv: Use synchronize_rcu instead of call_rcu
It is recommended [1] to use synchronize_rcu to simplify the code -
especially when otherwise extra locking is needed to protect other code
from picking stale elements. It also protects us for emitting to many
callbacks which may results in OOM conditions.
The only reason not to use it, would be in performance critical sections
or when we are not allowed to block.
[1] Documentation/RCU/checklist.txt
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/hard-interface.c b/hard-interface.c
index 3cd7cb1..0b3ee6b 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -420,13 +420,6 @@ out:
return NULL;
}
-static void hardif_free_interface(struct rcu_head *rcu)
-{
- struct batman_if *batman_if = container_of(rcu, struct batman_if, rcu);
-
- kfree(batman_if);
-}
-
static void hardif_remove_interface(struct batman_if *batman_if)
{
/* first deactivate interface */
@@ -440,9 +433,10 @@ static void hardif_remove_interface(struct batman_if *batman_if)
/* caller must take if_list_lock */
list_del_rcu(&batman_if->list);
+ synchronize_rcu();
sysfs_del_hardif(&batman_if->hardif_obj);
dev_put(batman_if->net_dev);
- call_rcu(&batman_if->rcu, hardif_free_interface);
+ kfree(batman_if);
}
void hardif_remove_interfaces(void)
diff --git a/types.h b/types.h
index 478277f..b162644 100644
--- a/types.h
+++ b/types.h
@@ -44,7 +44,6 @@ struct batman_if {
unsigned char *packet_buff;
int packet_len;
struct kobject *hardif_obj;
- struct rcu_head rcu;
struct packet_type batman_adv_ptype;
struct net_device *soft_iface;
};
--
batman-adv