linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mac80211: sta info locking
@ 2008-02-22 10:44 Johannes Berg
  2008-02-22 14:37 ` John W. Linville
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Berg @ 2008-02-22 10:44 UTC (permalink / raw)
  To: Ron Rindjunsky; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

Hi,

Ron, I noticed you added spinlocks to ampdu_mlme for both the and TX
processing. Generally, the locking in sta_info is lacking, for example
the flags member is simply updated all over the place without regard for
locking.

I have boiled down the locking requirements to various things:

 * static sta info members, set on allocation (fine now after a patch
   that splits allocation and hash table insertion, except in one
   place where an AP entry is added, need to review)
 * semi-static information, to review, but most likely updated only
   on external events like cfg80211 which are synchronized
 * flags, needs locking badly
 * powersave frame queues (have internal locking)
 * sta info members updated only within the TX status path
   -> fine per my previous mail
 * sta info members updated only within the RX path
   -> also fine per my previous mail
 * debug counters we don't really care about (channel use)
 * AMPDU stuff (own locking)

Hence, I think we can actually get away without more locking if we
protect the flags better. Should we use a spinlock or the atomic
set_bit()/clear_bit()/etc. operations?

If we were to use a spinlock, could the AMPDU stuff use that too? Does
it really need one spinlock for TX and one for RX?

I don't think the spinlock would be contended a lot, but it is possible
that, at the same time,
 * the TX path is trying to clear the PSPOLL flag
 * hostapd is trying to clear the WLAN_STA_AUTHORIZED flag
 * the RX path is trying to set the PS flag

....

I hope you're all (not just Ron, I just addressed you because of the
ampdu stuff) reading this and trying to wrap your head around the
synchronisation issues in mac80211, I don't want to be the only one with
then somehow magic knowledge about it... Once I understand it I'll try
to document it too.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-02-26 15:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-22 10:44 mac80211: sta info locking Johannes Berg
2008-02-22 14:37 ` John W. Linville
2008-02-22 15:16   ` Johannes Berg
2008-02-22 15:57     ` John W. Linville
2008-02-25 20:46       ` Johannes Berg
2008-02-25 22:50         ` Tomas Winkler
2008-02-25 22:55           ` Johannes Berg
2008-02-25 23:12             ` Tomas Winkler
2008-02-25 23:23               ` Johannes Berg
2008-02-25 23:41                 ` Tomas Winkler
2008-02-25 23:48                   ` Johannes Berg
2008-02-26  0:30                     ` Tomas Winkler
2008-02-26  9:59                       ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).