All of lore.kernel.org
 help / color / mirror / Atom feed
* [mingo-tip:sched/headers 168/2384] include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
@ 2022-01-17  3:40 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-01-17  3:40 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: llvm, kbuild-all, linux-kernel

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head:   4c707c1c0de83967079b4e385012fa5b00e2cd11
commit: 92675dd8b872d91539f60f7dc7ddf7e2a1c70361 [168/2384] headers/deps: Move CPU affinity APIs from <linux/sched.h> to <linux/sched/affinity.h>
config: i386-randconfig-a014-20220109 (https://download.01.org/0day-ci/archive/20220117/202201171113.5k8tKBGY-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=92675dd8b872d91539f60f7dc7ddf7e2a1c70361
        git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
        git fetch --no-tags mingo-tip sched/headers
        git checkout 92675dd8b872d91539f60f7dc7ddf7e2a1c70361
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

Note: the mingo-tip/sched/headers HEAD 4c707c1c0de83967079b4e385012fa5b00e2cd11 builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

   In file included from lib/syscall.c:2:
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                               ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   include/linux/sched/affinity.h:38:11: error: incomplete definition of type 'struct task_struct'
           WARN_ON(p->user_cpus_ptr);
                   ~^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   4 errors generated.
--
>> kernel/sched/core.c:3571:9: error: implicit declaration of function 'set_cpus_allowed_ptr' [-Werror,-Wimplicit-function-declaration]
           return set_cpus_allowed_ptr(p, new_mask);
                  ^
   kernel/sched/core.c:3571:9: note: did you mean '__set_cpus_allowed_ptr'?
   kernel/sched/core.c:3567:19: note: '__set_cpus_allowed_ptr' declared here
   static inline int __set_cpus_allowed_ptr(struct task_struct *p,
                     ^
>> kernel/sched/core.c:8017:11: error: implicit declaration of function 'dl_task_check_affinity' [-Werror,-Wimplicit-function-declaration]
           retval = dl_task_check_affinity(p, new_mask);
                    ^
   kernel/sched/core.c:9369:13: warning: no previous prototype for function 'per_task_init' [-Wmissing-prototypes]
   void __init per_task_init(void)
               ^
   kernel/sched/core.c:9369:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void __init per_task_init(void)
   ^
   static 
   1 warning and 2 errors generated.
--
   In file included from arch/x86/kernel/cpu/resctrl/pseudo_lock.c:14:
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                               ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   include/linux/sched/affinity.h:38:11: error: incomplete definition of type 'struct task_struct'
           WARN_ON(p->user_cpus_ptr);
                   ~^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   In file included from arch/x86/kernel/cpu/resctrl/pseudo_lock.c:20:
   include/linux/mman.h:158:9: warning: division by zero is undefined [-Wdivision-by-zero]
                  _calc_vm_trans(flags, MAP_SYNC,       VM_SYNC      ) |
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:136:21: note: expanded from macro '_calc_vm_trans'
      : ((x) & (bit1)) / ((bit1) / (bit2))))
                       ^ ~~~~~~~~~~~~~~~~~
   1 warning and 4 errors generated.


vim +32 include/linux/sched/affinity.h

     9	
    10	extern int cpuset_cpumask_can_shrink(const struct cpumask *cur, const struct cpumask *trial);
    11	extern int task_can_attach(struct task_struct *p, const struct cpumask *cs_cpus_allowed);
    12	#ifdef CONFIG_SMP
    13	extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask);
    14	extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask);
    15	extern int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node);
    16	extern void release_user_cpus_ptr(struct task_struct *p);
    17	extern int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask);
    18	extern void force_compatible_cpus_allowed_ptr(struct task_struct *p);
    19	extern void relax_compatible_cpus_allowed_ptr(struct task_struct *p);
    20	#else
    21	static inline void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
    22	{
    23	}
    24	static inline int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
    25	{
    26		if (!cpumask_test_cpu(0, new_mask))
    27			return -EINVAL;
    28		return 0;
    29	}
    30	static inline int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node)
    31	{
  > 32		if (src->user_cpus_ptr)
    33			return -EINVAL;
    34		return 0;
    35	}
    36	static inline void release_user_cpus_ptr(struct task_struct *p)
    37	{
    38		WARN_ON(p->user_cpus_ptr);
    39	}
    40	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [mingo-tip:sched/headers 168/2384] include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
