All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Sander Eikelenboom <linux@eikelenboom.it>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: RE: [Xen-devel] [PATCH net v2 1/3] xen-netback: remove pointless clause from if statement
Date: Fri, 28 Mar 2014 10:12:26 +0000	[thread overview]
Message-ID: <9AAE0902D5BC7E449B7C8E4E778ABCD029E0ED@AMSPEX01CL01.citrite.net> (raw)
In-Reply-To: <1112313727.20140328105942@eikelenboom.it>

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Sander Eikelenboom
> Sent: 28 March 2014 10:00
> To: Paul Durrant
> Cc: netdev@vger.kernel.org; Wei Liu; Ian Campbell; xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] [PATCH net v2 1/3] xen-netback: remove pointless
> clause from if statement
> 
> 
> Friday, March 28, 2014, 10:47:20 AM, you wrote:
> 
> >> -----Original Message-----
> >> From: Sander Eikelenboom [mailto:linux@eikelenboom.it]
> >> Sent: 28 March 2014 09:39
> >> To: Paul Durrant
> >> Cc: netdev@vger.kernel.org; Wei Liu; Ian Campbell; xen-
> devel@lists.xen.org
> >> Subject: Re: [Xen-devel] [PATCH net v2 1/3] xen-netback: remove
> pointless
> >> clause from if statement
> >>
> >>
> >> Friday, March 28, 2014, 10:30:27 AM, you wrote:
> >>
> >> >> -----Original Message-----
> >> >> From: Sander Eikelenboom [mailto:linux@eikelenboom.it]
> >> >> Sent: 27 March 2014 19:23
> >> >> To: Paul Durrant
> >> >> Cc: netdev@vger.kernel.org; Wei Liu; Ian Campbell; xen-
> >> devel@lists.xen.org
> >> >> Subject: Re: [Xen-devel] [PATCH net v2 1/3] xen-netback: remove
> >> pointless
> >> >> clause from if statement
> >> >>
> >> >>
> >> >> Thursday, March 27, 2014, 7:34:54 PM, you wrote:
> >> >>
> >> >> > <big snip>
> >> >>
> >> >> >>> >>
> >> >> >>> >> > So, it may be that the worse-case estimate is now too bad. In
> >> the
> >> >> case
> >> >> >>> >> where it's failing for you it would be nice to know what the
> >> estimate
> >> >> was
> >> >> >>>
> >> >> >>>
> >> >> >>> > Ok, so we cannot be too pessimistic. In that case I don't see
> there's
> >> a
> > > The behaviour of the Windows frontend is different to netfront; it tries to
> > keep the shared ring as full as possible so the estimate could be as
> > pessimistic as you like (as long as it doesn't exceed ring size ;-)) and you'd
> > never see the lock-up. For some reason (best known to the originator of
> the
> > code I suspect) the Linux netfront driver limits the number of requests it
> > posts into the shared ring leading to the possibility of lock-up in the case
> > where the backend needs more slots than the fontend 'thinks' it should.
> > But from what i read the ring size is determined by the frontend .. so that
> PV
> > driver should be able to guarantee that itself ..
> >
> 
> > The ring size is 256 - that's baked in. The number of pending requests
> > available to backend *is* determined by the frontend.
> 
> Ah ok, does it also reverse that space ?
> (if so .. why not use it to allow multiple complete packets to be shoveled in)
> 
> > Which begs for the question .. was that change of max_slots_needed
> > calculation *needed* to prevent the problem you saw on "Windows Server
> > 2008R2",
> > or was that just changed for correctness ?
> >
> 
> > It was changed for correctness. As I understand it, use of MAX_SKB_FRAGS
> is
> > incorrect if compound pages are in use as the page size is no longer the slot
> > size. It's also wasteful to always wait for space for a maximal packet if the
> > packet you have is smaller so the intention of the max estimate was that it
> > should be at least the number of slots required but not excessive. I think
> > you've proved that making such an estimate is just too hard and since we
> don't
> > want to fall back to the old dry-run style of slot counting (which meant you
> > had two codepaths that *must* arrive at the same number - and they
> didn't,
> > which is why I was getting the lock-up with Windows guests) I think we
> should
> > just go with full-packing so that we don't need to estimate.
> 
> Ok i asked this question since the about to be released 3.14 does now
> underestimate and
> it causes a regression.
> So if that part of your patches is not involved in fixing the stated problem /
> regression i think
> just that calculation change should be reverted to the MAX_SKB_FRAGS
> variant again.
> It's more wasteful (as it always has been) but that is better than incorrect and
> inducing buffer overrun IMHO.

But I'm not sure even that is correct. Are you?

> 
> That would give time to think, revise and test this for 3.15.
> 
> BTW: if a slot is always 4k, should it check with PAGE_SIZE then on a lot of
> occasions or just with the
> hardcoded 4k slot size ? (at the moment you only have x86 dom0 so probably
> the page_size==4k is guaranteed that way,
> but nevertheless.)
> 

Well, it's 4k because that's the smallest x86 page size and that's what Xen uses in its ABI so I guess the slot size should really be acquired from Xen to be architecture agnostic.

  Paul

> > Paul
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-03-28 10:12 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 12:56 [PATCH net v2 0/3] xen-netback: fix rx slot estimation Paul Durrant
2014-03-27 12:56 ` [PATCH net v2 1/3] xen-netback: remove pointless clause from if statement Paul Durrant
2014-03-27 12:56 ` Paul Durrant
2014-03-27 13:45   ` Sander Eikelenboom
2014-03-27 13:45   ` Sander Eikelenboom
2014-03-27 13:54     ` Paul Durrant
2014-03-27 13:54     ` Paul Durrant
2014-03-27 14:02       ` Sander Eikelenboom
2014-03-27 14:09         ` Paul Durrant
2014-03-27 14:29           ` Sander Eikelenboom
2014-03-27 14:29           ` Sander Eikelenboom
2014-03-27 14:38             ` Paul Durrant
2014-03-27 14:38             ` Paul Durrant
2014-03-27 16:46           ` Sander Eikelenboom
2014-03-27 16:54             ` Paul Durrant
2014-03-27 17:15               ` Sander Eikelenboom
2014-03-27 17:26                 ` Paul Durrant
2014-03-27 17:26                 ` Paul Durrant
2014-03-27 18:34                   ` Sander Eikelenboom
2014-03-27 19:22                     ` [Xen-devel] " Sander Eikelenboom
2014-03-28  9:30                       ` Paul Durrant
2014-03-28  9:30                       ` [Xen-devel] " Paul Durrant
2014-03-28  9:39                         ` Sander Eikelenboom
2014-03-28  9:47                           ` Paul Durrant
2014-03-28  9:59                             ` Sander Eikelenboom
2014-03-28 10:12                               ` Paul Durrant [this message]
2014-03-28 10:36                                 ` Sander Eikelenboom
2014-03-28 10:36                                 ` [Xen-devel] " Sander Eikelenboom
2014-03-28 10:12                               ` Paul Durrant
2014-03-28  9:59                             ` Sander Eikelenboom
2014-03-28 10:01                             ` David Laight
2014-03-28 10:01                             ` [Xen-devel] " David Laight
2014-03-28 10:20                               ` Paul Durrant
2014-03-28 10:35                                 ` David Laight
2014-03-28 10:35                                 ` [Xen-devel] " David Laight
2014-03-28 10:42                                   ` Sander Eikelenboom
2014-03-28 10:42                                   ` [Xen-devel] " Sander Eikelenboom
2014-03-28 10:47                                     ` Paul Durrant
2014-03-28 10:47                                     ` [Xen-devel] " Paul Durrant
2014-03-28 10:53                                       ` Sander Eikelenboom
2014-03-28 10:53                                       ` [Xen-devel] " Sander Eikelenboom
2014-03-28 11:11                                     ` David Laight
2014-03-28 11:35                                       ` Sander Eikelenboom
2014-03-28 11:35                                       ` Sander Eikelenboom
2014-03-28 11:11                                     ` David Laight
2014-03-28 10:44                                   ` Paul Durrant
2014-03-28 10:44                                   ` [Xen-devel] " Paul Durrant
2014-03-28 10:20                               ` Paul Durrant
2014-03-28  9:47                           ` Paul Durrant
2014-03-28  9:39                         ` Sander Eikelenboom
2014-03-27 19:22                     ` Sander Eikelenboom
2014-03-28  0:55                     ` Sander Eikelenboom
2014-03-28  0:55                     ` [Xen-devel] " Sander Eikelenboom
2014-03-28  9:36                       ` Paul Durrant
2014-03-28  9:36                       ` [Xen-devel] " Paul Durrant
2014-03-28  9:46                         ` Sander Eikelenboom
2014-03-28  9:46                         ` [Xen-devel] " Sander Eikelenboom
2014-03-27 18:34                   ` Sander Eikelenboom
2014-03-27 17:15               ` Sander Eikelenboom
2014-03-27 16:54             ` Paul Durrant
2014-03-27 16:46           ` Sander Eikelenboom
2014-03-27 14:09         ` Paul Durrant
2014-03-27 14:02       ` Sander Eikelenboom
2014-03-27 14:00     ` Paul Durrant
2014-03-27 14:05       ` Sander Eikelenboom
2014-03-27 14:05       ` Sander Eikelenboom
2014-03-27 14:00     ` Paul Durrant
2014-03-27 12:56 ` [PATCH net v2 2/3] xen-netback: worse-case estimate in xenvif_rx_action is underestimating Paul Durrant
2014-03-27 12:56 ` Paul Durrant
2014-03-27 12:56 ` [PATCH net v2 3/3] xen-netback: BUG_ON in xenvif_rx_action() not catching overflow Paul Durrant
2014-03-27 12:56 ` Paul Durrant

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=9AAE0902D5BC7E449B7C8E4E778ABCD029E0ED@AMSPEX01CL01.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=linux@eikelenboom.it \
    --cc=netdev@vger.kernel.org \
    --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 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.