Re: [dev] [PATCH 2/2] slstatus: determine the number of cpu's in runtime

From: Kurt Van Dijck <>
Date: Sat, 16 Sep 2017 18:59:56 +0200

> Hi Kurt,
> On 09/15/17 14:50, Kurt Van Dijck wrote:
> > This runtime probe is only used when cpu usage is reported relative to 1cpu.
> > The default case reports cpu usage relative to 100%, and not runtime
> > cpu counting is required.
> >
> > Signed-off-by: Kurt Van Dijck <>
> > ---
> Same here. Is this patch based on upstream/master?

You may have noticed that this patch was sent in the thread of a
previous patch, and someone asked why the program doesn't count
the number of cpu's itself.
That's why it is based on the previous patch.

> Why do we need to get the number of cpus in runtime?

To scale the cpu load relative to 1 cpu.

> It's a static value, which in worst case changes after
> a reboot when disabling hyperthreading.

I remember the time when your statement was true.
Now in 2017, I can

        echo 0 > /sys/devices/system/cpu/cpu2/online

> Also, using ncpu for more than one thing (first it's flag, then it's a number) is a really bad idea.

Ack. I shouldn't have done that.

> I don't think this should be merged,
> neither the whole 100% vs per-core thing:
> I think that it gives little to no information,

> and it doesn't seems to play nice with multi-threaded CPUs
> (in a 2:2 setup, does having over 200% means that the cpu is over-the-top?
> Maybe it's the same core, so it can handle more load,
> but maybe not, so, what info did it gave to me?)

in a 2:2 setup, you have 4 cores, so you can reach 400%.
If you disable cpu's like shown above, your setup isn't 2:2 anymore.

IMHO, you expose a lack of expertise here, so I tread your opinion
about the usefullness likewise.

Kind regards,
Received on Sat Sep 16 2017 - 18:59:56 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 16 2017 - 19:12:21 CEST