diff --git a/.github/release-nest-v3 b/.github/release-nest-v3 index d8263ee..00750ed 100644 --- a/.github/release-nest-v3 +++ b/.github/release-nest-v3 @@ -1 +1 @@ -2 \ No newline at end of file +3 diff --git a/falcond/debian/changelog b/falcond/debian/changelog index 243dd36..5bb21f6 100644 --- a/falcond/debian/changelog +++ b/falcond/debian/changelog @@ -1,3 +1,9 @@ +falcond (1.0.3-101pika1) pika; urgency=low + + * Disable ananicy-cpp when scx sched is used, reneable when one is disabled + + -- ferreo Sun, 12 Jan 2025 13:48:00 +0300 + falcond (1.0.2-101pika1) pika; urgency=low * Minor fix for race condition during profile reloadings diff --git a/falcond/src/clients/scx_scheds.zig b/falcond/src/clients/scx_scheds.zig index bc7296b..a3e6f7e 100644 --- a/falcond/src/clients/scx_scheds.zig +++ b/falcond/src/clients/scx_scheds.zig @@ -193,6 +193,10 @@ fn isSchedulerSupported(scheduler: ScxScheduler) bool { } pub fn activateScheduler(alloc: std.mem.Allocator, scheduler: ScxScheduler, mode: ?ScxSchedModes) ScxError!void { + if (scheduler != .none) { + runSystemCtl(alloc, "stop", "ananicy-cpp"); + } + var dbus_conn = dbus.DBus.init(alloc, SCX_NAME, SCX_PATH, SCX_IFACE); const mode_str = try std.fmt.allocPrint(alloc, "{d}", .{modeToInt(mode orelse .default)}); @@ -236,9 +240,30 @@ pub fn applyScheduler(alloc: std.mem.Allocator, scheduler: ScxScheduler, mode: ? }; } +fn runSystemCtl(alloc: std.mem.Allocator, command: []const u8, service: []const u8) void { + const argv = [_][]const u8{ "systemctl", command, service }; + const max_output_size = 1024; + const result = std.process.Child.run(.{ + .allocator = alloc, + .argv = &argv, + .max_output_bytes = max_output_size, + }) catch |err| { + std.log.warn("Failed to run systemctl {s} {s}: {}", .{ command, service, err }); + return; + }; + defer alloc.free(result.stderr); + defer alloc.free(result.stdout); + + if (result.term.Exited != 0) { + std.log.warn("systemctl failed: {s}", .{result.stderr}); + return; + } +} + pub fn deactivateScheduler(alloc: std.mem.Allocator) ScxError!void { var dbus_conn = dbus.DBus.init(alloc, SCX_NAME, SCX_PATH, SCX_IFACE); try dbus_conn.callMethod("StopScheduler", &[_][]const u8{}); + runSystemCtl(alloc, "start", "ananicy-cpp"); } pub fn restorePreviousState(alloc: std.mem.Allocator) void { diff --git a/falcond/src/clients/vcache_setting.zig b/falcond/src/clients/vcache_setting.zig index c361975..6c33ea1 100644 --- a/falcond/src/clients/vcache_setting.zig +++ b/falcond/src/clients/vcache_setting.zig @@ -15,7 +15,7 @@ var previous_mode_buffer: [10]u8 = undefined; pub fn applyVCacheMode(vcache_mode: VCacheMode) void { const file = fs.openFileAbsolute(vcache_path, .{ .mode = .read_write }) catch |err| switch (err) { error.FileNotFound => { - std.log.info("AMD 3D vcache support not detected", .{}); + std.log.info("AMD dual CCD 3D vcache support not detected", .{}); return; }, else => { diff --git a/main.sh b/main.sh index 374dc73..3c9f996 100755 --- a/main.sh +++ b/main.sh @@ -2,7 +2,7 @@ set -e -VERSION="1.0.2" +VERSION="1.0.3" source ./pika-build-config.sh