linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Cc: ext Ido Yariv <ido@wizery.com>,
	"Coelho Luciano (Nokia-MS/Helsinki)" <Luciano.Coelho@nokia.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 2/4] wl1271: Fix TX starvation
Date: Mon, 11 Oct 2010 12:00:56 +0200	[thread overview]
Message-ID: <1286791256.3634.11.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1286791018.11177.484.camel@wimaxnb.nmp.nokia.com>

On Mon, 2010-10-11 at 12:56 +0300, Juuso Oikarinen wrote:

> > @@ -537,6 +533,17 @@ static void wl1271_irq_work(struct work_struct *work)
> >  			    (wl->tx_results_count & 0xff))
> >  				wl1271_tx_complete(wl);
> >  
> > +			/* Check if any tx blocks were freed */
> > +			if ((wl->tx_blocks_available > prev_tx_blocks) &&
> > +					!skb_queue_empty(&wl->tx_queue)) {
> > +				/*
> > +				 * In order to avoid starvation of the TX path,
> > +				 * call the work function directly.
> > +				 */
> > +				cancel_work_sync(&wl->tx_work);
> 
> Hmm, isn't this causing a theoretical potential for a dead-lock? The
> tx_work could be waiting in mutex-lock already when cancel_work_sync is
> called, in which case cancel_work_sync would lock forever.
> 
> IIRC the irq_work and tx_work currently run in the same queue, so this
> may work with the current driver. Smells like a hazard anyway, and
> changing the workqueues for each work could easily lead to dead locks
> here. So at minimum I'd like to see it documented in the comment why
> this cannot cause a deadlock.

It should still cause a lockdep warning which you may want to avoid ...
and unless I'm looking at the wrong driver, this is in an irqs disabled
section which is wrong as well.

johannes


  reply	other threads:[~2010-10-11 10:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11  8:48 [PATCH 0/4] wl1271: TX optimizations & fixes Ido Yariv
2010-10-11  8:48 ` [PATCH 1/4] wl1271: TX aggregation optimization Ido Yariv
2010-10-11  8:48 ` [PATCH 2/4] wl1271: Fix TX starvation Ido Yariv
2010-10-11  9:56   ` Juuso Oikarinen
2010-10-11 10:00     ` Johannes Berg [this message]
2010-10-11 23:44     ` Ido Yariv
2010-10-11  8:48 ` [PATCH 3/4] wl1271: Allocate TX descriptors more efficiently Ido Yariv
2010-10-11  8:48 ` [PATCH 4/4] wl1271: Fix TX queue low watermark handling Ido Yariv

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=1286791256.3634.11.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=Luciano.Coelho@nokia.com \
    --cc=ido@wizery.com \
    --cc=juuso.oikarinen@nokia.com \
    --cc=linux-wireless@vger.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).