odp_cpu_hz_max() returns the cached max freq
and odp_cpu_hz(), as noted, returns the current freq which may change,
and this implementation does parse each time
so there should be no problem of this part.

On 1 January 2016 at 10:26, Hongbo Zhang <[email protected]> wrote:
> yes, max freq is cached(in legacy variable cpu_hz, maybe renaming it to
> cpu_hz_mx is better), and current freq isn't.
>
>
> On Tuesday, 29 December 2015, Maxim Uvarov <[email protected]> wrote:
>>
>> On 12/29/2015 16:43, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>>>
>>> There are also those max freq API calls. Maybe it's just for diagnostics
>>> or logging purposes, but it's valuable information if the system you are
>>> running on is setup for maximum frequency, or if it's scaling the frequency.
>>>
>>> These are exactly the figures I'd want to see (sampled) in my log.
>>>
>>> -Petri
>>
>> Ok, that case in implementation that calls should parse files each time.
>> Not cache them in sysinfo struct.
>>
>> Maxim.
>>
>>>
>>>> -----Original Message-----
>>>> From: lng-odp [mailto:[email protected]] On Behalf Of EXT
>>>> Maxim Uvarov
>>>> Sent: Tuesday, December 29, 2015 3:13 PM
>>>> To: [email protected]
>>>> Subject: Re: [lng-odp] [PATCH v3 API-NEXT 00/11] Separate CPU info codes
>>>> into their platform files
>>>>
>>>> so what is  summary for that api?
>>>>
>>>> odp_cpu_hz_current()
>>>> odp_cpu_hz()
>>>>
>>>> very unstable on platforms like my x86 laptop. Example:
>>>>
>>>> cat /proc/cpuinfo  |grep "cpu MHz"
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 2501.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>>
>>>> cat /proc/cpuinfo  |grep "cpu MHz"
>>>> cpu MHz        : 2501.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 800.000
>>>> cpu MHz        : 1500.000
>>>>
>>>> And each time there are different values. On busy loop it can go to top
>>>> 3Ghz speed and later
>>>> lower frequency due to overheating.
>>>>
>>>> As I understand from current patches is api call just parses cpuinfo.
>>>> That might be not enough
>>>> due to it's not clear how to use that values.
>>>>
>>>> Maxim.
>>>>
>>>>
>>>> On 12/29/2015 13:31, [email protected] wrote:
>>>>>
>>>>> From: Hongbo Zhang <[email protected]>
>>>>>
>>>>> v2->v3 changes:
>>>>> use "api: cpu:" tag in patch 8/11 title instead of "linux-generic:
>>>>
>>>> sysinfo"
>>>>>
>>>>> v1->v2 changes:
>>>>>    - don't create arch/arm/ since there isn't implementation now, use
>>>>
>>>> arch/linux
>>>>>
>>>>> as default choice
>>>>>    - create symlink to arch/linux/odp_cpu_cycles.c for powerpc, if
>>>>> absent
>>>>
>>>> this
>>>>>
>>>>> arch cannot be compiled
>>>>>    - add some clean-ups patches 8~11, these patches are against the
>>>>
>>>> previous ones
>>>>>
>>>>> so send them together for better review and merge.
>>>>>
>>>>> v1 notes:
>>>>> This patch set separates the CPU info codes into their own platform
>>>>
>>>> sepcific
>>>>>
>>>>> files.
>>>>> It is common sence that the top general layer call an uniform interface
>>>>
>>>> to
>>>>>
>>>>> initialize some plarform specific data structures, and this uniform
>>>>
>>>> interface
>>>>>
>>>>> is implemented in their own platform specific files.
>>>>> This patch set makes it.
>>>>>
>>>>> Hongbo Zhang (11):
>>>>>     linux-generic: sysinfo: move cpu_arch_str to odp_system_info_t
>>>>>     linux-generic: sysinfo: use uniform call odp_sysinfo_parser
>>>>>     linux-generic: sysinfo: rename odp_cpu_hz_current with odp_ prefix
>>>>>     linux-generic: sysinfo: move x86 system info codes to its plarform
>>>>>       file
>>>>>     linux-generic: sysinfo: move MIPS system info codes to its plarform
>>>>>       file
>>>>>     linux-generic: sysinfo: move ARM system info codes to default arch
>>>>>       file
>>>>>     linux-generic: sysinfo: move PowerPC system info codes to its
>>>>
>>>> plarform
>>>>>
>>>>>       file
>>>>>     api: cpu: make frequency API return 0 on failure
>>>>>     linux-generic: sysinfo: set values for cpu_arch_str
>>>>>     linux-generic: sysinfo: apply per-CPU implementation to MIPS
>>>>>     linux-generic: sysinfo: apply per-CPU implementation to PowerPC
>>>>>
>>>>>    configure.ac                                       |   1 +
>>>>>    include/odp/api/cpu.h                              |   4 +
>>>>>    platform/linux-generic/Makefile.am                 |  10 +-
>>>>>    .../linux-generic/arch/linux/odp_sysinfo_parse.c   |  20 ++
>>>>>    .../linux-generic/arch/mips64/odp_sysinfo_parse.c  |  63 ++++++
>>>>>    .../linux-generic/arch/powerpc/odp_cpu_cycles.c    |   1 +
>>>>>    .../linux-generic/arch/powerpc/odp_sysinfo_parse.c |  63 ++++++
>>>>>    .../linux-generic/arch/x86/odp_sysinfo_parse.c     |  72 +++++++
>>>>>    platform/linux-generic/include/odp_cpu_internal.h  |   4 +
>>>>>    platform/linux-generic/include/odp_internal.h      |   1 +
>>>>>    platform/linux-generic/odp_system_info.c           | 217
>>>>> +------------
>>>>
>>>> --------
>>>>>
>>>>>    11 files changed, 242 insertions(+), 214 deletions(-)
>>>>>    create mode 100644 platform/linux-
>>>>
>>>> generic/arch/linux/odp_sysinfo_parse.c
>>>>>
>>>>>    create mode 100644 platform/linux-
>>>>
>>>> generic/arch/mips64/odp_sysinfo_parse.c
>>>>>
>>>>>    create mode 120000 platform/linux-
>>>>
>>>> generic/arch/powerpc/odp_cpu_cycles.c
>>>>>
>>>>>    create mode 100644 platform/linux-
>>>>
>>>> generic/arch/powerpc/odp_sysinfo_parse.c
>>>>>
>>>>>    create mode 100644
>>>>> platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>>>>
>>>> _______________________________________________
>>>> lng-odp mailing list
>>>> [email protected]
>>>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> [email protected]
>> https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to