Re: [PATCH v4 2/2] pid: Remove pidhash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2017-10-11 at 17:47 +0800, kbuild test robot wrote:

> > > '__compiletime_assert_33' declared with attribute error:
> > > BUILD_BUG_ON failed: sizeof(struct upid) != 32
> 
>      _compiletime_assert(condition, msg, __compiletime_assert_,
> __LINE__)
>                                          ^
>    include/linux/compiler.h:556:4: note: in definition of macro
> '__compiletime_assert'
>        prefix ## suffix();    \
>        ^~~~~~
>    include/linux/compiler.h:576:2: note: in expansion of macro
> '_compiletime_assert'
>      _compiletime_assert(condition, msg, __compiletime_assert_,
> __LINE__)
>      ^~~~~~~~~~~~~~~~~~~
>    include/linux/build_bug.h:46:37: note: in expansion of macro
> 'compiletime_assert'
>     #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond),
> msg)
>                                         ^~~~~~~~~~~~~~~~~~
>    include/linux/build_bug.h:70:2: note: in expansion of macro
> 'BUILD_BUG_ON_MSG'
>      BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
>      ^~~~~~~~~~~~~~~~
> > > arch/ia64/kernel/asm-offsets.c:33:2: note: in expansion of macro
> > > 'BUILD_BUG_ON'
> 
>      BUILD_BUG_ON(sizeof(struct upid) != 32);
>      ^~~~~~~~~~~~
> 
Looks like arch/ia64/kernel/asm-offsets.c throws a BUILD_BUG
if sizeof(struct upid) != 32.

Your patch reduced the size of struct upid, which is a nice
thing, but now IA64 no longer builds.

Lets see what IA64 was doing with the size of struct upid
in the first place:

in arch/ia64/kernel/asm-offsets.c:

        BUILD_BUG_ON(sizeof(struct upid) != 32);
        DEFINE(IA64_UPID_SHIFT, 5);

Grepping for IA64_UPID_SHIFT leads us to some assembly
code implementing fsys_getpid (why is that in assembly?!):

        add r8=IA64_PID_LEVEL_OFFSET,r17
        ;;
        ld4 r8=[r8]                             // r8 = pid->level
        add r17=IA64_PID_UPID_OFFSET,r17        // r17 = &pid->numbers[0]
        ;;
        shl r8=r8,IA64_UPID_SHIFT
        ;;
        add r17=r17,r8                          // r17 = &pid->numbers[pid->level]
        ;;
        ld4 r8=[r17]                            // r8 = pid->numbers[pid->level].nr
        ;;
        mov r17=0

Luckily it looks like this is only referencing the first members of struct upid,
and you are removing the last member, so I suspect you will be fine changing the IA64
to this:

        BUILD_BUG_ON(sizeof(struct upid) != 16);
        DEFINE(IA64_UPID_SHIFT, 4);

Tony, does that look ok to you?

-- 
All Rights Reversed.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux