Dudi Maroshi has uploaded a new change for review.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
vdsm: implement NUMA aware KSM policy
Add monitored parameter ksm_merge_across_nodes to: 1. momIf.py class - append to status report 2. superVdsmServer file - enable writing to the kernel flag
Update policy logic (a simple state machine) to 03-ksm.policy merge_across_nodes flag allowed to be changed only after unmerging all pages. This unmerge completion is tested on pages_shared flag == 0.
Update policy parameter ksmMergeAcrossNodes to 00-defines.policy
Change-Id: Iec607f9ef3284c1448bfc2831d125fc4d81b28d2 Related-to: https://bugzilla.redhat.com/show_bug.cgi?id=840114 Signed-off-by: Dudi Maroshi dudi@redhat.com --- M vdsm/mom.d/00-defines.policy M vdsm/mom.d/03-ksm.policy M vdsm/momIF.py M vdsm/supervdsmServer 4 files changed, 73 insertions(+), 53 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/40129/1
diff --git a/vdsm/mom.d/00-defines.policy b/vdsm/mom.d/00-defines.policy index faa6d90..718cf04 100644 --- a/vdsm/mom.d/00-defines.policy +++ b/vdsm/mom.d/00-defines.policy @@ -4,6 +4,7 @@ (defvar True 1)
# Define variables for configurable options here +(defvar ksmMergeAcrossNodes 1) (defvar ksmEnabled 1) (defvar balloonEnabled 0) (defvar cpuTuneEnabled 1) diff --git a/vdsm/mom.d/03-ksm.policy b/vdsm/mom.d/03-ksm.policy index 5a3b1bd..9706e5d 100644 --- a/vdsm/mom.d/03-ksm.policy +++ b/vdsm/mom.d/03-ksm.policy @@ -22,6 +22,10 @@ # KSM will be started to try and free up some memory. (defvar ksm_free_percent 0.20)
+# KSM service can unmerged shared pages (ksm_run = 2) +# When this happens the KSM is affectivley non responsive +(defvar ksm_umerging_pages 0) + ### Helper functions (def change_npages (delta) { @@ -31,6 +35,43 @@ (Host.Control "ksm_pages_to_scan" newval) })
+(def enable_ksmMergeAcrossNodes() +{ + (debug "entry: enable_ksmMergeAcrossNodes") + (debug Host.ksm_run "=ksm_run") + (debug Host.ksm_merge_across_nodes "=ksm_merge_across_nodes") + (debug ksmMergeAcrossNodes "=ksmMergeAcrossNodes") + (if (!= Host.ksm_merge_across_nodes ksmMergeAcrossNodes){ + (debug "ksm_merge_across_nodes policy change") + (if (== Host.ksm_run 0){ + (debug "ksm_run == 0 : Update ksm_merge_across_nodes") + (Host.Control "ksm_merge_across_nodes" ksmMergeAcrossNodes) + (debug "ksm_merge_across_nodes configured")} + 6) + (if (== Host.ksm_run 1){ + (debug "ksm_run == 1 : unmerge KSM pages") + (setq ksm_umerging_pages 1) + (Host.Control "ksm_run" 2) + (debug "ksm_run unmerge")} + 7) + (if (== Host.ksm_run 2){ + (debug "ksm_run == 2 : if all pages unmerged, update ksm_merge_across_nodes. Rest KSM") + (Host.Control "ksm_run" 2) + (if (== Host.ksm_pages_shared 0) { + (debug "ksm_pages_shared == 0") + (Host.Control "ksm_merge_across_nodes" ksmMergeAcrossNodes) + (Host.Control "ksm_run" 0) + (setq ksm_umerging_pages 0) + } + { #else + (debug "ksm_pages_shared != 0 : continue with unmerging") + (setq ksm_umerging_pages 1) + }) + (debug "ksm_merge_across_nodes configured")} + 9) + } 10) + (debug "exit: enable_ksmMergeAcrossNodes") +}) ### Main Script # Methodology: Since running KSM does incur some overhead, try to run it only # when necessary. If the amount of committed KSM shareable memory is high or if @@ -40,16 +81,19 @@
(defvar ksm_pressure_threshold (* Host.mem_available ksm_free_percent)) (defvar ksm_committed Host.ksm_shareable) - -(if (or (and (< (+ ksm_pressure_threshold ksm_committed) Host.mem_available) - (> (Host.StatAvg "mem_free") ksm_pressure_threshold)) (not ksmEnabled)) - (Host.Control "ksm_run" 0) - { # else - (Host.Control "ksm_run" 1) - (Host.Control "ksm_sleep_millisecs" - (/ (* ksm_sleep_ms_baseline 16777216) Host.mem_available)) - (if (< (Host.StatAvg "mem_free") ksm_pressure_threshold) - (change_npages ksm_pages_boost) - (change_npages ksm_pages_decay)) - } -) +(enable_ksmMergeAcrossNodes) +(if (== ksm_umerging_pages 0) + (if (or (and (< (+ ksm_pressure_threshold ksm_committed) Host.mem_available) + (> (Host.StatAvg "mem_free") ksm_pressure_threshold)) + (not ksmEnabled)) + (Host.Control "ksm_run" 0) + { # else + (Host.Control "ksm_run" 1) + (Host.Control "ksm_sleep_millisecs" + (/ (* ksm_sleep_ms_baseline 16777216) Host.mem_available)) + (if (< (Host.StatAvg "mem_free") ksm_pressure_threshold) + (change_npages ksm_pages_boost) + (change_npages ksm_pages_decay)) + } + ) +0) \ No newline at end of file diff --git a/vdsm/momIF.py b/vdsm/momIF.py index d70d826..e6481c2 100644 --- a/vdsm/momIF.py +++ b/vdsm/momIF.py @@ -56,6 +56,7 @@ stats = self._mom.getStatistics()['host'] ret = {} ret['ksmState'] = bool(stats['ksm_run']) + ret['ksmMergeAcrossNodes'] = bool(stats['ksm_merge_across_nodes']) ret['ksmPages'] = stats['ksm_pages_to_scan'] ret['memShared'] = stats['ksm_pages_sharing'] * PAGE_SIZE_BYTES ret['memShared'] /= Mbytes diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer index 3cdbf71..43ed1e6 100755 --- a/vdsm/supervdsmServer +++ b/vdsm/supervdsmServer @@ -308,25 +308,14 @@ of /dev/vfio/$iommu_group to qemu:qemu. This method should be called when detaching a device from the host. """ - rule_file = _UDEV_RULE_FILE_NAME_VFIO % iommu_group - - if not os.path.isfile(rule_file): - # If the file exists, different device from the same group has - # already been detached and we therefore can skip overwriting the - # file. Also, this file should only be created/removed via the - # means of supervdsm. - - rule = ('KERNEL=="{}", SUBSYSTEM=="vfio" RUN+="{} {}:{} ' - '/dev/vfio/{}"').format(iommu_group, EXT_CHOWN, - QEMU_PROCESS_USER, - QEMU_PROCESS_GROUP, - iommu_group) - - with open(rule_file, "w") as rf: - self.log.debug("Creating rule %s: %r", rule_file, rule) - rf.write(rule) - - self.udevTrigger(iommu_group) + ruleFile = _UDEV_RULE_FILE_NAME_VFIO % iommu_group + rule = ('KERNEL=="{}", SUBSYSTEM=="vfio" RUN+="{} {}:{} ' + '/dev/vfio/{}"').format(iommu_group, EXT_CHOWN, + QEMU_PROCESS_USER, QEMU_PROCESS_GROUP, + iommu_group) + with open(ruleFile, "w") as rf: + self.log.debug("Creating rule %s: %r", ruleFile, rule) + rf.write(rule)
@logDecorator def rmAppropriateIommuGroup(self, iommu_group): @@ -334,26 +323,10 @@ Remove udev rule in /etc/udev/rules.d/ created by vfioAppropriateDevice. """ - rule_file = os.path.join(_UDEV_RULE_FILE_DIR, _UDEV_RULE_FILE_PREFIX + - "iommu_group_" + iommu_group + - _UDEV_RULE_FILE_EXT) - error = False - - try: - os.remove(rule_file) - except OSError as e: - if e.errno == errno.ENOENT: - # OSError with ENOENT errno here means that the rule file does - # not exist - this is expected when multiple devices in one - # iommu group were passed through. - error = True - else: - raise - else: - self.log.debug("Removing rule %s", rule_file) - - if not error: - self.udevTrigger(iommu_group) + rule = os.path.join(_UDEV_RULE_FILE_DIR, _UDEV_RULE_FILE_PREFIX + + "iommu_group_" + iommu_group + _UDEV_RULE_FILE_EXT) + self.log.debug("Removing rule %s", rule) + os.remove(rule)
@logDecorator def ksmTune(self, tuningParams): @@ -362,7 +335,8 @@ when it's lauched by vdsm. So it needs supervdsm's assistance to tune KSM's parameters. ''' - KSM_PARAMS = {'run': 3, 'sleep_millisecs': 0x100000000, + KSM_PARAMS = {'run': 3, 'merge_across_nodes': 3, + 'sleep_millisecs': 0x100000000, 'pages_to_scan': 0x100000000} for (k, v) in tuningParams.iteritems(): if k not in KSM_PARAMS.iterkeys():
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 1:
Build Started (1/3) -> http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/17992/
Dudi Maroshi has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 1: Verified+1
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 1:
Build Started (2/3)
0 -> http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/1221/
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 2:
* update_tracker: OK * Check Bug-Url::OK * Check Public Bug::#840114::ERROR, private bug * Check Public Bug::WARN, no public bug url found * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 2:
Build Started (1/3) -> http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/17993/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 1:
Build Started (3/3) -> http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/18164/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 1:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/18164/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/17992/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/1221/ : 0
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 2:
Build Started (2/3)
0 -> http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/1222/
Max Kovgan has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 2: Code-Review-1
please catch up with master so the tests are not breaking....
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 3:
* update_tracker: OK * Check Bug-Url::OK * Check Public Bug::#840114::ERROR, private bug * Check Public Bug::WARN, no public bug url found * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 3:
Build Started (1/2) -> http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/18012/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 3:
Build Started (2/2)
0 -> http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/1241/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 3:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/18012/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/1241/ : 0
Roy Golan has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 3:
@Max is the -1 still relevant?
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 4:
* update_tracker: OK * Check Bug-Url::OK * Check Public Bug::#840114::ERROR, private bug * Check Public Bug::WARN, no public bug url found * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Max Kovgan has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 4: Code-Review+1
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 6:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dudi Maroshi has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 6: Verified+1
(2 comments)
https://gerrit.ovirt.org/#/c/40129/6/vdsm/supervdsmServer File vdsm/supervdsmServer:
Line 309: iommu_group) Line 310: with open(ruleFile, "w") as rf: Line 311: self.log.debug("Creating rule %s: %r", ruleFile, rule) Line 312: rf.write(rule) Line 313: Change resulting from rebase. Not my commit. Line 314: @logDecorator Line 315: def rmAppropriateIommuGroup(self, iommu_group): Line 316: """ Line 317: Remove udev rule in /etc/udev/rules.d/ created by
Line 319: """ Line 320: rule = os.path.join(_UDEV_RULE_FILE_DIR, _UDEV_RULE_FILE_PREFIX + Line 321: "iommu_group_" + iommu_group + _UDEV_RULE_FILE_EXT) Line 322: self.log.debug("Removing rule %s", rule) Line 323: os.remove(rule) Change resulting from rebase. Not my commit. Line 324: Line 325: @logDecorator Line 326: def ksmTune(self, tuningParams): Line 327: '''
Roy Golan has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 6:
(1 comment)
https://gerrit.ovirt.org/#/c/40129/6/vdsm/supervdsmServer File vdsm/supervdsmServer:
Line 319: """ Line 320: rule = os.path.join(_UDEV_RULE_FILE_DIR, _UDEV_RULE_FILE_PREFIX + Line 321: "iommu_group_" + iommu_group + _UDEV_RULE_FILE_EXT) Line 322: self.log.debug("Removing rule %s", rule) Line 323: os.remove(rule)
Change resulting from rebase. Not my commit.
but it looks like you added it(same as above). I guess its not related to your patch? Line 324: Line 325: @logDecorator Line 326: def ksmTune(self, tuningParams): Line 327: '''
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 7:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dudi Maroshi has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 7: Verified+1
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 8:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 9:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Martin Sivák has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 9: Code-Review-1
(7 comments)
https://gerrit.ovirt.org/#/c/40129/9/vdsm/mom.d/03-ksm.policy File vdsm/mom.d/03-ksm.policy:
Line 27: ksm_umerging_pages There is probably a typo here. But I believe you do not need the variable at all.
Line 38: enable_ksmMergeAcrossNodes please use words separated by _ in names.. and this should probably be called process_ksm_merge_across_nodes_change or so...
Line 40: entry Please reduce the number of logging lines. (You can merge them to a single debug command if that helps you)
Line 46: 0 Shouldn't we unmerge when the across node settings changes to 0 even though the last cycle did no KSM operation?
I think (but I might be wrong) that a check for the number of shared pages and possibly ksmMergeAcrossNodes value is needed here.
Line 46: Please add comments explaining the intended behaviour (in detail!) so we do not have to analyse the code when a change is needed in the future.
Line 73: }) Please use the function as a function.. return the expected ksm_run mode here and process it in the main section... (you can also drop ksm_umerging_pages completely and set the ksm_merge_across_nodes value in the main section.
Line 84: ksm_umerging_pages Why didn't you add this as another condition to the nested if and used the return value from the new function in the true branch like this:
(setq ksm_run_mode (process_ksm_merge_across_nodes_change))
(if (== Host.ksm_pages_shared 0) (Host.Control "ksm_merge_across_nodes" ksmMergeAcrossNodes) 0 )
(if (not enabled or no pressure or ksm_run_mode != 0) (Host.Control "ksm_run" ksm_run_mode) { #else do normal ksm } )
This way you would be able to drop all the calls to Host.Control from the enable_ksmMergeAcrossNodes. The method would only detect if unmerge is requested (so the name would change to detect_ksm_numa_mode or something..) set the single variable and all would be applied at a single place.
Dudi Maroshi has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 9:
(7 comments)
https://gerrit.ovirt.org/#/c/40129/9/vdsm/mom.d/03-ksm.policy File vdsm/mom.d/03-ksm.policy:
Line 23: (defvar ksm_free_percent 0.20) Line 24: Line 25: # KSM service can unmerged shared pages (ksm_run = 2) Line 26: # When this happens the KSM is affectivley non responsive Line 27: (defvar ksm_umerging_pages 0)
There is probably a typo here. But I believe you do not need the variable a
Done.
A typo for sure.
Yet we do need a global/external variable that persist across function invocations. Line 28: Line 29: ### Helper functions Line 30: (def change_npages (delta) Line 31: {
Line 34: (if (< newval ksm_npages_min) (set newval ksm_npages_min) 0) Line 35: (Host.Control "ksm_pages_to_scan" newval) Line 36: }) Line 37: Line 38: (def enable_ksmMergeAcrossNodes()
please use words separated by _ in names.. and this should probably be call
Done
Will rename the function to better reflect its responsibility. Line 39: { Line 40: (debug "entry: enable_ksmMergeAcrossNodes") Line 41: (debug Host.ksm_run "=ksm_run") Line 42: (debug Host.ksm_merge_across_nodes "=ksm_merge_across_nodes")
Line 36: }) Line 37: Line 38: (def enable_ksmMergeAcrossNodes() Line 39: { Line 40: (debug "entry: enable_ksmMergeAcrossNodes")
Please reduce the number of logging lines. (You can merge them to a single
The debug lines are my method of debugging the state machine.
The state machine status is progressing through invocations. Therefore we need a progress feedback. Also we need feedback about the logic path the program takes. Need advise as to override debug function with finer control switch (turn on/off per flag).
The debug lines are also used as documentation.
Need advise to improve debugging technique. Line 41: (debug Host.ksm_run "=ksm_run") Line 42: (debug Host.ksm_merge_across_nodes "=ksm_merge_across_nodes") Line 43: (debug ksmMergeAcrossNodes "=ksmMergeAcrossNodes") Line 44: (if (!= Host.ksm_merge_across_nodes ksmMergeAcrossNodes){
Line 42: (debug Host.ksm_merge_across_nodes "=ksm_merge_across_nodes") Line 43: (debug ksmMergeAcrossNodes "=ksmMergeAcrossNodes") Line 44: (if (!= Host.ksm_merge_across_nodes ksmMergeAcrossNodes){ Line 45: (debug "ksm_merge_across_nodes policy change") Line 46: (if (== Host.ksm_run 0){
Please add comments explaining the intended behaviour (in detail!) so we do
Done Line 47: (debug "ksm_run == 0 : Update ksm_merge_across_nodes") Line 48: (Host.Control "ksm_merge_across_nodes" ksmMergeAcrossNodes) Line 49: (debug "ksm_merge_across_nodes configured")} Line 50: 6)
Line 42: (debug Host.ksm_merge_across_nodes "=ksm_merge_across_nodes") Line 43: (debug ksmMergeAcrossNodes "=ksmMergeAcrossNodes") Line 44: (if (!= Host.ksm_merge_across_nodes ksmMergeAcrossNodes){ Line 45: (debug "ksm_merge_across_nodes policy change") Line 46: (if (== Host.ksm_run 0){
Shouldn't we unmerge when the across node settings changes to 0 even though
Yes need to unmerge KSM when transition ksmMergeAcrossNode=0 to ksmMergeAcrossNode=1 as well. Following the official documentation https://www.kernel.org/doc/Documentation/vm/ksm.txt Line 47: (debug "ksm_run == 0 : Update ksm_merge_across_nodes") Line 48: (Host.Control "ksm_merge_across_nodes" ksmMergeAcrossNodes) Line 49: (debug "ksm_merge_across_nodes configured")} Line 50: 6)
Line 69: (debug "ksm_merge_across_nodes configured")} Line 70: 9) Line 71: } 10) Line 72: (debug "exit: enable_ksmMergeAcrossNodes") Line 73: })
Please use the function as a function.. return the expected ksm_run mode he
Done, need some syntax instructions. Line 74: ### Main Script Line 75: # Methodology: Since running KSM does incur some overhead, try to run it only Line 76: # when necessary. If the amount of committed KSM shareable memory is high or if Line 77: # free memory is low, enable KSM to try to increase free memory. Large memory
Line 80: Line 81: (defvar ksm_pressure_threshold (* Host.mem_available ksm_free_percent)) Line 82: (defvar ksm_committed Host.ksm_shareable) Line 83: (enable_ksmMergeAcrossNodes) Line 84: (if (== ksm_umerging_pages 0)
Why didn't you add this as another condition to the nested if and used the
As stated there is separation of concerns, applying_KSM_policy and activating_KSM. Both share operational kernel flags. applying_KSM_policy invocation is rare, may take few MoM cycles to complete. While activating_KSM may override applying_KSM_policy run mode. Therefore we might wish to make them exclusive to each other (no kernel flags overriding, simpler to understand). Line 85: (if (or (and (< (+ ksm_pressure_threshold ksm_committed) Host.mem_available) Line 86: (> (Host.StatAvg "mem_free") ksm_pressure_threshold)) Line 87: (not ksmEnabled)) Line 88: (Host.Control "ksm_run" 0)
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 10:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 11:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 12:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 13:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dudi Maroshi has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 13: Verified+1
Inserted modification to satisfy comments on patch set 8.
Trying to consolidate debug lines created more obscure code. Since a debug massage may contain max 2 arguments.
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 14:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dudi Maroshi has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 14: Verified+1
Martin Sivák has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 14: Code-Review+1 Verified+1
I saw it working and the policy file now looks much simpler so ACK from me.
Dan Kenigsberg has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 14: Code-Review+2
raising score
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
vdsm: implement NUMA aware KSM policy
Add monitored parameter ksm_merge_across_nodes to: 1. momIf.py class - append to status report 2. superVdsmServer file - enable writing to the kernel flag
Update policy logic (a simple state machine) to 03-ksm.policy merge_across_nodes flag allowed to be changed only after unmerging all pages. This unmerge completion is tested on pages_shared flag == 0.
Update policy parameter ksmMergeAcrossNodes to 00-defines.policy
Change-Id: Iec607f9ef3284c1448bfc2831d125fc4d81b28d2 Related-to: https://bugzilla.redhat.com/show_bug.cgi?id=840114 Signed-off-by: Dudi Maroshi dudi@redhat.com Reviewed-on: https://gerrit.ovirt.org/40129 Continuous-Integration: Jenkins CI Reviewed-by: Martin Sivák msivak@redhat.com Tested-by: Martin Sivák msivak@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/mom.d/00-defines.policy M vdsm/mom.d/03-ksm.policy M vdsm/momIF.py M vdsm/supervdsmServer 4 files changed, 66 insertions(+), 4 deletions(-)
Approvals: Martin Sivák: Verified; Looks good to me, but someone else must approve Dudi Maroshi: Verified Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved
automation@ovirt.org has posted comments on this change.
Change subject: vdsm: implement NUMA aware KSM policy ......................................................................
Patch Set 15:
* Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org