From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Cc: linux-wireless@vger.kernel.org, Felix Fietkau <nbd@nbd.name>
Subject: Re: [RFC 11/12] mt76usb: allocate urb and sg as linear data
Date: Wed, 13 Mar 2019 13:59:16 +0100 [thread overview]
Message-ID: <20190313125916.GC2003@redhat.com> (raw)
In-Reply-To: <20190312163431.GF2611@localhost.localdomain>
On Tue, Mar 12, 2019 at 05:34:32PM +0100, Lorenzo Bianconi wrote:
> > Alloc sg table at the end of urb structure. This will increase
> > cache usage.
> >
>
> I am curious, have you observed any performance improvement doing so?
It's hard to measure that. Stressing net transfer with about 175 Mbit/s
by netperf (what is max I can get) only took about 15% of CPU for me
and net performance fluctuate so CPU pref stats vary too.
> > - if (dev->usb.sg_en) {
> > - urb->sg = devm_kcalloc(dev->dev, MT_SG_MAX_SIZE,
> > - sizeof(urb->sg), GFP_KERNEL);
FTR: Here is bug it should be sizeof(*urb->sg).
> > - if (!urb->sg)
> > - return -ENOMEM;
> > - }
> > + usb_init_urb(e->urb);
> > +
> > + if (dev->usb.sg_en)
> > + e->urb->sg = (struct scatterlist *)((u8 *)e->urb + sizeof(struct urb));
>
> You can avoid u8 cast doing:
> (struct scatterlist *)(e->urb + 1)
Cool trick!
Stanislaw
next prev parent reply other threads:[~2019-03-13 12:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-12 15:05 [RFC 00/12] mt76usb: some cleanups and optimizations Stanislaw Gruszka
2019-03-12 15:05 ` [RFC 01/12] mt76usb: change mt76u_submit_buf Stanislaw Gruszka
2019-03-12 15:05 ` [RFC 02/12] mt76: remove rx_page_lock Stanislaw Gruszka
2019-03-12 15:05 ` [RFC 03/12] mt76usb: change mt76u_fill_rx_sg arguments Stanislaw Gruszka
2019-03-12 15:05 ` [RFC 04/12] mt76usb: use usb_dev private data Stanislaw Gruszka
2019-03-12 15:05 ` [RFC 05/12] mt76usb: remove mt76u_buf redundant fileds Stanislaw Gruszka
2019-03-12 16:25 ` Lorenzo Bianconi
2019-03-13 12:53 ` Stanislaw Gruszka
2019-03-12 15:06 ` [RFC 06/12] mt76usb: move mt76u_buf->done to queue entry Stanislaw Gruszka
2019-03-12 15:06 ` [RFC 07/12] mt76usb: remove mt76u_buf and use urb directly Stanislaw Gruszka
2019-03-12 16:27 ` Lorenzo Bianconi
2019-03-13 12:53 ` Stanislaw Gruszka
2019-03-12 15:06 ` [RFC 08/12] mt76usb: remove MT_RXQ_MAIN queue from mt76u_urb_alloc Stanislaw Gruszka
2019-03-12 15:06 ` [RFC 09/12] mt76usb: resue mt76u_urb_alloc for tx Stanislaw Gruszka
2019-03-12 15:06 ` [RFC 10/12] mt76usb: remove unneded sg_init_table Stanislaw Gruszka
2019-03-12 15:06 ` [RFC 11/12] mt76usb: allocate urb and sg as linear data Stanislaw Gruszka
2019-03-12 16:34 ` Lorenzo Bianconi
2019-03-13 12:59 ` Stanislaw Gruszka [this message]
2019-03-12 15:06 ` [RFC 12/12] mt76usb: remove queue variable from rx_tasklet 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=20190313125916.GC2003@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
/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.