Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uclamp support #113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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 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
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