From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
xen-devel@lists.xenproject.org, dario.faggioli@citrix.com,
keir.xen@gmail.com
Subject: Re: RUNSTATE_runnable delta time for idle_domain accounted to HVM guest.
Date: Wed, 7 May 2014 09:33:08 -0400 [thread overview]
Message-ID: <20140507133308.GD9190@phenom.dumpdata.com> (raw)
In-Reply-To: <536A05E4020000780000FB39@mail.emea.novell.com>
On Wed, May 07, 2014 at 09:07:32AM +0100, Jan Beulich wrote:
> >>> On 06.05.14 at 19:36, <konrad.wilk@oracle.com> wrote:
> > The reason we schedule a tasklet instead of continuing with an
> > 'vcpu_kick' is not yet known to me. This commit added the mechanism
> > to do it via the tasklet:
I should also add that a bit more digging and I realized that
the reason we have so many of the tasklets running (the guests
couldn't be that insane to schedule so many alarms for one-shot timers!)
is that we do PCI passthrough. And that uses the 'hvm_dirq_assist'
tasklet (hvm_do_IRQ_dpci). As in we serialize passthrough interrupts
for all of the guests via this tasklet lock.
And in this particular setups, the other sockets are busy
doing I/O over PCI passthrough devices. Hence the lock is taken
quite frequently - over all off the sockets.
<Big sigh>
> >
> > commit a5db2986d47fafc5e62f992616f057bfa43015d9
> > Author: Keir Fraser <keir.fraser@citrix.com>
> > Date: Fri May 8 11:50:12 2009 +0100
> >
> > x86 hvm: hvm_set_callback_irq_level() must not be called in IRQ
> > context or with IRQs disabled. Ensure this by deferring to tasklet
> > (softirq) context if required.
> >
> > Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
> >
> > But I am not sure why:
> >
> > a). 'must not be called in IRQ context or with IRQs disabled' is
> > important - I haven't dug in the code yet to understand the
> > crucial reasons for - is there a known issue about this?
>
> Because of its use of spin_lock(), which would have the potential
> for a deadlock if the function was called in the wrong context. The
> apparent alternative would be to make all users of
> d->arch.hvm_domain.irq_lock use the IRQ-safe variant; I didn't
> check whether that would in turn cause new problems.
<chuckles> Thanks for the pointer.
>
> > b). Why do we have a per-cpu tasklet lists, but any manipulation of the
> > items of them are protected by a global lock. Looking at the code in
> > Linux and Xen the major difference is that Xen can schedule on specific CPUs
> > (or even the tasklet can schedule itself on another CPU).
>
> tasklet_kill() and migrate_tasklets_from_cpu() at the very least
> would need very careful modification if you were to replace the
> global lock.
<nods> That was my feeling as well.
>
> > I can see the need for the tasklets being on different CPUs for
> > the microcode, and I am digging through the other ones to get
> > a feel for it - but has anybody thought about improving this
> > code? Has there been any suggestions/ideas tossed around in the
> > past (the mailing list didn't help or my Google-fun sucks).
>
> I'm not aware of any such, quite likely because no-one so far
> spotted a problem with the current implementation.
Yeey! First one to discover!
>
> Jan
>
next prev parent reply other threads:[~2014-05-07 13:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-23 21:28 RUNSTATE_runnable delta time for idle_domain accounted to HVM guest Konrad Rzeszutek Wilk
2014-04-24 7:58 ` Jan Beulich
2014-04-24 18:02 ` Konrad Rzeszutek Wilk
2014-04-29 9:16 ` George Dunlap
2014-04-29 12:42 ` Konrad Rzeszutek Wilk
2014-05-06 17:36 ` Konrad Rzeszutek Wilk
2014-05-07 8:07 ` Jan Beulich
2014-05-07 13:33 ` Konrad Rzeszutek Wilk [this message]
2014-05-07 14:10 ` Jan Beulich
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=20140507133308.GD9190@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=dario.faggioli@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=keir.xen@gmail.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).