All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Keir Fraser <keir@xen.org>
Cc: xen-devel@lists.xensource.com, Jan Beulich <JBeulich@novell.com>
Subject: Re: Re: how to handle paged hypercall args?
Date: Fri, 3 Dec 2010 10:14:30 +0100	[thread overview]
Message-ID: <20101203091430.GC6055@aepfle.de> (raw)
In-Reply-To: <C91D25CA.BB1B%keir@xen.org>

On Thu, Dec 02, Keir Fraser wrote:

> On 02/12/2010 10:22, "Keir Fraser" <keir@xen.org> wrote:
> 
> > Firstly, the usage of waitqueues is broken. The waitqueue_head should be
> > shared with code that pages in, so that vcpus can be *woken* at some point
> > after they start waiting. As it is, if a vcpu does sleep on its local
> > waitqueue_head, it will never wake. You might start with a single global
> > waitqueue_head and wake everyone on it every time a page (or maybe page
> > batch) is paged in. More sophisticated might be to hash page numbers into a
> > array of waitqueue_heads, to reduce false wakeups.
> 
> ...Or you might have a per-domain waitqueue_head, and do the wake_up() from
> code that adds paged-in entries to the guest physmap. That would seem a
> pretty sensible way to proceed, to me.

Thats what I'm doing right now.

It seems that the existing MEM_EVENT_FLAG_VCPU_PAUSED code can be reused
for this. I was messing with wait_event() until I realized that the vcpu
is stopped by p2m_mem_paging_populate() already and the wake_up() ran
before the vcpu got a chance to call schedule().

If a vcpu happens to be scheduled and the domain is destroyed, the
BUG_ON in destroy_waitqueue_vcpu() will trigger. What can happen if
there is still an entry in the list? The cleanup should handle this
situation to not crash Xen itself.

Olaf

  reply	other threads:[~2010-12-03  9:14 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10  8:58 how to handle paged hypercall args? Olaf Hering
2010-11-11 14:33 ` Olaf Hering
2010-11-11 20:08   ` Keir Fraser
2010-11-11 20:34     ` Olaf Hering
2010-11-11 21:00       ` Keir Fraser
2010-11-12  9:45     ` Jan Beulich
2010-11-12 10:22       ` Keir Fraser
2010-11-12 10:47         ` Jan Beulich
2010-11-12 14:32           ` Keir Fraser
2010-11-15 13:12             ` Olaf Hering
2010-11-17 16:52               ` Keir Fraser
2010-11-18 12:33                 ` Keir Fraser
2010-11-18 13:51                   ` Olaf Hering
2010-12-02 10:11                   ` Olaf Hering
2010-12-02 10:22                     ` Keir Fraser
2010-12-02 10:30                       ` Keir Fraser
2010-12-03  9:14                         ` Olaf Hering [this message]
2010-12-03 14:37                           ` Keir Fraser
2010-12-02 10:25                     ` Jan Beulich
2010-12-03  9:06                       ` Olaf Hering
2010-12-03 14:18                         ` Keir Fraser
2010-12-02 10:18                   ` Olaf Hering
2010-12-02 10:25                     ` Keir Fraser
2010-12-07  9:25                       ` Olaf Hering
2010-12-07 16:45                         ` Keir Fraser
2010-12-07 17:16                           ` Olaf Hering
2010-12-07 18:08                             ` Keir Fraser
2010-12-07 18:50                               ` Olaf Hering
2010-11-15  9:37       ` Tim Deegan
2010-11-15  9:53         ` Jan Beulich
2010-11-15 10:09           ` Keir Fraser
2010-11-15 10:20             ` Tim Deegan
2010-11-15 10:33               ` Keir Fraser
2010-11-15 10:49                 ` Tim Deegan
2010-11-15 11:55                   ` Keir Fraser
2010-11-15 12:04                     ` Tim Deegan
2010-11-15 12:17                       ` Keir Fraser
2010-12-03  9:03                         ` Olaf Hering
2010-12-03 14:13                           ` Keir Fraser

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=20101203091430.GC6055@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=JBeulich@novell.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xensource.com \
    /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.