Hi Marcel, On Wed, May 11, 2011 at 10:24 PM, Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote: > Hi Andre, > >> This patch adds a RW lock to protect concurrent operations on >> adv_entries list. >> >> Signed-off-by: Andre Guedes <andre.guedes@xxxxxxxxxxxxx> >> --- >> include/net/bluetooth/hci_core.h | 1 + >> net/bluetooth/hci_core.c | 21 +++++++++++++++++---- >> 2 files changed, 18 insertions(+), 4 deletions(-) >> >> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h >> index 65135f8..2ceeadf 100644 >> --- a/include/net/bluetooth/hci_core.h >> +++ b/include/net/bluetooth/hci_core.h >> @@ -188,6 +188,7 @@ struct hci_dev { >> struct list_head remote_oob_data; >> >> struct list_head adv_entries; >> + rwlock_t adv_entries_lock; > > we might wanna consider just using spinlocks and not rwlocks. Also can > you please look into using RCU. > > Regards > > Marcel > > > Ok. I will use hci_dev_lock and friends to protect adv_entries. This is the approach already used to protect uuids, link_keys, remote_oob_data lists. About RCU, I see the point in using it, but since reading operations in adv_entries are not _extremely_ requested, IMO, we'll not have much performance gain here. Anyway, the changes to use RCU are straightforward. So, let me know if you wanna try RCU to protect the advertising cache. BR, Andre Guedes. -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html