From Fedora Project Wiki

< FWN‎ | Beats

Line 94: Line 94:
[http://www.redhat.com/mailman/listinfo/libvir-list libvir-list].
[http://www.redhat.com/mailman/listinfo/libvir-list libvir-list].


==== Rewrite the QEMU monitor handling ====
==== Node device enumeration with udev ====
[[DaveAllan|Dave Allan]]
posted<ref>http://www.redhat.com/archives/libvir-list/2009-October/msg00731.html</ref>
"a fully functional version of the node device udev<ref>http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html</ref> based backend, incorporating all the feedback from earlier revisions." "...I have also included a patch removing the DevKit backend."
 
Also see FWN#146 "Host Device Enumeration API"<ref>http://fedoraproject.org/wiki/FWN/Issue146#Host_Device_Enumeration_API</ref> for some coverage of the host device enumeration API.
 
<references />
 
==== Rewrite of QEMU monitor handling ====
[[DanielBerrange|Daniel Berrange]]
[[DanielBerrange|Daniel Berrange]]
posted<ref>http://www.redhat.com/archives/libvir-list/2009-October/msg00644.html</ref> a
posted<ref>http://www.redhat.com/archives/libvir-list/2009-October/msg00644.html</ref> a
Line 108: Line 117:
<references />
<references />


==== Node device enumeration with udev ====
==== Libvirt QEMU driver thread safety rules ====
[[DaveAllan|Dave Allan]]
In a characteristically long and detailed post [[DanielBerrange|Daniel Berrange]]
posted<ref>http://www.redhat.com/archives/libvir-list/2009-October/msg00731.html</ref>
laid<ref>http://www.redhat.com/archives/libvir-list/2009-October/msg00815.html</ref>
"a fully functional version of the node device udev<ref>http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html</ref> based backend, incorporating all the feedback from earlier revisions." "...I have also included a patch removing the DevKit backend."
donw the law on thread safety rules for the Qemu driver<ref>http://www.libvirt.org/drvqemu.html</ref>.
 
"This document describes how thread safety is ensured throughout
the QEMU driver. The criteria for this model are:
 
* Objects must never be exclusively locked for any pro-longed time
* Code which sleeps must be able to time out after suitable period
* Must be safe against dispatch asynchronous events from monitor"


Also see FWN#146 <ref>http://fedoraproject.org/wiki/FWN/Issue146#Host_Device_Enumeration_API</ref> for some coverage of the host device enumeration API.
Also see FWN#155 "Thread Safety for libvirtd Daemon and Drivers"<ref>http://fedoraproject.org/wiki/FWN/Issue155#Thread_Safety_for_libvirtd_Daemon_and_Drivers</ref>


<references />
<references />

Revision as of 05:10, 2 November 2009


Virtualization

In this section, we cover discussion of Fedora virtualization technologies on the @fedora-virt and @libvirt-list lists.

Contributing Writer: Dale Bewley

Fedora Virtualization List

This section contains the discussion happening on the fedora-virt list.

Fedora Virt Status

Mark McLoughlin posted[1] another excellent round up of virt related bugs and developments. Mark reports "Thankfully, the virt blocker list is now clear, but if you're looking to help with making Fedora 12 even better, there's no better place to start than the F12 target tracker bug[2]:

There's over 100 bugs there that need your help!"

Help testing the Windows Registry feature of libguestfs

Richard Jones asked[1] for some help testing a new feature of Package-x-generic-16.pnglibguestfs

"If you have any Windows guests, then you can help Fedora to support Windows guests better by spending a few minutes testing the Windows Registry feature we just added to libguestfs 1.0.75."

To help, all you need is:

  • A Windows NT/200x/XP/Vista/7/... guest
  • Fedora 12 or Fedora Rawhide host
  • libguestfs-tools >= 1.0.75 (from updates or koji[2])
  • a few minutes of your time

KSM Tuning in Fedora 12

Mark McLoughlin described[1] the default state of KSM[2] on Fedora systems. "For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'" "For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run."

At release of Fedora 12 the kernel will default to a maximum of 2000 merged memory pages. A future F12 kernel update to 2.6.32 will likely disable KSM by default. To take advantage of KSM in Fedora 12, the ksm service must be enabled:

sudo chkconfig ksm on

Mark McLoughlin also noted[3] The maximum number of pages which may be merged defaults to half of the system memory, and may also be manually defined in /etc/sysconfig/ksm. "Here's the logic we have in the init script[4]:"

  # unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory.
  default_max_kernel_pages () {
      local total pagesize
      total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo`
      pagesize=`getconf PAGESIZE`
      echo $[total * 1024 / pagesize / 2]
  }

Justin Forbes points out[5] "The limit to half of total memory is because ksm pages are unswappable at this time. To be fixed in a future kernel."

A second service, ksmtuned, may also be enabled. Ksmtuned regulates how aggressively the system will attempt to merge pages. Parameters such as how many pages to scan before sleeping and how long to sleep may be configured in /etc/ksmtuned.conf.

Memory pages must be flagged as mergable before KSM will scan them looking for duplicates. At present only Qemu pages will be marked as such. As described in the kernel docs[6], the effect of KSM system memory may be examined in /sys/kernel/mm/ksm. "A high ratio of pages_sharing to pages_shared indicates good sharing, but a high ratio of pages_unshared to pages_sharing indicates wasted effort."

Libvirt List

This section contains the discussion happening on the libvir-list.

Node device enumeration with udev

Dave Allan posted[1] "a fully functional version of the node device udev[2] based backend, incorporating all the feedback from earlier revisions." "...I have also included a patch removing the DevKit backend."

Also see FWN#146 "Host Device Enumeration API"[3] for some coverage of the host device enumeration API.

Rewrite of QEMU monitor handling

Daniel Berrange posted[1] a "patch series [which] rewrites the QEMU monitor handling almost completely.

The key theme here is to move from a totally synchronous way of interacting with the monitor, to a totally asynchronous way. This allows " Package-x-generic-16.pnglibvirt " to handle receipt & dispatch of asychronous events from QEMU. For example a notification of a disk-full error, or VM state change. In the process of doing this re-factoring I have also dropped in basic support/infrastructure for the JSON based monitor."

Libvirt QEMU driver thread safety rules

In a characteristically long and detailed post Daniel Berrange laid[1] donw the law on thread safety rules for the Qemu driver[2].

"This document describes how thread safety is ensured throughout the QEMU driver. The criteria for this model are:

  • Objects must never be exclusively locked for any pro-longed time
  • Code which sleeps must be able to time out after suitable period
  • Must be safe against dispatch asynchronous events from monitor"

Also see FWN#155 "Thread Safety for libvirtd Daemon and Drivers"[3]