lkml.org 
[lkml]   [2020]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/1] sched/uclamp: add SCHED_FLAG_UTIL_CLAMP_RESET flag to reset uclamp
On 10/28/20 11:11, Patrick Bellasi wrote:
> >>
> >> /*
> >> * RT by default have a 100% boost value that could be modified
> >> * at runtime.
> >> */
> >> if (unlikely(rt_task(p) && clamp_id == UCLAMP_MIN))
> >> - __uclamp_update_util_min_rt_default(p);
> >> + value = sysctl_sched_uclamp_util_min_rt_default;
>
> By removing this usage of __uclamp_updadate_util_min_rt_default(p),
> the only other usage remaining is the call from:
> uclamp_udpate_util_min_rt_default().
>
> What about an additional cleanup by in-lining the only surviving usage?

This is not a cleanup IMO. There is special rule about updating that are
encoded and documented in this helper function. Namely:

* p->pi_lock must be held.
* p->uclamp_req[].user_defined must be false.

I don't see open coding helps but rather makes the code harder to read and
prone to introduce bugs if anything gets reshuffled in the future.

Thanks

--
Qais Yousef

\
 
 \ /
  Last update: 2020-10-28 23:19    [W:0.073 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site