@ 2022-01-17  3:40 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-01-17  3:40 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 10619 bytes --]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head:   4c707c1c0de83967079b4e385012fa5b00e2cd11
commit: 92675dd8b872d91539f60f7dc7ddf7e2a1c70361 [168/2384] headers/deps: Move CPU affinity APIs from <linux/sched.h> to <linux/sched/affinity.h>
config: i386-randconfig-a014-20220109 (https://download.01.org/0day-ci/archive/20220117/202201171113.5k8tKBGY-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=92675dd8b872d91539f60f7dc7ddf7e2a1c70361
        git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
        git fetch --no-tags mingo-tip sched/headers
        git checkout 92675dd8b872d91539f60f7dc7ddf7e2a1c70361
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

Note: the mingo-tip/sched/headers HEAD 4c707c1c0de83967079b4e385012fa5b00e2cd11 builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

   In file included from lib/syscall.c:2:
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                               ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   include/linux/sched/affinity.h:38:11: error: incomplete definition of type 'struct task_struct'
           WARN_ON(p->user_cpus_ptr);
                   ~^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   4 errors generated.
--
>> kernel/sched/core.c:3571:9: error: implicit declaration of function 'set_cpus_allowed_ptr' [-Werror,-Wimplicit-function-declaration]
           return set_cpus_allowed_ptr(p, new_mask);
                  ^
   kernel/sched/core.c:3571:9: note: did you mean '__set_cpus_allowed_ptr'?
   kernel/sched/core.c:3567:19: note: '__set_cpus_allowed_ptr' declared here
   static inline int __set_cpus_allowed_ptr(struct task_struct *p,
                     ^
>> kernel/sched/core.c:8017:11: error: implicit declaration of function 'dl_task_check_affinity' [-Werror,-Wimplicit-function-declaration]
           retval = dl_task_check_affinity(p, new_mask);
                    ^
   kernel/sched/core.c:9369:13: warning: no previous prototype for function 'per_task_init' [-Wmissing-prototypes]
   void __init per_task_init(void)
               ^
   kernel/sched/core.c:9369:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void __init per_task_init(void)
   ^
   static 
   1 warning and 2 errors generated.
--
   In file included from arch/x86/kernel/cpu/resctrl/pseudo_lock.c:14:
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                               ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
>> include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct'
           if (src->user_cpus_ptr)
               ~~~^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   include/linux/sched/affinity.h:38:11: error: incomplete definition of type 'struct task_struct'
           WARN_ON(p->user_cpus_ptr);
                   ~^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/linux/sched/affinity.h:8:8: note: forward declaration of 'struct task_struct'
   struct task_struct;
          ^
   In file included from arch/x86/kernel/cpu/resctrl/pseudo_lock.c:20:
   include/linux/mman.h:158:9: warning: division by zero is undefined [-Wdivision-by-zero]
                  _calc_vm_trans(flags, MAP_SYNC,       VM_SYNC      ) |
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:136:21: note: expanded from macro '_calc_vm_trans'
      : ((x) & (bit1)) / ((bit1) / (bit2))))
                       ^ ~~~~~~~~~~~~~~~~~
   1 warning and 4 errors generated.


vim +32 include/linux/sched/affinity.h

     9	
    10	extern int cpuset_cpumask_can_shrink(const struct cpumask *cur, const struct cpumask *trial);
    11	extern int task_can_attach(struct task_struct *p, const struct cpumask *cs_cpus_allowed);
    12	#ifdef CONFIG_SMP
    13	extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask);
    14	extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask);
    15	extern int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node);
    16	extern void release_user_cpus_ptr(struct task_struct *p);
    17	extern int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask);
    18	extern void force_compatible_cpus_allowed_ptr(struct task_struct *p);
    19	extern void relax_compatible_cpus_allowed_ptr(struct task_struct *p);
    20	#else
    21	static inline void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
    22	{
    23	}
    24	static inline int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
    25	{
    26		if (!cpumask_test_cpu(0, new_mask))
    27			return -EINVAL;
    28		return 0;
    29	}
    30	static inline int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node)
    31	{
  > 32		if (src->user_cpus_ptr)
    33			return -EINVAL;
    34		return 0;
    35	}
    36	static inline void release_user_cpus_ptr(struct task_struct *p)
    37	{
    38		WARN_ON(p->user_cpus_ptr);
    39	}
    40	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-17  3:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17  3:40 [mingo-tip:sched/headers 168/2384] include/linux/sched/affinity.h:32:9: error: incomplete definition of type 'struct task_struct' kernel test robot
2022-01-17  3:40 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.