All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
	nbd@nbd.name, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mt76: usb: reduce locking in mt76u_tx_tasklet
Date: Mon, 25 Mar 2019 14:00:36 +0100	[thread overview]
Message-ID: <20190325130035.GA12885@localhost.localdomain> (raw)
In-Reply-To: <20190325125032.GB17956@redhat.com>

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

> On Sun, Mar 24, 2019 at 03:51:43PM +0100, Lorenzo Bianconi wrote:
> > +		int idx;
> > +
> >  		sq = &dev->q_tx[i];
> >  		q = sq->q;
> >  
> > -		spin_lock_bh(&q->lock);
> > -		while (true) {
> > -			if (!q->entry[q->head].done || !q->queued)
> > +		while (q->queued > n_queued) {
> > +			if (!q->entry[q->head].done)
> >  				break;
> If you place done = false here you will not need additional idx
> variable.

As Felix suggested, I would set done to false at the end of the loop, after
tx_complete_skb

> 
> >  			dev->drv->tx_complete_skb(dev, i, &entry);
> > -			spin_lock_bh(&q->lock);
> > +			q->entry[idx].done = false;
> >  		}
> >  
> > +		spin_lock_bh(&q->lock);
> This patch does not apply for me as there is missing
> mt76_txq_schedule(dev, sq);

Sorry I forgot to mention this patch is based on
https://patchwork.kernel.org/patch/10856027/. Have you applied it?

> 
> > +
> > +		sq->swq_queued -= n_sw_queued;
> > +		q->queued -= n_queued;
> > +
> Naming is confusing, it should rather be n_dequeued, n_sw_dequeued.

I just followed dma counterpart naming convention, but I can modify it.

Regards,
Lorenzo

> 
> Stanislaw

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2019-03-25 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1553437543.git.lorenzo@kernel.org>
2019-03-24 14:51 ` [PATCH] mt76: usb: reduce locking in mt76u_tx_tasklet Lorenzo Bianconi
2019-03-25 12:50   ` Stanislaw Gruszka
2019-03-25 13:00     ` Lorenzo Bianconi [this message]
2019-03-25 13:10       ` Stanislaw Gruszka
2019-03-25 13:47         ` Lorenzo Bianconi
2019-03-25 14:31           ` Stanislaw Gruszka

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=20190325130035.GA12885@localhost.localdomain \
    --to=lorenzo.bianconi@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=sgruszka@redhat.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.