Compare commits

...

1 Commits
c8 ... c10

Author SHA1 Message Date
221827dfc6 import OL stalld-1.19.8-2.el10_0 2025-08-12 11:47:59 +00:00
5 changed files with 160 additions and 67 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/stalld-1.19.1.tar.bz2
SOURCES/stalld-1.19.8.tar.bz2

1
.stalld.metadata Normal file
View File

@ -0,0 +1 @@
a42e0ef18ee186c044349c2f39651fe20f7ca70b SOURCES/stalld-1.19.8.tar.bz2

View File

@ -1,31 +0,0 @@
From c93cef85e7ec08d924ad6a4f90a8677cc1603950 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 14 Feb 2024 15:55:30 -0500
Subject: [PATCH] Start stalld service as initrc_t
Stalld currently runs as an unconfined_service_t.
Edit to service file so that the daemon is launched as an initrc_t.
Signed-off-by: Leah Leshchinsky <lleshchi@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
systemd/stalld.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/systemd/stalld.service b/systemd/stalld.service
index d93110b1b43e..69f3ee728129 100644
--- a/systemd/stalld.service
+++ b/systemd/stalld.service
@@ -10,7 +10,7 @@ ExecStartPre=/usr/bin/throttlectl off
# In case the regex passed to IT or IP includes C escape sequences,
# use ${IT} or ${IP} instead of $IT or $IP
-ExecStart=/usr/bin/stalld --systemd $CLIST $AGGR $BP $BR $BD $THRESH $LOGGING $FG $PF $IT $IP
+ExecStart=/bin/sh -c "/usr/bin/stalld --systemd $CLIST $AGGR $BP $BR $BD $THRESH $LOGGING $FG $PF $IT $IP"
ExecStopPost=/usr/bin/throttlectl on
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=10
--
2.43.0

View File

@ -0,0 +1,33 @@
From b79c1777ee16901b3d27cd25e50435f4f060cfa8 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Thu, 22 May 2025 11:33:07 -0400
Subject: [PATCH] stalld: sched_attr: Do not define for glibc >= 2.41
glibc >=2.41 has definitions for struct sched_attr and
sched_setattr and sched_getattr
Sometimes this is backported by distributions so define conditionally on
SCHED_ATTR_SIZE_VER0
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/stalld.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/stalld.h b/src/stalld.h
index 0c4dcee503ca..7b4d7e60f5f7 100644
--- a/src/stalld.h
+++ b/src/stalld.h
@@ -110,7 +110,8 @@ struct stalld_backend {
void (*destroy)(void);
};
-#if ! __GLIBC_PREREQ(2, 41) && !defined(GLIBC_HAS_SCHED_ATTR)
+/* sched_attr is not defined in glibc < 2.41, unless backported */
+#ifndef SCHED_ATTR_SIZE_VER0
#ifdef __x86_64__
# define __NR_sched_setattr 314
--
2.49.0

View File

