From 627b476ab9c92d9aa3bb4888e4869faa6bb6121f0922f411d1b85bb048304ad5 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 27 Aug 2024 07:54:11 +0000 Subject: [PATCH] As requested by a customer, the Edge BU would like to support use cases where stalld can be beneficial on our RT products. We would be happy to have it maintained by us and included in our base images OBS-URL: https://build.opensuse.org/package/show/Base:System/stalld?expand=0&rev=1 --- .gitattributes | 23 +++++++++++++++ .gitignore | 1 + pid-dir.patch | 12 ++++++++ stalld-v1.19.3.tar.bz2 | 3 ++ stalld.spec | 65 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pid-dir.patch create mode 100644 stalld-v1.19.3.tar.bz2 create mode 100644 stalld.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/pid-dir.patch b/pid-dir.patch new file mode 100644 index 0000000..61efeb3 --- /dev/null +++ b/pid-dir.patch @@ -0,0 +1,12 @@ +diff --git a/systemd/stalld.service b/systemd/stalld.service +index d93110b..c80ba24 100644 +--- a/systemd/stalld.service ++++ b/systemd/stalld.service +@@ -7,6 +7,7 @@ Type=simple + # Type=forking + EnvironmentFile=/etc/sysconfig/stalld + ExecStartPre=/usr/bin/throttlectl off ++ExecStartPre=/usr/bin/mkdir -p /run/stalld + + # In case the regex passed to IT or IP includes C escape sequences, + # use ${IT} or ${IP} instead of $IT or $IP diff --git a/stalld-v1.19.3.tar.bz2 b/stalld-v1.19.3.tar.bz2 new file mode 100644 index 0000000..28363c8 --- /dev/null +++ b/stalld-v1.19.3.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cb0ae72d9c0562f3bee40be04d923e9581dcbfaef7feb908d8bf777b75150da +size 38577 diff --git a/stalld.spec b/stalld.spec new file mode 100644 index 0000000..0fbb439 --- /dev/null +++ b/stalld.spec @@ -0,0 +1,65 @@ +Name: stalld +Version: 1.19.3 +Release: 1%{?dist} +Summary: Daemon that finds starving tasks and gives them a temporary boost + +Vendor: SUSE Linux + +License: GPL-2.0-or-later AND GPL-2.0-only +URL: https://gitlab.com/rt-linux-tools/%{name}/%{name}.git +Source0: stalld-v1.19.3.tar.bz2 + +Patch0: pid-dir.patch + +BuildRequires: glibc-devel +BuildRequires: gcc +BuildRequires: make + +Requires: systemd +Requires(post): %fillup_prereq + +%description +The stalld program monitors the set of system threads, +looking for threads that are ready-to-run but have not +been given processor time for some threshold period. +When a starving thread is found, it is given a temporary +boost using the SCHED_DEADLINE policy. The default is to +allow 10 microseconds of runtime for 1 second of clock time. + +%prep +%autosetup -v -p1 -n %{name}-v%{version} + +%build +%make_build USE_BPF=0 SOPTS="" CFLAGS="%{optflags} %{build_cflags} -DVERSION="\\\"%{version}\\\""" stalld + +%install +%make_install DOCDIR=%{_docdir} MANDIR=%{_mandir} BINDIR=%{_bindir} DATADIR=%{_datadir} VERSION=%{version} +%make_install -C systemd UNITDIR=%{_unitdir} +mkdir -p %{buildroot}%{_fillupdir} +mv %{buildroot}%{_sysconfdir}/sysconfig/%{name} %{buildroot}%{_fillupdir}/sysconfig.%{name} + +%files +%{_bindir}/%{name} +%{_bindir}/throttlectl +%{_unitdir}/%{name}.service +%{_fillupdir}/sysconfig.%{name} +%doc %{_docdir}/README.md +%doc %{_mandir}/man8/stalld.8* +%license gpl-2.0.txt + +%pre +%service_add_pre %{name}.service + +%post +%fillup_only +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + +%changelog +* Mon Jun 3 2024 Marco Chiappero - 1.19.3 +- Initial package \ No newline at end of file