Skip to content

Commit

Permalink
Merge pull request #744 from zacikpa/missing-instance-parameters
Browse files Browse the repository at this point in the history
plugins: Add missing instance parameters
  • Loading branch information
yarda authored Feb 3, 2025
2 parents 374697b + 6e77941 commit baadb6d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tuned/plugins/plugin_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def _set_sampling_down_factor(self, sampling_down_factor, device, instance, sim,
self._governors_map.clear()

self._governors_map[device] = None
governor = self._get_governor(device)
governor = self._get_governor(device, instance)
if governor is None:
log.debug("ignoring sampling_down_factor setting for CPU '%s', cannot match governor" % device)
return None
Expand All @@ -600,7 +600,7 @@ def _set_sampling_down_factor(self, sampling_down_factor, device, instance, sim,

@command_get("sampling_down_factor")
def _get_sampling_down_factor(self, device, instance, ignore_missing=False):
governor = self._get_governor(device, ignore_missing=ignore_missing)
governor = self._get_governor(device, instance, ignore_missing=ignore_missing)
if governor is None:
return None
path = self._sampling_down_factor_path(governor)
Expand Down
6 changes: 3 additions & 3 deletions tuned/plugins/plugin_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,17 +456,17 @@ def _multiply_readahead(self, enabling, multiplier, device, verify, ignore_missi
command_name = "readahead_multiply",
device_name = device)
if enabling:
old_readahead = self._get_readahead(device)
old_readahead = self._get_readahead(device, instance)
if old_readahead is None:
return
new_readahead = int(float(multiplier) * old_readahead)
self._storage.set(storage_key, old_readahead)
self._set_readahead(new_readahead, device, False)
self._set_readahead(new_readahead, device, instance, False, False)
else:
old_readahead = self._storage.get(storage_key)
if old_readahead is None:
return
self._set_readahead(old_readahead, device, False)
self._set_readahead(old_readahead, device, instance, False, False)
self._storage.unset(storage_key)

def _scheduler_quantum_file(self, device):
Expand Down
4 changes: 2 additions & 2 deletions tuned/plugins/plugin_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1528,11 +1528,11 @@ def _set_sched_min_granularity_ns(self, value, instance, sim, remove):

@command_get("sched_base_slice_ns")
def _get_sched_base_slice_ns(self, instance):
return self._get_sched_min_granularity_ns()
return self._get_sched_min_granularity_ns(instance)

@command_set("sched_base_slice_ns")
def _set_sched_base_slice_ns(self, value, instance, sim, remove):
return self._set_sched_min_granularity_ns(value, sim, remove)
return self._set_sched_min_granularity_ns(value, instance, sim, remove)

@command_get("sched_latency_ns")
def _get_sched_latency_ns(self, instance):
Expand Down
6 changes: 3 additions & 3 deletions tuned/plugins/plugin_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ def _files(self, device):
"panel_power_savings": "/sys/class/drm/%s/amdgpu/panel_power_savings" % device,
}

def apply_panel_power_saving_target(self, device, target, sim=False):
def apply_panel_power_saving_target(self, device, target, instance, sim=False):
"""Apply the target value to the panel_power_savings file if it doesn't already have it"""

# if we don't have the file, we might be radeon not amdgpu
if not os.path.exists(self._files(device)["panel_power_savings"]):
return None

# make sure the value is different (avoids unnecessary kernel modeset)
current = int(self._get_panel_power_savings(device))
current = int(self._get_panel_power_savings(device, instance))
if current == target:
log.info(
"panel_power_savings for %s already %s" % (device, target)
Expand Down Expand Up @@ -167,7 +167,7 @@ def _set_panel_power_savings(self, value, device, instance, sim, remove):
log.warning("Invalid value %s for panel_power_savings" % value)
return None
if value in range(0, 5):
return self.apply_panel_power_saving_target(device, value, sim)
return self.apply_panel_power_saving_target(device, value, instance, sim)
else:
log.warning("Invalid value %s for panel_power_savings" % value)
return None
Expand Down
4 changes: 2 additions & 2 deletions tuned/plugins/plugin_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _set_transparent_hugepages(self, value, instance, sim, remove):
# just an alias to transparent_hugepages
@command_set("transparent_hugepage")
def _set_transparent_hugepage(self, value, instance, sim, remove):
self._set_transparent_hugepages(value, sim, remove)
self._set_transparent_hugepages(value, instance, sim, remove)

@command_get("transparent_hugepages")
def _get_transparent_hugepages(self, instance):
Expand All @@ -116,7 +116,7 @@ def _get_transparent_hugepages(self, instance):
# just an alias to transparent_hugepages
@command_get("transparent_hugepage")
def _get_transparent_hugepage(self, instance):
return self._get_transparent_hugepages()
return self._get_transparent_hugepages(instance)

@command_set("transparent_hugepage.defrag")
def _set_transparent_hugepage_defrag(self, value, instance, sim, remove):
Expand Down

0 comments on commit baadb6d

Please sign in to comment.