@ -1,9 +1,9 @@
Name: stalld
Version: 1.19.1
Release: 4%{?dist}
Version: 1.19.8
Release: 2%{?dist}
Summary: Daemon that finds starving tasks and gives them a temporary boost
License: GPLv2
License: GPL-2.0-or-later AND GPL-2.0-only
URL: https://gitlab.com/rt-linux-tools/%{name}/%{name}.git
Source0: https://gitlab.com/rt-linux-tools/%{name}/-/archive/v%{version}/%{name}-%{version}.tar.bz2
@ -18,12 +18,14 @@ Requires: systemd
BuildRequires: bpftool
BuildRequires: clang
BuildRequires: libbpf-devel
BuildRequires: llvm
Requires: libbpf
%endif
Patch0: Start-stalld-service-as-initrc_t.patch
# Patches
Patch1: stalld-sched_attr-Do-not-define-for-glibc-2.41.patch
%define _hardened_build 1
%description
The stalld program monitors the set of system threads,
@ -37,7 +39,7 @@ allow 10 microseconds of runtime for 1 second of clock time.
%autosetup -p1
%build
%make_build CFLAGS="%{optflags} %{build_cflags} -DVERSION="\\\"%{version}\\\""" LDFLAGS="%{build_ldflags}"
%make_build RPMCFLAGS="%{optflags} %{build_cflags} -DVERSION="\\\"%{version}\\\""" RPMLDFLAGS="%{build_ldflags}"
%install
%make_install DOCDIR=%{_docdir} MANDIR=%{_mandir} BINDIR=%{_bindir} DATADIR=%{_datadir} VERSION=%{version}
@ -62,35 +64,122 @@ allow 10 microseconds of runtime for 1 second of clock time.
%systemd_postun_with_restart %{name}.service
%changelog
* Wed Feb 14 2024 John Kacur <jkacur@redhat.com> - 1.19.1-4
- Put back patch to run stalld service as initrc_t
Resolves: RHEL-8982
* Thu May 22 2025 John Kacur <jkacur@redhat.com> - 1.19.8-2
- Check if sched_attr is in glibc
Resolves: RHEL-92953
* Mon Feb 12 2024 John Kacur <jkacur@redhat.com> - 1.19.1-3
- Copying over missing tests directory
Resolves: RHEL-8982
* Wed Feb 12 2025 Clark Williams <williams@redhat.com> - 1.19.8-1
- sched_debug: fix non x86 support
- stalld.h: fix prototype mis-patch with cleanup_regex()
- throttlectl.sh: add errexit
- stalld.h: fix incorrect default umask value
- version bump
- Fix building with glibc 2.41
- throttlectl: clean up throttling script due to reported CVE-2024-54159
- Makefile: change modes on throttled and stalld
- stalld.c: use a more reasonable size for reading /proc/stat
Resolves: RHEL-69567
Resolves: RHEL-40146
Resolves: RHEL-79159
Resolves: RHEL-67223
Resolves: RHEL-50356
* Mon Feb 12 2024 John Kacur <jkacur@redhat.com> - 1.19.1-2
- Add llvm as a build requirement
Resolves: RHEL-8982
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.19.6-2
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Feb 09 2024 John Kacur <jkacur@redhat.com> - 1.19.1-1
- Rebase to v1.19.1 upstream
Resolves: RHEL-8982
* Thu Aug 22 2024 Chris White <chwhite@redhat.com> - 1.19.6-1
- Makefile: add uninstall target
- systemd: add BE environment variable to select backend
Resolves: RHEL-34055
* Tue Oct 18 2022 Leah Leshchinsky <lleshchi@redhat.com> - 1.17.1-1
* Wed Jul 31 2024 Chris White <chwhite@redhat.com> - 1.19.5-2
- Fix changelog to use RPMCFLAGS, allowing for bpf to be used.
Resolves: RHEL-34055
* Thu Jul 18 2024 Chris White <chwhite@redhat.com> - 1.19.5
- Refactor Makefile to fix passing options to koji builds
- Updated compile options for annocheck hardening
- Ensure we resolve library symbols at load time (-z now) and are a Position Independent Executable (-pie). Refactored compile options to better deal with arch differences.
- Added an 'annocheck' makefile target for local checking.
Resolves: RHEL-34055
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.19.3-3
- Bump release for June 2024 mass rebuild
Resolves: RHEL-34055
* Thu Jun 13 2024 Chris White <chwhite@redhat.com> - 1.19.3
- systemd: ensure that pidfile directory exists
Resolves: RHEL-34055
* Tue May 28 2024 Chris White <chwhite@redhat.com> - 1.19.3
- Makefile: change build to use FORTIFY_SOURCE=3
- src/utils.c: fix off-by-one error in buffer allocation
Resolves: RHEL-34055
* Fri May 10 2024 Chris White <chwhite@redhat.com> - 1.19.2
- stalld.conf: Fix stalld service start fail
- throttling.c: null terminate input buffer
- stalld: free malloc'd buffer on function exit
- throttlectl.sh: use legal value for exit on fail
- Make fill_process_comm() open comm file as READ_ONLY
Resolves: RHEL-34055
* Fri Feb 09 2024 Clark Williams <williams@redhat.com> - 1.19.1
- Conditionalize BPF and queue_track build per architecture
- clean up Makefile install logic and add .bz2 to .gitignore
- modify Makefiles so install works with relative paths
- rename 'redhat' to 'systemd' and remove redhat packaging logic
- update SPDX tags to non-deprecated values
- stalld: Add -a/--affinity option
- Adding SPDX license info to each file
- man/stalld.8: change starving threshold to match code
- utils: Fix freeing of invalid pointer
- add bpftool as BuildRequires
* Mon Dec 25 2023 Clark Williams <williams@redhat.com> - 1.18.1
- queue_track: Use LIBBPF_MAJOR/MINOR_VERSION to detect deprecated functions
- utils: Close file descriptor
- stalld: Fix function name of daemonize()
- docs: Fix typo in the manual
- queue_track: Use bpf_map__resize on older libbpf versions
- utils: Let tgid to arrive at the fill proccess comm
- stalld: Fix log message on idle detection
- stalld: Add -b/--backend option
- stalld: Add queue track eBPF based backend
- stalld: Add fill_process_comm helper
- stalld: Include regex.h on stalld.h
- stalld: Get nr of cpus only once
- stalld: Add the backend abstraction
- sched_debug: Move sched debug functions to an specific file
* Thu Dec 21 2023 Clark Williams <williams@redhat.com> - 1.17.1
- stalld: Fix memory leak in print_boosted_info()
- utils: Check if the system is in lockdown mode
- stalld: print process comm and cpu when boosting
Resolves: rhbz#2120800
- stalld: Detect runnable dying tasks
- stalld: Fix nr_periods calculation in do_fifo_boost()
- stalld.conf: Lower threshold to 20
- utils.c: Exit early if enabling HRTICK fails when using SCHED_DEADLINE
- Add support for loongarch
* Thu Sep 08 2022 Leah Leshchinsky <lleshchi@redhat.com> - 1.17-2
- Start stalld service as initrc_t
Resolves:rhbz#2112366
* Mon Dec 18 2023 Clark Williams <williams@redhat.com> - 1.16.7
- fix to sync versions
* Thu Jul 14 2022 John Kacur <jkacur@redhat.com> - 1.17-1
- rebase to upstream v1.17
Resolves:rhbz#2107273
* Mon Dec 18 2023 Clark Williams <williams@redhat.com> - 1.16.6
- remove un-needed BuildRequire for bpftool
* Mon Dec 18 2023 Clark Williams <williams@redhat.com> - 1.16.5
- changed package license to match SPDX values
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.16-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.16-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.16-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Mar 31 2022 Fernando Pacheco <fpacheco@redhat.com> - 1.16-1
- stald/utils: Space, lines and voids clenaups
@ -99,7 +188,9 @@ Resolves:rhbz#2107273
- src/utils: Comments cleanup
- src/throttling: Comments cleanup
- src/stalld.h Comments cleanup
Resolves: rhbz#2068549
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Nov 15 2021 Fernando Pacheco <fpacheco@redhat.com> - 1.15-1
- stalld: Fix incorrect open() return value checks
@ -109,7 +200,6 @@ Resolves:rhbz#2107273
- tests: Fix uninitialized value action.sa_mask
- utils: Bail if malloc() returns null in parse_cpu_list()
- stalld: Use correct format specifier for long types
Resolves: rhbz#1990057, rhbz#1996799, rhbz#1996825
* Mon Jul 19 2021 Fernando Pacheco <fpacheco@redhat.com> - 1.14.1-1
- stalld: Coding style cleanup
@ -122,7 +212,7 @@ Resolves:rhbz#2107273
- stalld: Adjust variables in parse_old_task_format()
- utils.c: Use MAX_PATH for pidfile
- stalld.c: Remove variable declaration from the middle of the function
- stalld: Respect -l option in single threaded mode (1983100)
- stalld: Respect -l option in single threaded mode
- utils: s/try_to_open_file/check_file_exists/
- utils: use check_file_exists in setup_hr_tick()
- utils: Check for the new sched_features path
@ -133,22 +223,22 @@ Resolves:rhbz#2107273
- stalld: Add the adaptive mode option
- stalld: Use the last mode set in the cmdline
- stalld: Fallback to the adaptive mode if force_fifo is selected
- stalld: Make single-threaded mode the default one (1920041)
- stalld: Make single-threaded mode the default one
- stalld.service: Always restart stalld on exit
- utils.c: Fail if user is not root
- utils.c: Make the path to sched_debug path dynamic (1977663)
- utils.c: Make the path to sched_debug path dynamic
* Tue Jun 29 2021 Fernando Pacheco <fpacheco@redhat.com> - 1.12-1
- stalld.8: fix diff cruft left in manpage source
- stalld.c: clean up handling of nr_running
- stalld.c: remove duplicate parameter to fill_waiting_task() (1934582)
- stalld.c: remove duplicate parameter to fill_waiting_task()
- stalld: Add error handling in get_cpu_idle_time()
- stalld.service: Run stalld as sched_fifo via systemd
- stalld: Add error handling in get_cpu_idle_time() (1966259)
- packaging: clean up Makefiles and rpm specfile (1972806)
- packaging: clean up Makefiles and rpm specfile
- stalld: Always print current function for info messages
- stalld: Always print current function for warn messages
- stalld: Always print current function for die messages
- utils: change PATHMAX to 4096 (1934581)
- utils: change PATHMAX to 4096
* Thu May 13 2021 Clark Williams <williams@redhat.com> - 1.11-1
- redhat/stalld.spec: pick up gating test version for changelog