Stefano Stabellini
2012-Sep-26 11:46 UTC
[PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI
Change caching mode from writethrough to writeback for upstream QEMU.
After a lengthy discussion, we came up with the conclusion that
WRITEBACK is OK for IDE.
See: http://marc.info/?l=xen-devel&m=133311527009773
Given that the same reasons apply to SCSI as well, change to writeback
for SCSI too.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 0c0084f..7662b3d 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -549,10 +549,10 @@ static char **
libxl__build_device_model_args_new(libxl__gc *gc,
if (disks[i].is_cdrom) {
if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
drive = libxl__sprintf
- (gc, "if=ide,index=%d,media=cdrom", disk);
+ (gc,
"if=ide,index=%d,media=cdrom,cache=writeback", disk);
else
drive = libxl__sprintf
- (gc,
"file=%s,if=ide,index=%d,media=cdrom,format=%s",
+ (gc,
"file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback",
disks[i].pdev_path, disk, format);
} else {
if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
@@ -575,11 +575,11 @@ static char **
libxl__build_device_model_args_new(libxl__gc *gc,
*/
if (strncmp(disks[i].vdev, "sd", 2) == 0)
drive = libxl__sprintf
- (gc,
"file=%s,if=scsi,bus=0,unit=%d,format=%s",
+ (gc,
"file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
disks[i].pdev_path, disk, format);
else if (disk < 4)
drive = libxl__sprintf
- (gc,
"file=%s,if=ide,index=%d,media=disk,format=%s",
+ (gc,
"file=%s,if=ide,index=%d,media=disk,format=%s,cache=writeback",
disks[i].pdev_path, disk, format);
else
continue; /* Do not emulate this disk */
Ian Jackson
2012-Sep-28 17:51 UTC
Re: [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI
Stefano Stabellini writes ("[Xen-devel] [PATCH v2] libxl/qemu-xen: use
cache=writeback for IDE and SCSI"):> Change caching mode from writethrough to writeback for upstream QEMU.
>
> After a lengthy discussion, we came up with the conclusion that
> WRITEBACK is OK for IDE.
> See: http://marc.info/?l=xen-devel&m=133311527009773
>
> Given that the same reasons apply to SCSI as well, change to writeback
> for SCSI too.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell
2012-Oct-05 13:44 UTC
Re: [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI
On Fri, 2012-09-28 at 18:51 +0100, Ian Jackson wrote:> Stefano Stabellini writes ("[Xen-devel] [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI"): > > Change caching mode from writethrough to writeback for upstream QEMU. > > > > After a lengthy discussion, we came up with the conclusion that > > WRITEBACK is OK for IDE. > > See: http://marc.info/?l=xen-devel&m=133311527009773 > > > > Given that the same reasons apply to SCSI as well, change to writeback > > for SCSI too. > > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>Acked + applied. Are the performance benefits of this patch worthy of a 4.2 backport, even though qemu-xen is not the default? Ian.
Stefano Stabellini
2012-Oct-09 12:58 UTC
Re: [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI
On Fri, 5 Oct 2012, Ian Campbell wrote:> On Fri, 2012-09-28 at 18:51 +0100, Ian Jackson wrote: > > Stefano Stabellini writes ("[Xen-devel] [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI"): > > > Change caching mode from writethrough to writeback for upstream QEMU. > > > > > > After a lengthy discussion, we came up with the conclusion that > > > WRITEBACK is OK for IDE. > > > See: http://marc.info/?l=xen-devel&m=133311527009773 > > > > > > Given that the same reasons apply to SCSI as well, change to writeback > > > for SCSI too. > > > > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > > Acked + applied. > > Are the performance benefits of this patch worthy of a 4.2 backport, > even though qemu-xen is not the default?I think they are: QEMU should be more than twice as fast with that patch.