netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Bader <stefan.bader@canonical.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Zoltan Kiss <zoltan.kiss@citrix.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [Xen-devel] xen-netfront possibly rides the rocket too often
Date: Fri, 16 May 2014 12:17:48 +0200	[thread overview]
Message-ID: <5375E5CC.2080904@canonical.com> (raw)
In-Reply-To: <5375E3EE.6010306@canonical.com>

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

On 16.05.2014 12:09, Stefan Bader wrote:
> On 16.05.2014 11:48, Wei Liu wrote:
>> On Thu, May 15, 2014 at 02:14:00PM +0200, Stefan Bader wrote:
>> [...]
>>>> Wei.
>>>>
>>> Reading more of the code I would agree. The definition of MAX_SKB_FRAGS (at
>>> least now with compound pages) cannot be used in any way to derive the number of
>>> 4k slots a transfer will require.
>>>
>>> Zoltan already commented on worst cases. Not sure it would get as bad as that or
>>> "just" 16*4k frags all in the middle of compound pages. That would then end in
>>> around 33 or 34 slots, depending on the header.
>>>
>>> Zoltan wrote:
>>>> I think the worst case scenario is when every frag and the linear buffer contains 2 bytes,
>>>> which are overlapping a page boundary (that's (17+1)*2=36 so far), plus 15 of
>>> them have a 4k
>>>> page in the middle of them, so, a 1+4096+1 byte buffer can span over 3 page.
>>>> That's 51 individual pages.
>>>
>>> I cannot claim to really know what to expect worst case. Somewhat I was thinking
>>> of a
>>> worst case of (16+1)*2, which would be inconvenient enough.
>>>
>>> So without knowing exactly how to do it, but as Ian said it sounds best to come
>>> up with some sort of exception coalescing in cases the slot count goes over 18
>>> and we know the data size is below 64K.
>>>
>>
>> I took a stab at it this morning and came up with this patch. Ran
>> redis-benchmark, it seemed to fix that for me -- only saw one "failed to
>> linearize skb" during
>>
>>   redis-benchmark -h XXX -d 1000 -t lrange
>>
>> And before this change, a lot of "rides rocket" were triggered.
>>
>> Thought?
> 
> It appears at least to me as something that nicely makes use of existing code. I
> was wondering about what could or could not be used. Trying to get ones head
> around the whole thing is kind of a lot to look at.
> 
> The change at least looks straight forward enough.

The only woe for me is that I am looking puzzled at the implementation of
skb_linearize(). Somehow the data_len element decides whether a skb can be
linearized and basically how much it tries to pull from the tail. It probably
makes sense ... just not to me with not deep experience here.

-Stefan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2014-05-16 10:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 18:21 xen-netfront possibly rides the rocket too often Stefan Bader
2014-05-14 19:49 ` Zoltan Kiss
2014-05-14 20:06   ` Zoltan Kiss
2014-05-15  8:38     ` [Xen-devel] " Sander Eikelenboom
2014-05-15  9:03       ` Stefan Bader
2014-05-15  8:46   ` Ian Campbell
2014-05-15  8:58     ` Stefan Bader
2014-05-15  9:38       ` Sander Eikelenboom
2014-05-15 11:04     ` Wei Liu
2014-05-15 11:14       ` David Laight
2014-05-15 11:47       ` Ian Campbell
2014-05-15 12:14       ` Stefan Bader
2014-05-16  9:48         ` Wei Liu
2014-05-16  9:57           ` Wei Liu
2014-05-16 10:05           ` David Laight
2014-05-16 10:22             ` Wei Liu
2014-05-16 10:09           ` Stefan Bader
2014-05-16 10:17             ` Stefan Bader [this message]
2014-05-16 10:32               ` Wei Liu

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=5375E5CC.2080904@canonical.com \
    --to=stefan.bader@canonical.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zoltan.kiss@citrix.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 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).