Skip to content

Conversation

@douglas-raillard-arm
Copy link

@douglas-raillard-arm douglas-raillard-arm commented Feb 8, 2021

Allow passing -1 to sched_setattr() to reset the clamp
fixes #112

Also fixes uclamp updates when the current phase does not specify a policy/priority.
fixes #114

For some (not yet investigated) reasons, this also fixes:
#115

@douglas-raillard-arm
Copy link
Author

Now tested

@douglas-raillard-arm douglas-raillard-arm changed the title uclamp: Allow to pass -1 to sched_setattr() Fix uclamp support Feb 9, 2021
@douglas-raillard-arm douglas-raillard-arm force-pushed the uclamp-reset branch 2 times, most recently from a226977 to d38b9e4 Compare February 9, 2021 14:07
douglas-raillard-arm pushed a commit to douglas-raillard-arm/lisa that referenced this pull request Feb 24, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
douglas-raillard-arm pushed a commit to douglas-raillard-arm/lisa that referenced this pull request Feb 24, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
douglas-raillard-arm pushed a commit to douglas-raillard-arm/lisa that referenced this pull request Feb 24, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
douglas-raillard-arm pushed a commit to douglas-raillard-arm/lisa that referenced this pull request Feb 24, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
douglas-raillard-arm pushed a commit to douglas-raillard-arm/lisa that referenced this pull request Feb 25, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
douglas-raillard-arm pushed a commit to douglas-raillard-arm/lisa that referenced this pull request Feb 25, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
douglas-raillard-arm pushed a commit to douglas-raillard-arm/lisa that referenced this pull request Mar 2, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
douglas-raillard-arm pushed a commit to ARM-software/lisa that referenced this pull request Mar 3, 2021
Since the uclamp support fixes [1] are necessary to use taskgroup and
util clamp in conjunction in rt-app (which is now the default for test
workloads), ensure we get a fixed version while waiting for the review
of the fix.

[1] scheduler-tools/rt-app#113
DouglasRaillard and others added 4 commits December 14, 2023 11:27
cpu_set_t allocated dynamically with CPU_ALLOC need to be manipulated
with CPU_*_S() family of macro, otherwise it will be assumed that the
size is equal to sizeof(cpu_set_t), leading to undefined behaviours.
Since the use of the dynamique API does not bring a greater range of
allowed CPUs in the current state, use the fixed-size API in order to
remove reliance on invalid assumptions about the size of the dynamique
cpu_set_t value.
Detect up to a configurable number of CPUs, independently from what the
libc defaults to.
Free cpuset_str in __shutdown.
Since special value (u32)-1 removes the clamp for the task in the
kernel, free -1 special value from rt-app internals so that the user can
make use of it. Replace it with -2 instead.
Duplicate sched_data for each thread to allow modifying it to keep track
of the current thread sched state.
The struct sched_param passed to sched_setattr() for uclamp needs to
have a valid policy and priority set.

Currently, sched_data->prio is set to a special value
THREAD_PRIORITY_UNCHANGED when the phase does not declare a specific
priority, and sched_data->policy is set to "same". This is problematic
as the kernel expects a valid policy and priority.  We currently pass
the special values to the kernel, which makes the syscall fail.

Fix that by maintaining a valid policy and priority in
thread_data_t->curr_sched_data->{policy,prio} and using it where
appropriate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change in uclamp fails if not accompanied by policy impossible to reset uclamp

2 participants