lkml.org 
[lkml]   [2020]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] sched/uclamp: Fix initialization of strut uclamp_rq
On 06/19/20 19:30, Peter Zijlstra wrote:
> On Thu, Jun 18, 2020 at 08:55:24PM +0100, Qais Yousef wrote:
>
> > + for_each_clamp_id(clamp_id) {
> > + memset(uc_rq[clamp_id].bucket,
> > + 0,
> > + sizeof(struct uclamp_bucket)*UCLAMP_BUCKETS);
> > +
> > + uc_rq[clamp_id].value = uclamp_none(clamp_id);
>
> I think you can replace all that with:
>
> *uc_rq = (struct uclamp_rq){
> .value = uclamp_none(clamp_id),
> };
>
> it's shorter and is free or weird line-breaks :-)

Sure. I just sent v2 so that people will be encouraged to run tests hopefully.
But will fix in v3.

Do we actually need to 0 out anything here? Shouldn't the runqueues all be in
BSS which gets initialized to 0 by default at boot?

Maybe better stay explicit..

Thanks

--
Qais Yousef

\
 
 \ /
  Last update: 2020-06-19 19:40    [W:0.108 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site