[fedora-virt] ksmtuned, v2

Dan Kenigsberg danken at redhat.com
Wed Sep 16 12:40:08 UTC 2009


On Wed, Sep 16, 2009 at 11:02:37AM +0100, Mark McLoughlin wrote:
> Hi Dan,
> 
> On Tue, 2009-09-15 at 17:22 +0300, Dan Kenigsberg wrote:
> > changes since v1:
> > - broken into two services, one starting ksm up (ksmd), and the other
> >   tuning it (ksmtuned).
> > - ksmtune logic separated from service code for cleanliness and simpler
> >   availability to other distros
> > - ksm/max_kernel_pages default is absurdly low (allows for 8M of shared
> >   mem). ksmd now sets it to half of available RAM.
> > - a handful of typos corrected
> > 
> > Can these files be poured into qemu-system rpm? Or should I file for a
> > new package?
> > 
> > Comments and suggestion are still welcome.
> 
> My initial reaction was that I'd prefer these to be in a separate ksm
> RPM, but since ksmtuned is tied to qemu at the moment, I guess it makes
> sense to include it in qemu for now. We can split it out later, if needs
> be.
> 
> I've added the ksm init script to qemu-common in rawhide. I put it in
> qemu-common since it doesn't appear to be specific to qemu-kvm or
> qemu-system.
> 
> I was going to add ksmtuned, but when I tested it, it didn't daemonize
> and 'service ksmtuned start' just hung. So, that needs to be fixed
> first.
> 
> I've pushed a git repo with the scripts and a bunch of minor changes I
> made:
> 
>   http://gitorious.org/ksm-control-scripts/ksm-control-scripts
> 

oh, thanks!

Please consider the attached patch for daemonizing ksmtuned.

Dan.
-------------- next part --------------
>From dff4d7b21d8e6c34716eeaac10dadfa4ddee8f6c Mon Sep 17 00:00:00 2001
From: Dan Kenigsberg <danken at redhat.com>
Date: Wed, 16 Sep 2009 15:28:58 +0300
Subject: [PATCH] damonize ksmtuned and create pidfile

---
 TODO     |    3 ---
 ksmtuned |    6 +++++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/TODO b/TODO
index 0906417..32c3b39 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,2 @@
 
  - More docs in ksmtuned.conf
-
- - ksmtuned needs to daemonize, currently "service ksmtuned start"
-   just hangs
diff --git a/ksmtuned b/ksmtuned
index 5bdc4a3..f97fa6d 100644
--- a/ksmtuned
+++ b/ksmtuned
@@ -113,4 +113,8 @@ loop () {
     done
 }
 
-loop
+PIDFILE=${PIDFILE-/var/run/ksmtune.pid}
+if touch "$PIDFILE"; then
+  loop &
+  echo $! > "$PIDFILE"
+fi
-- 
1.6.2.5



More information about the Fedora-virt mailing list