Skip to contentSkip to conversation

put xenstored tdb to tmpfs

PATCH New Zhigang Wang 1 participant 1 message Jan 21, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 put xenstored tdb to tmpfs

Hi,

This patch put the xenstored tdb into tmpfs. It will improve the performance when there are intensive xenstore read/writes.

thanks,

zhigang

tools/hotplug/Linux/init.d/xend.new renamed from tools/hotplug/Linux/init.d/xend +7 -0
@@ -57,6 +57,13 @@
 	test -z "$XENCONSOLED_TRACE" || export XENCONSOLED_TRACE
 	[[ "$XENSTORED_TRACE" == @(yes|on|1) ]] && export XENSTORED_TRACE
 	[[ "$XENBACKENDD_DEBUG" == @(yes|on|1) ]] && export XENBACKENDD_DEBUG
+	pid=`cat /var/run/xenstore.pid 2>/dev/null`
+	if [ -z "$pid" -o ! -d "/proc/$pid" ]; then
+		dir=${XENSTORED_ROOTDIR:-/var/lib/xenstored}
+		if ! grep -q "$dir" /proc/mounts 2>/dev/null; then
+			mount -t tmpfs none "$dir"
+		fi
+	fi
 	xend start
 	await_daemons_up
 	;;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel