All of lore.kernel.org
 help / color / mirror / Atom feed
From: jianhai luan <jianhai.luan@oracle.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	xen-devel@lists.xenproject.org, netdev@vger.kernel.org,
	ANNIE LI <annie.li@oracle.com>
Subject: Re: DomU's network interface will hung when Dom0 running 32bit
Date: Wed, 16 Oct 2013 00:23:50 +0800	[thread overview]
Message-ID: <525D6C16.6010705@oracle.com> (raw)
In-Reply-To: <20131015160336.GT11739@zion.uk.xensource.com>


On 2013-10-16 0:03, Wei Liu wrote:
> On Tue, Oct 15, 2013 at 11:19:42PM +0800, jianhai luan wrote:
> [...]
>>>>>> * time_after_eq(now, next_credit) -> false
>>>>>> * time_before(now, expires) -> false
>>>>> If now is placed in above environment, the result will be correct
>>>>> (Sending package will be not allowed until next_credit).
>>>> No, it is not necessarily correct. Keep in mind that "now" wraps around,
>>>> which is the issue you try to fix. You still have a window to stall your
>>>> frontend.
>>> Remember that time_after_eq is supposed to work even with wraparound
>>> occurring, so long as the two times are less than MAX_LONG/2 apart.
>> Sorry for my misunderstand explanation. I mean that
>>    * time_after_eq()/time_before_eq() fix the jiffies wraparound, so
>> please think about  jiffies in line increasing.
>>    * time_after_eq()/time_before_eq() have the range (0, MAX_LONG/2),
>> the judge will be wrong if out of the range.
>>
>> So please think about three kind environment
>>    -  expires        now        next_credit
>>       --------time increases this direction ---------->
>>
>>    -  expires        [next_credit        now next_credit+MAX_LONG/2
>>       --------time increase this direction ----------->
>>
>>    - expires        next_credit        next_credit+MAX_LONG/2 now
>>       --------time increadse this direction ---------->
>>
>> The first environment should be netfront consume all credit_byte
>> before next_credit, So we should pending one timer to calculator the
>> new credit_byte, and don't transmit until next_credit.
>>
>> the second environment should be calculator the credit_byte because
>> netfront don't consume all credit_byte before next_credit, and
>> time_after_eq() do correct judge.
>>
>> the third environment should be calculator in time because netfront
>> don't consume all credit_byte until next_credit.But time_after_eq do
>> error judge (time_after_eq(now, next_credit) is false), so the
>> remaining_byte isn't be increased.
>>
>> and I work on the third environment.  You know now >
>> next_credit+MAX_LONG/2, time_before(now, expire) should be
>> true(time_before(now, expire) is false in first environment)
> Thanks for staighten this out for me. I'm just too dumb for this, please
> be patient with me. :-)
>
> Could you prove that time_before(now, expire) is always true in third
> case? That's where my main cencern lies. Is it because msecs_to_jiffies
> always returns MAX_JIFFY_OFFSET (which is ((LONG_MAX >> 1)-1) ) at most?

I have wrong judge in third environment. If now large than expires + 
MAX_UNLONG, time_before(now, expires) will be false.
   expires    next_credit    next_credit+MAX_UNLONG/2    expires + 
MAX_UNLONG    now    next_credit+MAX_UNLONG
   --------------------------------------------------------- time 
increadse this direction  ---------------------------------->

   In the above environment, time_before(now, expires) will return 
false. But the jiffies elapsed more time and next_credit will be 
reachable in soon(time_after_eq(now, next_credit) will be true).
>
> Wei.

  reply	other threads:[~2013-10-15 16:24 UTC|newest]

Thread overview: 52+ 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-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  9:34       ` jianhai luan
2013-10-15 10:06         ` Wei Liu
2013-10-15 11:26           ` jianhai luan
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:49                 ` Wei Liu
2013-10-15 14:50                   ` Ian Campbell
2013-10-15 14:50                   ` Ian Campbell
2013-10-15 15:19                     ` jianhai luan
2013-10-15 15:19                     ` jianhai luan
2013-10-15 16:03                       ` Wei Liu
2013-10-15 16:23                         ` jianhai luan [this message]
2013-10-16  0:15                           ` jianhai luan
2013-10-16  0:15                           ` jianhai luan
2013-10-15 16:23                         ` jianhai luan
2013-10-15 16:03                       ` Wei Liu
2013-10-15 14:29               ` jianhai luan
2013-10-16  7:35               ` 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:08                   ` [Xen-devel] " jianhai luan
2013-10-16 13:47                     ` Wei Liu
2013-10-16 13:47                     ` [Xen-devel] " Wei Liu
2013-10-16 15:04                       ` jianhai luan
2013-10-16 15:17                         ` Wei Liu
2013-10-16 15:17                         ` [Xen-devel] " Wei Liu
2013-10-16 16:11                           ` David Vrabel
2013-10-16 16:11                           ` [Xen-devel] " David Vrabel
2013-10-16 16:44                             ` jianhai luan
2013-10-16 16:44                             ` [Xen-devel] " jianhai luan
2013-10-16 15:26                         ` annie li
2013-10-16 15:26                         ` [Xen-devel] " annie li
2013-10-16 15:04                       ` jianhai luan
2013-10-16  9:39                 ` annie li
2013-10-15 12:58             ` Wei Liu
2013-10-15 10:06         ` Wei Liu
2013-10-16  7:10       ` annie li
2013-10-16  7:10       ` annie li
2013-10-16  8:46         ` Ian Campbell
2013-10-16  8:46         ` Ian Campbell
2013-10-15  8:43     ` Ian Campbell
2013-10-15  2:44   ` jianhai luan
  -- strict thread matches above, loose matches on Subject: below --
2013-10-12  8:53 jianhai luan

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=525D6C16.6010705@oracle.com \
    --to=jianhai.luan@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=annie.li@oracle.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 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.