Alon Bar-Lev has uploaded a new change for review.

Change subject: storage: set block schedule elevator using udev
......................................................................

storage: set block schedule elevator using udev

CURRENT IMPLEMENTATION

block schedule elevator is set by bootstrap using modification to kernel
command-lines.

PROBLEMS IN CURRENT IMPLEMENTATION

1. assumption of grub bootloader.

2. assumption of active kernel.

3. assumption of user not override anything.

4. problem to port.

NEW IMPLEMENTATION

Use udev in order to set the block schedule elevator.

User may override behavior using udev rule, no bootloader dependency or
conflict.

The setting is applied also if vdsm is installed manually.

Change-Id: I0a8de1c861bf4570509599b6f47235ed38cc424d
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M vds_bootstrap/vds_bootstrap.py
M vdsm.spec.in
A vdsm/storage/12-vdsm-elevator.rules
M vdsm/storage/Makefile.am
A vdsm/storage/vdsm-elevator.sh
5 files changed, 31 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/8700/1

diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py
index 867d6f4..9353daf 100755
--- a/vds_bootstrap/vds_bootstrap.py
+++ b/vds_bootstrap/vds_bootstrap.py
@@ -435,7 +435,7 @@
         self.message = ''
         self.rc = True
 
-        args = ['elevator=deadline']
+        args = []
         if rhel6based and not _constantTSC():
             args += ['processor.max_cstate=1']
 
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4814172..18a3661 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -382,9 +382,13 @@
 install -Dm 0755 vdsm/respawn \
                  %{buildroot}%{_datadir}/%{vdsm_name}/respawn
 
-# Install the lvm rules
+# Install the udev rules
 install -Dm 0644 vdsm/storage/12-vdsm-lvm.rules \
                  %{buildroot}/lib/udev/rules.d/12-vdsm-lvm.rules
+install -Dm 0644 vdsm/storage/12-vdsm-elevator.rules \
+                 %{buildroot}/lib/udev/rules.d/12-vdsm-elevator.rules
+install -Dm 0755 vdsm/storage/vdsm-elevator.sh \
+                 %{buildroot}/lib/udev/vdsm-elevator.sh
 
 install -Dm 0644 vdsm/limits.conf \
                  %{buildroot}/etc/security/limits.d/99-vdsm.conf
@@ -721,6 +725,8 @@
 %{_datadir}/%{vdsm_name}/set-conf-item
 %{python_sitelib}/sos/plugins/vdsm.py*
 /lib/udev/rules.d/12-vdsm-lvm.rules
+/lib/udev/rules.d/12-vdsm-elevator.rules
+/lib/udev/vdsm-elevator.sh
 /etc/security/limits.d/99-vdsm.conf
 %{_mandir}/man8/vdsmd.8*
 %if 0%{?rhel}
diff --git a/vdsm/storage/12-vdsm-elevator.rules 
b/vdsm/storage/12-vdsm-elevator.rules
new file mode 100644
index 0000000..38a7607
--- /dev/null
+++ b/vdsm/storage/12-vdsm-elevator.rules
@@ -0,0 +1,12 @@
+#
+# Copyright 2012 Red Hat, Inc. and/or its affiliates.
+#
+# Licensed to you under the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.  See the files README and
+# LICENSE_GPL_v2 which accompany this distribution.
+#
+
+# Udev rules for elevator setting.
+
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", 
RUN+="vdsm-elevator.sh deadline"
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index cff09be..5900802 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -65,7 +65,9 @@
        volume.py
 
 EXTRA_DIST = \
-       12-vdsm-lvm.rules
+       12-vdsm-lvm.rules \
+       12-vdsm-elevator.rules \
+       vdsm-elevator.sh
 
 check-local:
        PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(srcdir)/storage_exception.py
diff --git a/vdsm/storage/vdsm-elevator.sh b/vdsm/storage/vdsm-elevator.sh
new file mode 100755
index 0000000..6f2ff85
--- /dev/null
+++ b/vdsm/storage/vdsm-elevator.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+elevator="$1"
+scheduler="/sys/${DEVPATH}/queue/scheduler"
+
+if [ -w "${scheduler}" ]; then
+    echo "${elevator}" >  "${scheduler}"
+fi


--
To view, visit http://gerrit.ovirt.org/8700
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a8de1c861bf4570509599b6f47235ed38cc424d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to