From: jianhai luan <jianhai.luan@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>, Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xenproject.org, annie li <annie.li@oracle.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
netdev@vger.kernel.org
Subject: Re: [Xen-devel] DomU's network interface will hung when Dom0 running 32bit
Date: Thu, 17 Oct 2013 00:44:53 +0800 [thread overview]
Message-ID: <525EC285.4000009@oracle.com> (raw)
In-Reply-To: <525EBABB.4070906@citrix.com>
On 2013-10-17 0:11, David Vrabel wrote:
> On 16/10/13 16:17, Wei Liu wrote:
>> On Wed, Oct 16, 2013 at 11:04:34PM +0800, jianhai luan wrote:
>> [...]
>>> >From ef02403a10173896c5c102f768741d0700b8a3a2 Mon Sep 17 00:00:00 2001
>>> From: Jason Luan <jianhai.luan@oracle.com>
>>> Date: Tue, 15 Oct 2013 17:07:49 +0800
>>> Subject: [PATCH] xen-netback: pending timer only in the range [expire,
>>> next_credit)
>>>
>>> The function time_after_eq() do correct judge in range of MAX_UNLONG/2.
>>> If net-front send lesser package, the delta between now and next_credit
>>> will out of the range and time_after_eq() will do wrong judge in result
>>> to net-front hung. For example:
>>> expire next_credit .... next_credit+MAX_UNLONG/2 now
>>> -----------------time increases this direction----------------->
>>>
>>> We should be add the environment which now beyond next_credit+MAX_UNLONG/2.
>>> Because the fact now mustn't before expire, time_before(now, expire) == true
>>> will show the environment.
>>> time_after_eq(now, next_credit) || time_before (now, expire)
>>> ==
>>> !time_in_range_open(now, expire, next_credit)
>>>
> I would like the description improved because it's too hard to understand.
>
> How about something like:
>
> "time_after_eq() only works if the delta is < MAX_ULONG/2.
>
> If netfront sends at a very low rate, the time between subsequent calls
> to tx_credit_exceeded() may exceed MAX_ULONG/2 and the test for
> timer_after_eq() will be incorrect. Credit will not be replenished and
> the guest may become unable to send (e.g., if prior to the long gap, all
> credit was exhausted)."
Thanks your description, i will accept it. :)
>
> But that's as far as I get because I can't see how the fix is correct.
> The time_in_range() test might still return the wrong value if now has
> advanced even further and wrapped so it is between expire and
> next_credit again.
typo, time_in_range() should be time_in_range_open().
Yes, if now have advanced even further and wrapped, it will always fall
in [ expire, next_credit). In the range, please think two scenario:
* No transmit limit: expire == next_credit, the range will be zero,
replenish will always be done.
* Transmit limit: Because guest may be consume all credit_bytes in
very short time, other time in [expire, next_credit) will don't send any
package. So the time which don't send package should be think about when
we set the rate parameter.
So if now fall in the range, the hung time should be acceptable.
(if rate=10000M/s, the worse time will be 4s).
>
> I think the credit timeout should be always armed to expire in
> MAX_ULONG/4 jiffies (or some other large value). If credit is exceeded,
> this timer is then adjusted to fire earlier (at next_credit as it does
> already).
Setting timer may be fixed the issue. But i don't think how to verify
the fixed expect waiting 180 days. I verified the above patch only
change expire's value to emulator the scenario.
>
> David
Jason.
next prev parent reply other threads:[~2013-10-16 16:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-12 8:53 DomU's network interface will hung when Dom0 running 32bit jianhai luan
2013-10-14 11:19 ` Wei Liu
2013-10-15 2:44 ` jianhai luan
2013-10-15 8:43 ` Ian Campbell
2013-10-15 9:34 ` jianhai luan
2013-10-15 10:06 ` Wei Liu
2013-10-15 11:26 ` jianhai luan
2013-10-15 12:58 ` Wei Liu
2013-10-15 14:29 ` jianhai luan
2013-10-15 14:49 ` Wei Liu
2013-10-15 14:50 ` Ian Campbell
2013-10-15 15:19 ` jianhai luan
2013-10-15 16:03 ` Wei Liu
2013-10-15 16:23 ` jianhai luan
2013-10-16 0:15 ` jianhai luan
2013-10-16 7:35 ` jianhai luan
2013-10-16 9:39 ` [Xen-devel] " annie li
2013-10-16 13:08 ` jianhai luan
2013-10-16 13:47 ` Wei Liu
2013-10-16 15:04 ` jianhai luan
2013-10-16 15:17 ` Wei Liu
2013-10-16 16:11 ` David Vrabel
2013-10-16 16:44 ` jianhai luan [this message]
2013-10-16 15:26 ` annie li
2013-10-16 7:10 ` annie li
2013-10-16 8:46 ` Ian Campbell
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=525EC285.4000009@oracle.com \
--to=jianhai.luan@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=annie.li@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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).