All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 09/10] cfg80211: move regulatory hints to workqueue
Date: Mon, 16 Feb 2009 02:09:39 -0800	[thread overview]
Message-ID: <43e72e890902160209q2106331ds540a711e9badfa3f@mail.gmail.com> (raw)
In-Reply-To: <1234778113.4219.117.camel@johannes.local>

On Mon, Feb 16, 2009 at 1:55 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2009-02-16 at 01:48 -0800, Luis R. Rodriguez wrote:
>
>> > Are you sure the mutex order reg_mutex --> cfg80211_mutex is a good
>> > idea? Is there a need for two locks at all?
>>
>> I think so. So reg_mutex would prevent any new requests to be added
>> into the queue, that's the only thing that mutex protects. Once you
>> are sure you have no one adding requests to the queue you then need to
>> ensure no one is processing a regulatory request and hence the
>> cfg80211_mutex.
>>
>> We need to protect the queue from additions to the queue from having
>> the workqueue process it.
>
> Maybe just use a spinlock for the list, and do the loop manually like in
> mac80211/key.c then?
>
>        spin_lock(&todo_lock);
>        while (!list_empty(&todo_list)) {
>                key = list_first_entry(&todo_list, struct ieee80211_key, todo);
>                list_del_init(&key->todo);
>                spin_unlock(&todo_lock);
> ........
>                spin_lock(&todo_lock);
>        }
>        spin_unlock(&todo_lock);

Sure, is the benefit you see that we won't contend userspace longer if
the workqueue is busy?

  Luis

  reply	other threads:[~2009-02-16 10:09 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-14  5:33 [PATCH 00/10] cfg80211: move reg hints to workqueue Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 01/10] cfg80211: rename cfg80211_registered_device's idx to wiphy_idx Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 02/10] cfg80211: add wiphy_idx_valid to check for wiphy_idx sanity Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 03/10] cfg80211: rename cfg80211_drv_mutex to cfg80211_mutex Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 04/10] nl80211: disallow user requests prior to regulatory_init() Luis R. Rodriguez
2009-02-15 10:58   ` Johannes Berg
2009-02-16  8:13     ` Luis R. Rodriguez
2009-02-16  8:49       ` Johannes Berg
2009-02-16  9:01         ` Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 05/10] cfg80211: add regulatory_hint_core() to separate the core reg hint Luis R. Rodriguez
2009-02-15 10:59   ` Johannes Berg
2009-02-16  8:14     ` Luis R. Rodriguez
2009-02-16  8:50       ` Johannes Berg
2009-02-16  9:17         ` Luis R. Rodriguez
2009-02-16  9:22           ` Johannes Berg
2009-02-16  9:29             ` Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 06/10] cfg80211: propagate -ENOMEM during regulatory_init() Luis R. Rodriguez
2009-02-15 11:01   ` Johannes Berg
2009-02-16  8:18     ` Luis R. Rodriguez
2009-02-16  8:52       ` Johannes Berg
2009-02-16  9:09         ` Luis R. Rodriguez
2009-02-16  9:15           ` Johannes Berg
2009-02-16  9:24             ` Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 07/10] cfg80211: add assert_cfg80211_lock() to ensure proper protection Luis R. Rodriguez
2009-02-15 11:01   ` Johannes Berg
2009-02-16  8:19     ` Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 08/10] cfg80211: make regulatory_request use wiphy_idx instead of wiphy Luis R. Rodriguez
2009-02-15 11:04   ` Johannes Berg
2009-02-16  9:55     ` Luis R. Rodriguez
2009-02-16 10:02       ` Johannes Berg
2009-02-16 10:11         ` Luis R. Rodriguez
2009-02-16 10:20           ` Johannes Berg
2009-02-16 11:11             ` Luis R. Rodriguez
2009-02-14  5:33 ` [PATCH 09/10] cfg80211: move regulatory hints to workqueue Luis R. Rodriguez
2009-02-15 11:10   ` Johannes Berg
2009-02-16  9:48     ` Luis R. Rodriguez
2009-02-16  9:55       ` Johannes Berg
2009-02-16 10:09         ` Luis R. Rodriguez [this message]
2009-02-16 10:18           ` Johannes Berg
2009-02-14  5:33 ` [PATCH 10/10] cfg80211: comments style cleanup Luis R. Rodriguez
2009-02-14  5:50 ` [PATCH 00/10] cfg80211: move reg hints to workqueue Luis R. Rodriguez

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=43e72e890902160209q2106331ds540a711e9badfa3f@mail.gmail.com \
    --to=lrodriguez@atheros.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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.