Code Monkey home page Code Monkey logo

Comments (7)

fenrus75 avatar fenrus75 commented on September 7, 2024

I did not realize ADL was fully public already.

A cpu where the TSC runs at different rates on different cores is buggy and should be fixed, so clearly there is a Si bug lurking here

from powertop.

yarda avatar yarda commented on September 7, 2024

Thanks for feedback, closing.

from powertop.

yarda avatar yarda commented on September 7, 2024

Reopening. I am able to reproduce this problem on different machines. I validated that the TSC counts the same base freq on all cores. I think the problem is that due to the 'turbo' the APERF can count higher than the TSC. If turbo is disabled on the machines, the C0 residency doesn't go over 100%.

I think the problem is here:

state->duration_delta = ratio * (state->duration_after - state->duration_before) / state->after_count;

Ratio is:
ratio = 1.0 * time_delta / (tsc_after - tsc_before);

I.e.: after simplification we get something like time_delta * aperf_delta/tsc_delta

And here:

sprintf(buffer,"%5.1f%%", percentage(cstates[i]->duration_delta / time_factor));

because time_delta == time_factor we finally get aperf_delta/tsc_delta which can be higher than the 1.0 (100%) with the turbo utilized.

And that's exactly what I am observing if the machines reach turbo freqs under load.

Or am I missing something?

I have constant_tsc which is running at the max core frequency without turbo.

I am not sure how to hack this into the current code, maybe just clamp the C0 residency to the 100%?

from powertop.

yarda avatar yarda commented on September 7, 2024

Clamping to the 100% will probably not work, because the CPU could e.g. spend 50% in the C0 running with the 200% turbo which will result in the report of the 100% C0 residency which is not correct.

from powertop.

yarda avatar yarda commented on September 7, 2024

What about mperf_delta/tsc_delta? Would it help?

from powertop.

Lithopsian avatar Lithopsian commented on September 7, 2024

Being over 100% could be considered "correct" if it is just turbo executing more clock cycles than the nominal 100%. Is your turbo really four times the TSC? Or is your TSC frequency scaling? So an explanation in the documentation might be enough. Or, C0 active percent is obviously 100 minus the sum of the idle percents and forget all the MSR stuff.

from powertop.

yarda avatar yarda commented on September 7, 2024

Yes, in this case it seems the turbo is four times the TSC and the TSC is constant. I was a bit confused because I have seen this very rarely (on very few machines) in the past. I am OK with just documentation of it.

from powertop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.