xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <Wei.Liu2@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Mats Petersson <mats.petersson@citrix.com>,
	wei.liu2@citrix.com,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH V4] Switch from select() to poll() in xenconsoled's IO loop
Date: Mon, 7 Jan 2013 15:24:39 +0000	[thread overview]
Message-ID: <1357572279.13581.13.camel@iceland> (raw)
In-Reply-To: <1357571769.7989.114.camel@zakaz.uk.xensource.com>

On Mon, 2013-01-07 at 15:16 +0000, Ian Campbell wrote:
> On Mon, 2013-01-07 at 15:01 +0000, Wei Liu wrote:
> > On Mon, 2013-01-07 at 14:41 +0000, Mats Petersson wrote:
> > 
> > > >                          return;
> > > > @@ -982,11 +1024,7 @@ void handle_io(void)
> > > >                  /* Re-calculate any event counter allowances & unblock
> > > >                     domains with new allowance */
> > > >                  for (d = dom_head; d; d = d->next) {
> > > > -                       /* Add 5ms of fuzz since select() often returns
> > > > -                          a couple of ms sooner than requested. Without
> > > > -                          the fuzz we typically do an extra spin in select()
> > > > -                          with a 1/2 ms timeout every other iteration */
> > > > -                       if ((now+5) > d->next_period) {
> > > > +                       if (now > d->next_period) {
> > > Is poll more accurate than select? I would have thought that they were
> > > based on the same timing, and thus equally "fuzzy"?
> > 
> > Is there any actual proof that the fuzz is needed? Specs of both
> > select() and poll() don't seem to mention this behaviour at all.
> 
> I agree that it seems pretty dubious but it might be interesting to see
> what strace shows, specifically if it shows this extra spin every other
> iteration.
> 
> The fuzz was introduced in 16257:955ee4fa1345 "Rate-limit activity
> caused by each domU." but the commit log doesn't make any reference to
> the reason for it.
> 
> It may just have been a kernel bug at around the time that patch was
> authored, but google doesn't seem to show any evidence of such a bug
> ever being widespread (i.e. I don't find any references to it).
> 

Then I will leave the fuzz here, and do another patch to remove it.

I will also add reference to CS 16257 in the comment.


Wei.

      reply	other threads:[~2013-01-07 15:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03 17:14 [PATCH] Switch to poll in xenconsoled's io loop Wei Liu
2013-01-03 18:22 ` Mats Petersson
2013-01-04 12:30   ` Wei Liu
2013-01-04 15:58 ` [PATCH V2] Switch from select() to poll() in xenconsoled's IO loop Wei Liu
2013-01-04 16:08   ` Ian Campbell
2013-01-04 16:38     ` Wei Liu
2013-01-04 16:51       ` Mats Petersson
2013-01-04 17:17 ` [PATCH V3] " Wei Liu
2013-01-07 10:20   ` Ian Campbell
2013-01-07 12:12     ` Wei Liu
2013-01-07 12:16       ` Ian Campbell
2013-01-07 14:28 ` [PATCH V4] " Wei Liu
2013-01-07 14:39   ` Ian Campbell
2013-01-07 14:44     ` Wei Liu
2013-01-07 14:52     ` Ian Jackson
2013-01-07 14:41   ` Mats Petersson
2013-01-07 15:01     ` Wei Liu
2013-01-07 15:06       ` Mats Petersson
2013-01-07 15:17         ` Ian Campbell
2013-01-07 15:16       ` Ian Campbell
2013-01-07 15:24         ` Wei Liu [this message]

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=1357572279.13581.13.camel@iceland \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=mats.petersson@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).