api.c: prevent array out-of-bounds access in cgroup_parse_rules_file
In the function src/api.c/cgroup_parse_rules_file, the condition of loop:
for (i = 0; lst->tail->controllers[i]; i++)
cgroup_dbg(" %s", lst->tail->controllers[i]);
allows accessing lst->tail->controllers[MAX_MNT_ELEMENTS] if
lst->tail->controllers is full and lacks a terminating NULL.
Add explicit bounds checking (i < MAX_MNT_ELEMENTS) while maintaining
the NULL check. This ensures that there will never be reading past the
array boundaries regardless of its content.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
api.c: prevent array out-of-bounds access in cgroup_create_template_group
In the function src/api.c/cgroup_create_template_group,
the loop condition:
while (tmp->controllers[i] != NULL) {
allows accessing tmp->controllers[MAX_MNT_ELEMENTS] if tmp->controllers
is full and lacks a terminating NULL.
Add explicit bounds checking (i < MAX_MNT_ELEMENTS) while maintaining
the NULL check. This ensures that there will never be reading past
the array boundaries regardless of its content.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
ftests/run.py: terminate processes that exceed timeout
Some commands, like 'cgrulesengd' in non-daemon mode, continue running
until explicitly terminated. Currently, we catch exceptions for timeouts
but do not terminate the lingering process. This patch ensures that such
processes are properly killed after the timeout.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Teodor Milkov [Thu, 12 Jun 2025 09:47:41 +0000 (15:17 +0530)]
src/config: Fix segfault while using templates
An intermittent segmentation fault occurs when classifying tasks using
cgrulesengd in combination with a template defined in cgconfig.conf.
Backtrace:
(gdb) bt
#0 __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:295
#1 0x00007079d2e69645 in cgroup_config_create_template_group (cgroup=0x18844f834600,
template_name=0x18844f710cd0 "system/hosting-users/%g/mail-delivery", flags=1) at config.c:1950
#2 0x00007079d2e61458 in cgroup_create_template_group (orig_group_name=0x79905b6ebb70 "system/hosting-users/ryleeisitt/mail-delivery",
tmp=0x18844f69cce0, flags=1) at api.c:4609
#3 0x00007079d2e61bcd in cgroup_change_cgroup_flags (uid=0, gid=674, procname=0x18844f79c310 "/var/qmail/bin/qmail-queue-wrapper", pid=1048, flags=1)
at api.c:4811
#4 0x000018844cc0f29d in cgre_process_event (ev=0x79905b6ecc74, type=4) at cgrulesengd.c:485
#5 0x000018844cc0f441 in cgre_handle_msg (cn_hdr=0x79905b6ecc60) at cgrulesengd.c:531
#6 0x000018844cc0f678 in cgre_receive_netlink_msg (sk_nl=0) at cgrulesengd.c:596
#7 0x000018844cc0ffe1 in cgre_create_netlink_socket_process_msg () at cgrulesengd.c:786
#8 0x000018844cc10e4e in main (argc=3, argv=0x79905b6eda58) at cgrulesengd.c:1282
Fix the issue using cgroup->index that holds the count of controllers,
populated for the cgroup instead of checking for
cgroup->controller[index] is NULL.
ftests/utils: add get_distro() to detect Linux distribution
Introduce helper function get_distro() to identify the current Linux
distribution. Currently checks for 'Ubuntu' and 'Oracle Linux', which
are the only distros used for testing. Can be extended to support others
in the future.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Fri, 13 Jun 2025 12:38:36 +0000 (18:08 +0530)]
src: Bump MAX_MNT_ELEMENTS for new 'dmem' controller
Upstream commit b168ed458ddec ("kernel/cgroup: Add 'dmem' memory
accounting cgroup") adds a new controller. Update MAX_MNT_ELEMENTS
to match the increased number of cgroup controllers.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Sam James [Thu, 22 May 2025 23:51:01 +0000 (00:51 +0100)]
tests: fix checking wrong result in 017-API_fuzz_test
There seem to be various calls to cgroup_add_controller where the result
isn't validated, instead checking the cgrp pointer.
We could add two asserts in each place being changed here if the concern
was testing for if cgroup_add_controller mangled cgrp, but it looks
more likely that it's a copy/paste error instead and we're just testing
the wrong thing.
Signed-off-by: Sam James <sam@gentoo.org> Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Sam James [Fri, 23 May 2025 00:13:51 +0000 (01:13 +0100)]
src: handle NULL options in cgroup_parse_rules_options
We don't want to pass NULL to strtok:
```
[ RUN ] ParseRulesOptionsTest.RulesOptions_NullOptions
==2006496== Conditional jump or move depends on uninitialised value(s)
==2006496== at 0x520D156: strtok_r (strtok_r.c:49)
==2006496== by 0x403FB7E: cgroup_parse_rules_options (api.c:529)
==2006496== by 0x4005F41: ParseRulesOptionsTest_RulesOptions_NullOptions_Test::TestBody() (002-cgroup_parse_rules_options.cpp:89)
==2006496== by 0x4ABA45D: ??? (in /usr/lib64/libgtest.so.1.15.2)
==2006496== by 0x4ABE5AB: ??? (in /usr/lib64/libgtest.so.1.15.2)
==2006496== by 0x4A9D949: testing::TestInfo::Run() (in /usr/lib64/libgtest.so.1.15.2)
==2006496== by 0x4ABF18A: ??? (in /usr/lib64/libgtest.so.1.15.2)
==2006496== by 0x4AB7467: testing::internal::UnitTestImpl::RunAllTests() (in /usr/lib64/libgtest.so.1.15.2)
==2006496== by 0x4AACC46: testing::UnitTest::Run() (in /usr/lib64/libgtest.so.1.15.2)
==2006496== by 0x4002345: UnknownInlinedFun (gtest.h:2334)
==2006496== by 0x4002345: main (gtest.cpp:15)
==2006496==
Error: failed to parse options: (null)
```
Signed-off-by: Sam James <sam@gentoo.org> Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Mon, 14 Apr 2025 20:54:50 +0000 (14:54 -0600)]
ftests: Add a test for the memory abstraction layer
Add a test for the memory abstraction layer abstractions.
Currently only supports:
memory.max <-> memory.limit_in_bytes
memory.high <-> memory.soft_limit_in_bytes
-----------------------------------------------------------------
Test Results:
Run Date: Apr 14 14:52:47
Passed: 1 test(s)
Skipped: 0 test(s)
Failed: 0 test(s)
-----------------------------------------------------------------
Timing Results:
Test Time (sec)
--------------------------------------------
setup 0.00
093-cgxget-memory_settings.py 3.34
teardown 0.00
--------------------------------------------
Total Run Time 3.34
[Kamalesh removed the unused exceptions variable (lint warnings)] Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Update the release process documentation to include the missing step for
pushing to the newly created release branch. Renumber subsequent steps
to reflect the correct order.
Suggested-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Added "If this is a new..." text
Tom Hromatka [Tue, 8 Apr 2025 23:19:40 +0000 (17:19 -0600)]
github: dist: Rework the unit tests
Add a configure option to enable/disable the unit tests. Because of their
dependency upon googletest, they're very difficult to run for distros.
This allows them to packaged with libcgroup, but they are disabled by
default. They can be enabled via the config option `--enable-unittests`.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Tom Hromatka [Tue, 8 Apr 2025 22:42:23 +0000 (16:42 -0600)]
github: dist: Rework the automated functional tests
Now that Github Actions don't support cgroup v1, we can make the github
runners run the tests in a more granular fashion. Add a runner to
individually run the containerized tests, the non-containerized tests,
and the sudo tests. This simplifies the testing logic, and should help
us better identify failures.
As part of this, no longer run ftests-wrapper.sh when `make check` is
invoked on the ftests directory. This is an undue burden for distros
as it requires uncommon dependencies (lxc, etc.) and can adversely
affect the cgroup sysfs filesystem on the build system. The onus is
on upstream libcgroup to provide a well-tested and vetted *.tar.gz for
the distros that they can then just package up and disseminate. They
shouldn't have to deal with challenging tests and test configurations.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Tom Hromatka [Tue, 8 Apr 2025 22:17:33 +0000 (16:17 -0600)]
github: Delete cgroup v1 workflows
Github has deprecated Ubuntu 20. Since this was the last runner still
running cgroup v1 by default, we no longer have a runner than can run
the automated tests in cgroup v1 mode. Therefore, delete the cgroup v1
automated test runs.
Note that we'll continue to run them by hand periodically and before
releases, but upstream changes may end up breaking/affecting cgroup v1
support. We strongly recommend migrating to cgroup v2.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Tom Hromatka [Tue, 1 Apr 2025 18:35:15 +0000 (18:35 +0000)]
gunit: Promote namespaces in test 001 and 013 to heap variables
On one of my ubuntu22 machines, the NAMESPACE5[] character array was
outputing garbage for the last test. Looks like gtest was running it in
another thread, and the pointer was garbage. Promote the NAMESPACE*
variables to be heap variables so that they're safely available for all
threads.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Tom Hromatka [Tue, 1 Apr 2025 17:41:01 +0000 (17:41 +0000)]
ftests: Retry getting pid of sleep process
The ftests framework uses sleeping processes to test various cgroup
features. Sometimes ps throws an error when we try to enumerate
processes via `ps x` within an lxc container.
The error thrown by ps is as follows:
Signal 21 (TTIN) caught by ps (3.3.17).
ps:ps/display.c:70: please report this bug
Fix this by adding a retry loop for the ps command, as it usually works
in a subsequent pass.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Tom Hromatka [Thu, 27 Mar 2025 15:28:28 +0000 (15:28 +0000)]
ftests: Fix test 005 on Cgroup v2 Ubuntu22
Test 005-cgsnapshot-basic_snapshot_v2.py was failing on Ubuntu22
(non-sudo tests) because the cpuset.cpus.exclusive.effective field
is no longer being reported by the kernel in that case.
Remove that line from the expected output for the non-sudo tests but
leave it in for the sudo tests as it's still reported there.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Now, the process name and destination cgroup are allowed to have spaces
within quotes. Update the man page to reflect the allowed characters
for both fields and add an example demonstrating rule usage.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: small formatting changes
Tom Hromatka [Wed, 22 Jan 2025 12:12:59 +0000 (17:42 +0530)]
gunit: Add unit tests for get_next_rule_field()
[----------] 10 tests from GetNextRuleField
[ RUN ] GetNextRuleField.InvalidParameters
[ OK ] GetNextRuleField.InvalidParameters (0 ms)
[ RUN ] GetNextRuleField.FieldLenTooSmall
[ OK ] GetNextRuleField.FieldLenTooSmall (0 ms)
[ RUN ] GetNextRuleField.FieldLenTooSmallWithQuotes
[ OK ] GetNextRuleField.FieldLenTooSmallWithQuotes (0 ms)
[ RUN ] GetNextRuleField.FieldLenTooSmallWithQuotes2
[ OK ] GetNextRuleField.FieldLenTooSmallWithQuotes2 (0 ms)
[ RUN ] GetNextRuleField.UserAndProcess
[ OK ] GetNextRuleField.UserAndProcess (0 ms)
[ RUN ] GetNextRuleField.UserOnly
[ OK ] GetNextRuleField.UserOnly (0 ms)
[ RUN ] GetNextRuleField.KeyWithQuotesAndSpaces
[ OK ] GetNextRuleField.KeyWithQuotesAndSpaces (0 ms)
[ RUN ] GetNextRuleField.DestinationWithQuotes
[ OK ] GetNextRuleField.DestinationWithQuotes (0 ms)
[ RUN ] GetNextRuleField.TabsAsDelimiters
[ OK ] GetNextRuleField.TabsAsDelimiters (0 ms)
[ RUN ] GetNextRuleField.RuleWithOptions
[ OK ] GetNextRuleField.RuleWithOptions (0 ms)
[----------] 10 tests from GetNextRuleField (0 ms total)
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Sun, 26 Jan 2025 06:01:25 +0000 (11:31 +0530)]
config: Fix data race reported in cgroup_config_insert_into_mount_table
Fix the following data race issue reported by Coverity:
CID 465888: (#1 of 1): Check of thread-shared field evades lock
acquisition (LOCK_EVASION):
"The data guarded by this critical section may be read while in an
inconsistent state or modified by multiple racing threads.
In cgroup_config_insert_into_mount_table: Checking the value of a
thread-shared field outside of a locked region to determine if a locked
operation involving that thread shared field has completed."
Fix it by moving the config_table_index value check too under the
config_table_lock.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Sun, 19 Jan 2025 05:48:02 +0000 (11:18 +0530)]
src/config: Fix data race reported by Coverity
Fix the following data race issue reported by Coverity:
CID 465888:Check of thread-shared field evades lock acquisition
(LOCK_EVASION):
"The data guarded by this critical section may be read while in an
inconsistent state or modified by multiple racing threads.
In cgroup_config_insert_into_namespace_table: Checking the value of a
thread-shared field outside of a locked region to determine if a locked
operation involving that thread shared field has completed."
Fix it by moving the namespace_table_index value check too under the
namespace_table_lock
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Aaron Tomlin [Mon, 13 Jan 2025 18:18:05 +0000 (11:18 -0700)]
api: Add extra debugging when matching rule to a group
In the context of a group rule (i.e. indicated by '@' used to prefix the
actual group name), getgrnam(3) is used to provide a pointer to a group
file entry that may contain a NULL-terminated array of pointers to group
members. A user can belong to multiple groups. With this information, we
then check the username that corresponds to the specified UID against
each group member for a match. This patch makes it possible to see this
information if debug level logging is enabled.
Use the new cgroup_get_loglevel() API to optimize the rule loop to
minimize performance impacts.
Kamalesh Babulal [Tue, 17 Dec 2024 05:56:30 +0000 (11:26 +0530)]
ftests/consts.py: Add more cpu controller output (v2)
Upstream v6.13 kernel commit aefa398d93d5 ("cgroup/rstat: Tracking
cgroup-level niced CPU time") added "nice_usec" to the cgroup base stats
cputime, add it to the list of cpu controller (v2) expected output.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Mon, 13 Jan 2025 17:31:41 +0000 (10:31 -0700)]
github: Ignore unused data errors in lcov
The "Unit Tests" job was throwing the following lcov error:
Summary coverage rate:
lines......: 20.5% (1073 of 5227 lines)
functions..: 29.0% (73 of 252 functions)
branches...: no data found
(use "lcov --ignore-errors unused ..." to bypass this error)
Add "--ignore errors unused" to the lcov command to work around this.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Tom Hromatka [Mon, 13 Jan 2025 17:19:34 +0000 (10:19 -0700)]
github: Revert to Ubuntu 22.04 (from latest) for cgroup v2 testing
Cgroup v2 testing on Ubuntu 24.04 is throwing the following errors.
Revert to Ubuntu 22.04 until the issue is resolved in the distro.
/home/runner/work/libcgroup/libcgroup/src/.libs/libcgroup.so.0)
Test:
012-cgget-multiple_r_flags2.py - RunError:
command = ['sudo', 'lxc', 'exec', 'TestLibcg', '--',
'/home/runner/work/libcgroup/libcgroup/src/tools/cgcreate', '-g',
'memory:012cgget1']
ret = 1
stdout =
stderr =
/home/runner/work/libcgroup/libcgroup/src/tools/.libs/cgcreate:
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found
(required by
/home/runner/work/libcgroup/libcgroup/src/tools/.libs/cgcreate)
/home/runner/work/libcgroup/libcgroup/src/tools/.libs/cgcreate:
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found
(required by
/home/runner/work/libcgroup/libcgroup/src/.libs/libcgroup.so.0)
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
gcc -o cgrp_get_cgrp_name cgrp_get_cgrp_name.c -lcgroup
/usr/bin/ld: /tmp/ccIyBv5c.o: in function `main':
cgrp_get_cgrp_name.c:(.text+0xaa): undefined reference to `cgroup_get_cgroup_name'
collect2: error: ld returned 1 exit status
The API was introduced by commit ca32d88ef56b1 ("wrappers: Add a
cgroup_get_cgroup_name API") but missed adding it to libcgroup.map file,
causing the linkage issue. Fix the issue by adding the API at the
libcgroup.map under version it was introduced.
Fixes: https://github.com/libcgroup/libcgroup/issues/459 Reported-by: Ron Nazarov <ron@noisytoot.org> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
With commit e475d7a545a2 ("github: Use default runners"), the dependency
on the self-hosted runners is removed. Also, remove the timeout logic to
synchronize jobs between self-hosted runners too.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Tue, 15 Oct 2024 01:42:03 +0000 (07:12 +0530)]
tests/gunit: src: match naming with upstream Linux
Rename local variable 'cgroup' -> 'cgrp' to match upstream Linux Kernel,
across the files under tests/gunit bringing it closer to the Linux
kernel cgroup code.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Mon, 14 Oct 2024 01:17:03 +0000 (06:47 +0530)]
samples/c: match naming with upstream Linux
Rename local variable 'cgroup' -> 'cgrp' to match upstream Linux Kernel,
across the files under samples/c/ bringing it closer to the Linux kernel
cgroup code.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Sun, 13 Oct 2024 01:08:40 +0000 (06:38 +0530)]
include: match naming with upstream Linux
Rename local variable 'cgroup' -> 'cgrp' to match upstream Linux Kernel,
across the files under include/libcgroup/ bringing it closer to the
Linux kernel cgroup code.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Sat, 12 Oct 2024 01:06:50 +0000 (06:36 +0530)]
tools: match naming with upstream Linux
Rename local variable 'cgroup' -> 'cgrp' to match upstream Linux Kernel,
across the files under src/tools/ bringing it closer to the Linux kernel
cgroup code.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Wed, 16 Oct 2024 09:11:32 +0000 (14:41 +0530)]
ftests/cgroup: Fix typo in CgroupMount::__init__
Fix the typo of '==' (comparison) to '=' assignment in
CgroupMount::__init__.
Fixes: 52b196c2f4f3c ("ftests/cgroup: Add support for favordynmods") Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Felix Moessbauer [Wed, 16 Oct 2024 13:30:29 +0000 (15:30 +0200)]
api.c: fix memory leak on non-writable settings
When hitting the path st_mode check, we might already have allocated a
path. In this case, the continue re-enters the loop without freeing the
path:
653 bytes in 8 blocks are definitely lost in loss record
at 0x484582F: realloc (vg_replace_malloc.c:1437)
by 0x49023E1: __vasprintf_internal (vasprintf.c:79)
by 0x48D5BD5: asprintf (asprintf.c:31)
by 0x4B41722: cgroup_set_values_recursive (api.c:2414)
by 0x4B4688A: _cgroup_create_cgroup (api.c:2999)
by 0x4B47067: cgroup_create_cgroup (api.c:3062)
by 0x4B47067: cgroup_create_cgroup (api.c:3028)
Fixes: 0e50142a1fe0 ("api.c: Don't fail a recursive write if value isn't dirty") Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Introduce new ignore_rt option for cgrules, that would ignore rules
matching user:process, controller(s), destination cgroup with SCHED_RR
and SCHED_FF policies.
Suggested-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tools/cgset: Fix -R switch indentation in help menu
Fix the indentation of '-R' switch description of cgset help menu.
Before:
-------
$ cgset --help
Usage: cgset [-r <name=value>] <cgroup_path> ...
or: cgset --copy-from <source_cgroup_path> <cgroup_path> ...
Set the parameters of given cgroup(s)
-r, --variable <name> Define parameter to set
--copy-from <source_cgroup_path> Control group whose parameters will be copied
-b Ignore default systemd delegate hierarchy
-R Recursively set variable(s) for cgroups under <cgroup_path>
After:
------
$ cgset --help
Usage: cgset [-r <name=value>] <cgroup_path> ...
or: cgset --copy-from <source_cgroup_path> <cgroup_path> ...
Set the parameters of given cgroup(s)
-r, --variable <name> Define parameter to set
--copy-from <source_cgroup_path> Control group whose parameters will be copied
-b Ignore default systemd delegate hierarchy
-R Recursively set variable(s) for cgroups under <cgroup_path>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
api.c: add support to build procs path for cgroup.thread
In cgroup_build_tid_path(), add support for building path to write
tid into cgroup.thread instead of cgroup.procs, if the calling function
is cgroup_attach_thread_tid() or else build path to write into
cgroup.procs.
Add new parameter bool is_tid to cgroup_get_cg_type(), this parameter
gets set, when called from cgroup_attach_thread_tid() path. When set and
cgroup.type is 'domain threaded', it returns 'cgroup.threads' instead of
'cgroup.procs'.
Rename cgroup_v1_build_procs_path() to cgroup_build_tid_path(), this
function will be used to build a procs path on both cgroup v1/v2 to
which the tid/pid will be written based on the cgroup type. Change
the name to reflect the new functionality.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Starting v6.12 memory code is split into v1 and v2 code, where v1 code
is only compiled when CONFIG_MEMCG_V1 is set. Which defaults to
disabled, teach the test case to ignore such failure.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Starting v6.12 cpuset code is split into v1 and v2 code, where v1 code
is only compiled when CONFIG_CPUSET_V1 is set. Which defaults to
disabled, teach the test case to ignore such failure.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Kamalesh Babulal [Wed, 14 Aug 2024 05:35:59 +0000 (11:05 +0530)]
workflow/ci: Install flake8-quote under pylint job
In the Github workflow continuous integration::flake8-lint job, add
new checks for standardizing Python quotes usage. This will help
maintain the recommended quotes style in all new PR's.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>