lkml.org 
[lkml]   [2019]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v11 1/5] sched/core: uclamp: Extend CPU's cgroup controller
    Hello, Patrick.

    On Mon, Jul 08, 2019 at 09:43:53AM +0100, Patrick Bellasi wrote:
    > +static inline void cpu_uclamp_print(struct seq_file *sf,
    > + enum uclamp_id clamp_id)
    > +{
    > + struct task_group *tg;
    > + u64 util_clamp;
    > + u64 percent;
    > + u32 rem;
    > +
    > + rcu_read_lock();
    > + tg = css_tg(seq_css(sf));
    > + util_clamp = tg->uclamp_req[clamp_id].value;
    > + rcu_read_unlock();
    > +
    > + if (util_clamp == SCHED_CAPACITY_SCALE) {
    > + seq_puts(sf, "max\n");
    > + return;
    > + }
    > +
    > + percent = uclamp_percent_from_scale(util_clamp);
    > + percent = div_u64_rem(percent, 100, &rem);
    > + seq_printf(sf, "%llu.%u\n", percent, rem);

    "%llu.%02u" otherwise 20.01 gets printed as 20.1

    Thanks.

    --
    tejun

    \
     
     \ /
      Last update: 2019-07-18 16:53    [W:4.273 / U:0.764 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site