sched-attr: Fix a bug when CPU_BOOSTING_RESET_ON_FORK is set 56/319356/2 accepted/tizen/unified/20250213.151250 accepted/tizen/unified/x/20250218.043745
authorUnsung Lee <unsung.lee@samsung.com>
Sat, 8 Feb 2025 14:24:40 +0000 (23:24 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Wed, 12 Feb 2025 09:00:30 +0000 (18:00 +0900)
commit98620a1e1b00144b2c126e53866331728ffc713a
treeb6860b7bc1aa51fc5c6e0862af2ecc9f80b9bf21
parent397da506168e4b2daaef0f6d51563a645a04e333
sched-attr: Fix a bug when CPU_BOOSTING_RESET_ON_FORK is set

Fix the bug that occurs when the SYS_sched_setattr system call is invoked
while CPU_BOOSTING_FORCE_RESET_ON_FLAG is enabled.
This is because SYS_sched_setattr is different from sched_setscheduler().
sched_setscheduler receives flag argument through policy argument.
On the other hand, policy and flags are separated in SYS_sched_setattr.

sched_setscheduler with CPU_BOOSTING_RESET_ON_FORK:
policy = POLICY | SCHED_RESET_ON_FORK (ORed in policy)

SYS_sched_setattr with CPU_BOOSTING_RESET_ON_FORK:
policy = POLICY
flags |= 0x01 (0x01 is SCHED_FLAG_RESET_ON_FORK)

Change-Id: I96356357e6399c2377244b0f95fe36406a936f3d
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/common/sched-attr.c