From: Oliver Neukum <oneukum@suse.de>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "'Bjørn Mork'" <bjorn@mork.no>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: usbnet OOM handling - possible CPU starvation?
Date: Tue, 18 Mar 2014 12:01:03 +0100 [thread overview]
Message-ID: <1395140463.5069.15.camel@linux-fkkt.site> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D0F6E00AE@AcuExch.aculab.com>
On Tue, 2014-03-18 at 10:29 +0000, David Laight wrote:
> From: Bjørn Mork
Hi,
> > To recall: The NCM and MBIM protocols aggregate packets before
> > transission over the USB link, requiring USB buffers with multiple
> > ethernet/IP packets. Common code used by both cdc_mbim and cdc_ncm
> > currently cap the buffers at 32768 bytes (hard coded limit), which is
> > still too high for some embedded hosts. This results in failures to
> > allocate buffers in rx_submit (flags == GFP_ATOMIC when it is called
> > from the URB callback):
True. We cannot rely on this working from a callback. So the correct
OOM response would happen from a delayed work queue.
> It really doesn't make much sense (to me) to transmit and receive
> aggregated packets from dynamically allocated skb.
> I'd have thought it much better to copy the ethernet frames to/from
> pre-allocated buffers.
That makes sense.
> The transmit side could have 2 buffers, and at most one active urb.
> So merges until the previous tx finishes (or 3 buffers and two
> active tx).
We had bad experiences with that scheme. It turns out that you
need to have two URBs in flight, because the time you lose waiting
for the next frame to begin is too high.
So you need at least three buffers.
Regards
Oliver
prev parent reply other threads:[~2014-03-18 11:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 9:59 usbnet OOM handling - possible CPU starvation? Bjørn Mork
2014-03-18 10:29 ` David Laight
2014-03-18 11:01 ` Oliver Neukum [this message]
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=1395140463.5069.15.camel@linux-fkkt.site \
--to=oneukum@suse.de \
--cc=David.Laight@ACULAB.COM \
--cc=bjorn@mork.no \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@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).