Skip to contentSkip to conversation

libxl/qemu-xen: use cache=writeback for IDE and SCSI

PATCH In review Stefano Stabellini 3 participants 4 messages Sep 26, 2012 – Oct 9, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---

tools/libxl/libxl_dm.c +4 -4
index 0c0084f..7662b3d 100644
@@ -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 */
Acked-by on v2 1/1
#1 lore raw

Stefano Stabellini writes ("[Xen-devel] [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI"):

Quoted 8 lines

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.

#2 lore raw
Quoted 11 lines · Ian Jackson

Stefano Stabellini writes ("[Xen-devel] [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI"):

Quoted 8 lines

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 + applied.

Are the performance benefits of this patch worthy of a 4.2 backport, even though qemu-xen is not the default?

Ian.

#3 lore raw
Quoted 11 lines · Ian Campbell
Quoted 10 lines · Ian Jackson

Stefano Stabellini writes ("[Xen-devel] [PATCH v2] libxl/qemu-xen: use cache=writeback for IDE and SCSI"):

Quoted 8 lines

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.

Quoted 6 lines
Quoted 1 line

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.