Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334318

Re: [PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING

From Christophe Leroy <christophe.leroy@c-s.fr>
Newsgroups linux.kernel
Subject Re: [PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING
Date 2016-02-15 10:40 +0100
Message-ID <r2nNn-7tb-7@gated-at.bofh.it> (permalink)
References <r128j-2LZ-35@gated-at.bofh.it> <r2bMe-7Rl-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Le 14/02/2016 21:40, Denis Kirjanov a écrit :
> On 2/11/16, Christophe Leroy <christophe.leroy@c-s.fr> wrote:
>> This patch provides VIRT_CPU_ACCOUTING to PPC32 architecture.
>> PPC32 doesn't have the PACA structure, so we use the task_info
>> structure to store the accounting data.
>>
>> In order to reuse on PPC32 the PPC64 functions, all u64 data has
>> been replaced by 'unsigned long' so that it is u32 on PPC32 and
>> u64 on PPC64
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Doesn't build for me with the patch applied
>
> To see full details build your kernel with:
> 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
>    GEN     .version
>    CHK     include/generated/compile.h
>    UPD     include/generated/compile.h
>    CC      init/version.o
>    LD      init/built-in.o
> drivers/built-in.o: In function `get_cpu_idle_time':
> (.text+0x1261c4): undefined reference to `__umoddi3'
> drivers/built-in.o: In function `get_cpu_idle_time':
> (.text+0x1261e0): undefined reference to `__udivdi3'
> Makefile:936: recipe for target 'vmlinux' failed
> make: *** [vmlinux] Error 1
>
>
Looks like you have CONFIG_CPU_FREQ, which I don't have.

The issue comes from the jiffies64_to_cputime64() defined in 
arch/powerpc/include/asm/cputime.h :

static inline cputime64_t jiffies64_to_cputime64(const u64 jif)
{
         u64 ct;
         u64 sec;

         /* have to be a little careful about overflow */
         ct = jif % HZ;
         sec = jif / HZ;



On 32 bits, 64 bits % and / require __udivdi3() and __umoddi3(), which 
are not implemented in the kernel.

As HZ fits in 32 bits, the solution is to use do_div(). I should not 
change anything on PPC64 and would solve your issue.
I will submit an update of the patch within an hour.

Christophe

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING Christophe Leroy <christophe.leroy@c-s.fr> - 2016-02-11 17:20 +0100
  Re: [PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING Denis Kirjanov <kda@linux-powerpc.org> - 2016-02-12 09:30 +0100
  Re: [PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING Denis Kirjanov <kda@linux-powerpc.org> - 2016-02-14 21:50 +0100
    Re: [PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING Christophe Leroy <christophe.leroy@c-s.fr> - 2016-02-15 10:40 +0100
  Re: [PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING Scott Wood <oss@buserror.net> - 2016-02-16 22:30 +0100
    Re: [PATCH v5] powerpc32: provide VIRT_CPU_ACCOUNTING Christophe Leroy <christophe.leroy@c-s.fr> - 2016-02-17 17:30 +0100

csiph-web