linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Tejun Heo <tj@kernel.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: ath5k/mac80211:  Reproducible deadlock with 64-stations.
Date: Fri, 12 Nov 2010 10:34:49 -0800	[thread overview]
Message-ID: <4CDD88C9.3090901@candelatech.com> (raw)
In-Reply-To: <4CDD83BC.1090207@kernel.org>

On 11/12/2010 10:13 AM, Tejun Heo wrote:
> Hello,
>
> On 11/12/2010 07:06 PM, Ben Greear wrote:
>> On 11/12/2010 02:15 AM, Tejun Heo wrote:
>>> Please note that under those circumstances, what's guaranteed is
>>> forward-progress for workqueues which are used during memory reclaim.
>>> Continuously scheduling works which will in turn pile up on rtnl_lock
>>> is akin to constantly allocating memory while something holding
>>> rtnl_lock is blocked due to memory pressure.  Correctness-wise, it
>>> isn't necessarily deadlock but the only possible recourse is OOM.
>>
>>  From looking at the wireless code, since sdata is stopped, the
>> 'work' isn't going to actually do anything anyway.
>>
>> Is there a way to clear the work from the work-queue w/out
>> requiring any locks that a running worker thread might hold?
>> (So instead of flush_work, we could call something like "remove_all_work"
>> and not block on the worker thread that may currently be trying to
>> acquire rtnl?)
>
> Hmmm... there's cancel_work_sync().  It'll cancel if the work is
> pending and wait for completion if it's already running.  BTW, which

That would help, but it *might* be possible that the worker thread is
currently active.  That work shouldn't be asking for rtnl, as far as I can
tell, so maybe that's OK.  I'll give that a try in a bit.

> part of code are we talking about?  Can you please attach full thread
> dump at deadlock?

The problem code seems to be flush_work() call in ieee80211_do_stop()
in net/mac80211/iface.c.  RTNL is held when the flush_work() method
is called.

I've seen this apparently deadlock with a worker process trying to
call the wireless_nlevent_process method in net/wireless/wext-core.c
(it acquires rtnl).

Please let me know if you saw the previous thread dumps I sent in this thread.
Those were only for processes blocked > 120secs.  I can probably get
a full sysrq dump if you want that instead.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2010-11-12 18:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 23:02 ath5k/mac80211: Reproducible deadlock with 64-stations Ben Greear
2010-11-11  0:57 ` Ben Greear
2010-11-11  1:03   ` Johannes Berg
2010-11-11  5:51     ` Ben Greear
2010-11-11  1:02 ` Johannes Berg
2010-11-11  9:27   ` Tejun Heo
2010-11-11 16:55     ` Ben Greear
2010-11-11 18:26       ` Ben Greear
2010-11-11 23:12         ` Ben Greear
2010-11-12 10:11           ` Tejun Heo
2010-11-12 10:15             ` Tejun Heo
2010-11-12 18:06               ` Ben Greear
2010-11-12 18:13                 ` Tejun Heo
2010-11-12 18:34                   ` Ben Greear [this message]
2010-11-12 17:18             ` Ben Greear
2010-11-12  0:48       ` Ben Greear
2010-11-12  2:37         ` Johannes Berg
2010-11-12 16:32           ` Ben Greear
2010-11-12 16:45             ` Johannes Berg
2010-11-12 17:37               ` Ben Greear

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=4CDD88C9.3090901@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 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).