netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Jacek Konieczny <jajcus@jajcus.net>, <xen-devel@lists.xen.org>,
	<netdev@vger.kernel.org>, Paul Durrant <paul.durrant@citrix.com>
Subject: Re: [PATCH net V2] xen-netback: don't move event pointer in TX credit timeout callback
Date: Thu, 15 May 2014 18:03:14 +0100	[thread overview]
Message-ID: <5374F352.9050302@citrix.com> (raw)
In-Reply-To: <20140515165358.GA10525@zion.uk.xensource.com>

On 15/05/14 17:53, Wei Liu wrote:
> On Thu, May 15, 2014 at 05:34:09PM +0100, Zoltan Kiss wrote:
> [...]
>>>>>
>>>>>   		RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, more_to_do);
>>>>> -		if (!more_to_do)
>>>>> +		if (!more_to_do || rate_limited)
>>>> How about calling timer_pending(&vif->credit_timeout) instead?
>>>
>>> timer_pending(&vif->credit_timeout) covers only one of two senarios of
>>> "credit exceeded", see tx_credit_exceeded.
>> The other scenario is when the packet size exceeds the credit. There is no
>> packet here actually, we just want to know if this vif ran out of credit and
>> waiting for the timer to fire.
>>
>>>
>
> Which place are you referring to? There's packet in the ring, right? So
> you're saying in xenvif_poll "more_to_do" is true and "timer_pending" is
> also true when we come to xenvif_poll again?
The goal of this patch to deschedule NAPI if the vif ran out of credit. 
Either you can carry that information from build_gops via a bool, or you 
can check whether the timer is pending. That's what tx_credit_exceeded 
does as well, and then it checks if the actual packet fits in. But in 
xenvif_poll you don't want to know whether an actual packet fits in, you 
only need the information whether tx_credit_exceeded started the timer 
or not.
If it is, you can be sure there is no more credit. If not, you can keep 
the instance running.
>
>>>> Also, can this __napi_complete and the callback's napi_schedule race with
>>>> each other? When napi_complete is between removing from the list and
>>>> clearing the bit, and napi_schedule is just test&set the bit, the latter
>>>> won't add the instance to the list again
>>>>
>>>
>>> I think it should be fine. How is it different from what we already have
>>> now? Is this something similar to what David once posted?
>>>
>>>    <1395756505-21573-1-git-send-email-david.vrabel@citrix.com>
>> Unfortunately that discussion stalled, and my question were not answered, so
>> I bumped it again. But that's different a bit: it was about racing between
>> the NAPI instance (running in softirq context) and the interrupt. Here the
>> danger is that the NAPI instance and the softirq can race. They both run in
>> softirq context, and even if they were originally on the same CPU, I'm sure
>> if the instance move somewhere else, the timer doesn't follow it.
>>
>
> This comes back to that original question, doesn't it? That's NAPI
> running on CPU A and raised by CPU B.
>
> Wei.
>
>> Zoli

  reply	other threads:[~2014-05-15 17:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 11:59 [PATCH net V2] xen-netback: don't move event pointer in TX credit timeout callback Wei Liu
2014-05-15 13:04 ` Jacek Konieczny
2014-05-15 13:33   ` Wei Liu
2014-05-15 13:58   ` Wei Liu
2014-05-15 14:13   ` Wei Liu
2014-05-15 14:47     ` Zoltan Kiss
2014-05-15 15:30       ` Wei Liu
2014-05-15 16:34         ` Zoltan Kiss
2014-05-15 16:53           ` Wei Liu
2014-05-15 17:03             ` Zoltan Kiss [this message]
2014-05-15 18:16               ` Wei Liu
2014-05-15 13:40 ` [Xen-devel] " David Vrabel
2014-05-15 13:59   ` 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=5374F352.9050302@citrix.com \
    --to=zoltan.kiss@citrix.com \
    --cc=jajcus@jajcus.net \
    --cc=netdev@vger.kernel.org \
    --cc=paul.durrant@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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).