* [PATCH] qemu-dm: add command to flush buffer cache
@ 2012-01-12 18:22 Olaf Hering
2012-01-12 18:30 ` Olaf Hering
2012-01-13 10:31 ` Stefano Stabellini
0 siblings, 2 replies; 5+ messages in thread
From: Olaf Hering @ 2012-01-12 18:22 UTC (permalink / raw)
To: xen-devel
Add support for a xenstore dm command to flush qemu's buffer cache.
qemu will just keep mapping pages and not release them, which causes problems
for the memory pager (since the page is mapped, it won't get paged out). When
the pager has trouble finding a page to page out, it asks qemu to flush its
buffer, which releases all the page mappings. This makes it possible to find
pages to swap out agian.
Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
ioemu-remote/xenstore.c | 3 +++
1 file changed, 3 insertions(+)
--- ioemu-remote/xenstore.c
+++ ioemu-remote/xenstore.c
@@ -927,6 +927,9 @@ static void xenstore_process_dm_command_
do_pci_add(par);
free(par);
#endif
+ } else if (!strncmp(command, "flush-cache", len)) {
+ fprintf(logfile, "dm-command: flush caches\n");
+ qemu_invalidate_map_cache();
} else {
fprintf(logfile, "dm-command: unknown command\"%*s\"\n", len, command);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] qemu-dm: add command to flush buffer cache
2012-01-12 18:22 [PATCH] qemu-dm: add command to flush buffer cache Olaf Hering
@ 2012-01-12 18:30 ` Olaf Hering
2012-01-13 10:35 ` Stefano Stabellini
2012-01-13 10:31 ` Stefano Stabellini
1 sibling, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2012-01-12 18:30 UTC (permalink / raw)
To: xen-devel
On Thu, Jan 12, Olaf Hering wrote:
> Add support for a xenstore dm command to flush qemu's buffer cache.
Something like this is most likely also needed in mainline qemu.
My search in the qemu.org git web UI did not show any of the commands in
ioemu-remote, so its not clear how to forward port this change.
Olaf
> --- ioemu-remote/xenstore.c
> +++ ioemu-remote/xenstore.c
> @@ -927,6 +927,9 @@ static void xenstore_process_dm_command_
> do_pci_add(par);
> free(par);
> #endif
> + } else if (!strncmp(command, "flush-cache", len)) {
> + fprintf(logfile, "dm-command: flush caches\n");
> + qemu_invalidate_map_cache();
> } else {
> fprintf(logfile, "dm-command: unknown command\"%*s\"\n", len, command);
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] qemu-dm: add command to flush buffer cache
2012-01-12 18:22 [PATCH] qemu-dm: add command to flush buffer cache Olaf Hering
2012-01-12 18:30 ` Olaf Hering
@ 2012-01-13 10:31 ` Stefano Stabellini
2012-01-13 12:13 ` Olaf Hering
1 sibling, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2012-01-13 10:31 UTC (permalink / raw)
To: Olaf Hering; +Cc: xen-devel@lists.xensource.com
On Thu, 12 Jan 2012, Olaf Hering wrote:
> Add support for a xenstore dm command to flush qemu's buffer cache.
>
> qemu will just keep mapping pages and not release them, which causes problems
> for the memory pager (since the page is mapped, it won't get paged out). When
> the pager has trouble finding a page to page out, it asks qemu to flush its
> buffer, which releases all the page mappings. This makes it possible to find
> pages to swap out agian.
>
> Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>
> ---
> ioemu-remote/xenstore.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> --- ioemu-remote/xenstore.c
> +++ ioemu-remote/xenstore.c
> @@ -927,6 +927,9 @@ static void xenstore_process_dm_command_
> do_pci_add(par);
> free(par);
> #endif
> + } else if (!strncmp(command, "flush-cache", len)) {
> + fprintf(logfile, "dm-command: flush caches\n");
> + qemu_invalidate_map_cache();
> } else {
> fprintf(logfile, "dm-command: unknown command\"%*s\"\n", len, command);
> }
I guess it is not possible to send the usual ioreq with type ==
IOREQ_TYPE_INVALIDATE because the pager is separate from the hypervisor,
correct?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] qemu-dm: add command to flush buffer cache
2012-01-12 18:30 ` Olaf Hering
@ 2012-01-13 10:35 ` Stefano Stabellini
0 siblings, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2012-01-13 10:35 UTC (permalink / raw)
To: Olaf Hering; +Cc: xen-devel@lists.xensource.com
On Thu, 12 Jan 2012, Olaf Hering wrote:
> On Thu, Jan 12, Olaf Hering wrote:
>
> > Add support for a xenstore dm command to flush qemu's buffer cache.
>
> Something like this is most likely also needed in mainline qemu.
> My search in the qemu.org git web UI did not show any of the commands in
> ioemu-remote, so its not clear how to forward port this change.
Yes, upstream qemu is going to need this too.
So far we haven't needed any xenstore command in upstream qemu, because
we have been using qemu's own rpc mechanism, called qmp.
There is qmp support in libxl already, so it shouldn't be difficult to
use it, instead of sending the command through xenstore.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] qemu-dm: add command to flush buffer cache
2012-01-13 10:31 ` Stefano Stabellini
@ 2012-01-13 12:13 ` Olaf Hering
0 siblings, 0 replies; 5+ messages in thread
From: Olaf Hering @ 2012-01-13 12:13 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: xen-devel@lists.xensource.com
On Fri, Jan 13, Stefano Stabellini wrote:
> I guess it is not possible to send the usual ioreq with type ==
> IOREQ_TYPE_INVALIDATE because the pager is separate from the hypervisor,
> correct?
Maybe send_invalidate_req() could be triggerd by the pager in some way?
Andres sent a patch to move from domctl to memop. Maybe the paging part
of it could be extended to issue another command which just calls
send_invalidate_req(). If thats possible, then I assume the upstream
qemu does not need changing as well.
Olaf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-13 12:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-12 18:22 [PATCH] qemu-dm: add command to flush buffer cache Olaf Hering
2012-01-12 18:30 ` Olaf Hering
2012-01-13 10:35 ` Stefano Stabellini
2012-01-13 10:31 ` Stefano Stabellini
2012-01-13 12:13 ` Olaf Hering
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.