linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	Christian Brauner <brauner@kernel.org>
Subject: Re: [akpm-mm:mm-unstable 125/221] include/linux/compiler.h:166:45: warning: unused variable '__UNIQUE_ID_guard255'
Date: Tue, 26 Aug 2025 12:07:10 +0100	[thread overview]
Message-ID: <247eb488-87a0-4d0f-ae1a-b2d8304dff65@lucifer.local> (raw)
In-Reply-To: <202508240502.frw1Krzo-lkp@intel.com>

On Sun, Aug 24, 2025 at 05:32:49AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
> head:   3c3393d4b766eebdc475ea5bd6bbd3a221e2526e
> commit: 98a7f4a3d2b1655e323e6943cf0203d0bd5a64eb [125/221] mm: update coredump logic to correctly use bitmap mm flags
> config: arc-randconfig-r071-20250824 (https://download.01.org/0day-ci/archive/20250824/202508240502.frw1Krzo-lkp@intel.com/config)

Sigh, another 'special' arch (+ config options) causing issues with core changes...

I'm guessing it's having problems, somehow (???) with importing compiler_types.h
which is just... yeah. This is for ACCESS_PRIVATE().

Will try to come up wtih a solution just to suit arc with some horrid config
then I guess :/

Given the issue clearly has to be (although it's bizarre) the including of
linux/compiler_types.h, let's move __mm_flags_set_mask_dumpable() to
include/linux/mm.h (even though it sucks to really).

Will send a fix-patch in the series...

> compiler: arc-linux-gcc (GCC) 9.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250824/202508240502.frw1Krzo-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202508240502.frw1Krzo-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
>    include/linux/sched/task.h: At top level:
>    include/linux/sched/task.h:99:41: warning: 'struct pid' declared inside parameter list will not be visible outside of this definition or declaration
>       99 | struct task_struct *copy_process(struct pid *pid, int trace, int node,
>          |                                         ^~~
>    include/linux/sched/task.h: In function 'arch_thread_struct_whitelist':
>    include/linux/sched/task.h:178:40: error: invalid application of 'sizeof' to incomplete type 'struct task_struct'
>      178 | # define arch_task_struct_size (sizeof(struct task_struct))
>          |                                        ^~~~~~
>    include/linux/sched/task.h:191:10: note: in expansion of macro 'arch_task_struct_size'
>      191 |  *size = arch_task_struct_size - offsetof(struct task_struct, thread);
>          |          ^~~~~~~~~~~~~~~~~~~~~

OK so somehow before there was some... alternative offsetof defined?... Because
this is just weird.

It's not really digging into exactly why this is triggering I don't think given
I can avoid the include that causes it.

>    In file included from include/uapi/linux/posix_types.h:5,
>                     from include/uapi/linux/types.h:14,
>                     from include/linux/types.h:6,
>                     from include/uapi/linux/sched.h:5,
>                     from include/linux/sched.h:10,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/stddef.h:16:32: error: invalid use of undefined type 'struct task_struct'
>       16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
>          |                                ^~~~~~~~~~~~~~~~~~
>    include/linux/sched/task.h:191:34: note: in expansion of macro 'offsetof'
>      191 |  *size = arch_task_struct_size - offsetof(struct task_struct, thread);
>          |                                  ^~~~~~~~
>    In file included from include/linux/sched/user.h:9,
>                     from include/linux/cred.h:18,
>                     from include/linux/sched/signal.h:10,
>                     from include/linux/rcuwait.h:6,
>                     from include/linux/mm.h:36,
>                     from arch/arc/include/asm/arcregs.h:149,
>                     from arch/arc/include/asm/irqflags-compact.h:16,
>                     from arch/arc/include/asm/irqflags.h:11,
>                     from include/linux/irqflags.h:18,
>                     from include/linux/spinlock.h:59,
>                     from include/linux/sched.h:37,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/ratelimit.h: In function 'ratelimit_state_init':
>    include/linux/ratelimit.h:14:2: error: implicit declaration of function 'raw_spin_lock_init' [-Werror=implicit-function-declaration]
>       14 |  raw_spin_lock_init(&rs->lock);
>          |  ^~~~~~~~~~~~~~~~~~
>    include/linux/ratelimit.h: In function 'ratelimit_state_reset_interval':
>    include/linux/ratelimit.h:44:2: error: implicit declaration of function 'raw_spin_lock_irqsave'; did you mean 'read_seqbegin_or_lock_irqsave'? [-Werror=implicit-function-declaration]
>       44 |  raw_spin_lock_irqsave(&rs->lock, flags);
>          |  ^~~~~~~~~~~~~~~~~~~~~
>          |  read_seqbegin_or_lock_irqsave
>    include/linux/ratelimit.h:49:2: error: implicit declaration of function 'raw_spin_unlock_irqrestore'; did you mean 'write_sequnlock_irqrestore'? [-Werror=implicit-function-declaration]
>       49 |  raw_spin_unlock_irqrestore(&rs->lock, flags);
>          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~
>          |  write_sequnlock_irqrestore
>    In file included from include/linux/sched/signal.h:12,
>                     from include/linux/rcuwait.h:6,
>                     from include/linux/mm.h:36,
>                     from arch/arc/include/asm/arcregs.h:149,
>                     from arch/arc/include/asm/irqflags-compact.h:16,
>                     from arch/arc/include/asm/irqflags.h:11,
>                     from include/linux/irqflags.h:18,
>                     from include/linux/spinlock.h:59,
>                     from include/linux/sched.h:37,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/pid.h: In function 'pid_alive':
>    include/linux/pid.h:267:10: error: dereferencing pointer to incomplete type 'const struct task_struct'
>      267 |  return p->thread_pid != NULL;
>          |          ^~
>    In file included from include/linux/preempt.h:11,
>                     from include/linux/sched.h:15,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/hrtimer.h: In function 'hrtimer_update_function':
>    include/linux/cleanup.h:290:2: error: unknown type name 'class_raw_spinlock_irqsave_t'; did you mean 'class_local_lock_irqsave_t'?
>      290 |  class_##_name##_t var __cleanup(class_##_name##_destructor) = \
>          |  ^~~~~~
>    include/linux/cleanup.h:401:2: note: in expansion of macro 'CLASS'
>      401 |  CLASS(_name, __UNIQUE_ID(guard))
>          |  ^~~~~
>    include/linux/hrtimer.h:340:2: note: in expansion of macro 'guard'
>      340 |  guard(raw_spinlock_irqsave)(&timer->base->cpu_base->lock);
>          |  ^~~~~
>    In file included from include/linux/alarmtimer.h:6,
>                     from include/linux/posix-timers.h:5,
>                     from include/linux/sched/signal.h:13,
>                     from include/linux/rcuwait.h:6,
>                     from include/linux/mm.h:36,
>                     from arch/arc/include/asm/arcregs.h:149,
>                     from arch/arc/include/asm/irqflags-compact.h:16,
>                     from arch/arc/include/asm/irqflags.h:11,
>                     from include/linux/irqflags.h:18,
>                     from include/linux/spinlock.h:59,
>                     from include/linux/sched.h:37,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/hrtimer.h:340:2: error: cleanup argument not a function
>    In file included from include/linux/preempt.h:11,
>                     from include/linux/sched.h:15,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/cleanup.h:291:3: error: implicit declaration of function 'class_raw_spinlock_irqsave_constructor'; did you mean 'class_local_lock_irqsave_constructor'? [-Werror=implicit-function-declaration]
>      291 |   class_##_name##_constructor
>          |   ^~~~~~
>    include/linux/cleanup.h:401:2: note: in expansion of macro 'CLASS'
>      401 |  CLASS(_name, __UNIQUE_ID(guard))
>          |  ^~~~~
>    include/linux/hrtimer.h:340:2: note: in expansion of macro 'guard'
>      340 |  guard(raw_spinlock_irqsave)(&timer->base->cpu_base->lock);
>          |  ^~~~~
> >> include/linux/compiler.h:166:45: warning: unused variable '__UNIQUE_ID_guard255' [-Wunused-variable]
>      166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
>          |                                             ^~~~~~~~~~~~
>    include/linux/cleanup.h:290:20: note: in definition of macro 'CLASS'
>      290 |  class_##_name##_t var __cleanup(class_##_name##_destructor) = \
>          |                    ^~~
>    include/linux/compiler_types.h:84:22: note: in expansion of macro '___PASTE'
>       84 | #define __PASTE(a,b) ___PASTE(a,b)
>          |                      ^~~~~~~~
>    include/linux/compiler.h:166:29: note: in expansion of macro '__PASTE'
>      166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
>          |                             ^~~~~~~
>    include/linux/compiler_types.h:84:22: note: in expansion of macro '___PASTE'
>       84 | #define __PASTE(a,b) ___PASTE(a,b)
>          |                      ^~~~~~~~
>    include/linux/compiler.h:166:37: note: in expansion of macro '__PASTE'
>      166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
>          |                                     ^~~~~~~
>    include/linux/cleanup.h:401:15: note: in expansion of macro '__UNIQUE_ID'
>      401 |  CLASS(_name, __UNIQUE_ID(guard))
>          |               ^~~~~~~~~~~
>    include/linux/hrtimer.h:340:2: note: in expansion of macro 'guard'
>      340 |  guard(raw_spinlock_irqsave)(&timer->base->cpu_base->lock);
>          |  ^~~~~
>    In file included from include/linux/rbtree.h:24,
>                     from include/linux/mm_types.h:11,
>                     from include/linux/mmzone.h:22,
>                     from include/linux/gfp.h:7,
>                     from include/linux/mm.h:7,
>                     from arch/arc/include/asm/arcregs.h:149,
>                     from arch/arc/include/asm/irqflags-compact.h:16,
>                     from arch/arc/include/asm/irqflags.h:11,
>                     from include/linux/irqflags.h:18,
>                     from include/linux/spinlock.h:59,
>                     from include/linux/sched.h:37,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/rcuref.h: In function '__rcuref_put':
>    include/linux/preempt.h:227:49: error: implicit declaration of function 'irqs_disabled' [-Werror=implicit-function-declaration]
>      227 | #define preemptible() (preempt_count() == 0 && !irqs_disabled())
>          |                                                 ^~~~~~~~~~~~~
>    include/linux/rcupdate.h:399:39: note: in definition of macro 'RCU_LOCKDEP_WARN'
>      399 |   if (debug_lockdep_rcu_enabled() && (c) &&  \
>          |                                       ^
>    include/linux/rcuref.h:103:44: note: in expansion of macro 'preemptible'
>      103 |  RCU_LOCKDEP_WARN(!rcu_read_lock_held() && preemptible(),
>          |                                            ^~~~~~~~~~~
>    In file included from include/linux/rcuwait.h:6,
>                     from include/linux/mm.h:36,
>                     from arch/arc/include/asm/arcregs.h:149,
>                     from arch/arc/include/asm/irqflags-compact.h:16,
>                     from arch/arc/include/asm/irqflags.h:11,
>                     from include/linux/irqflags.h:18,
>                     from include/linux/spinlock.h:59,
>                     from include/linux/sched.h:37,
>                     from arch/arc/kernel/asm-offsets.c:6:
>    include/linux/sched/signal.h: At top level:
>    include/linux/sched/signal.h:192:22: error: field 'prev_cputime' has incomplete type
>      192 |  struct prev_cputime prev_cputime;
>          |                      ^~~~~~~~~~~~
>    include/linux/sched/signal.h:197:28: error: field 'ioac' has incomplete type
>      197 |  struct task_io_accounting ioac;
>          |                            ^~~~
>    include/linux/sched/signal.h: In function 'kernel_signal_stop':
>    include/linux/sched/signal.h:302:3: error: implicit declaration of function 'set_special_state' [-Werror=implicit-function-declaration]
>      302 |   set_special_state(TASK_STOPPED);
>          |   ^~~~~~~~~~~~~~~~~
>    include/linux/sched/signal.h:302:21: error: 'TASK_STOPPED' undeclared (first use in this function); did you mean 'CLD_STOPPED'?
>      302 |   set_special_state(TASK_STOPPED);
>          |                     ^~~~~~~~~~~~
>          |                     CLD_STOPPED
>    include/linux/sched/signal.h:306:2: error: implicit declaration of function 'schedule'; did you mean 'sched_exec'? [-Werror=implicit-function-declaration]
>      306 |  schedule();
>          |  ^~~~~~~~
>          |  sched_exec
>    include/linux/sched/signal.h: In function '__set_notify_signal':
>    include/linux/sched/signal.h:357:10: error: implicit declaration of function 'test_and_set_tsk_thread_flag'; did you mean 'test_and_set_ti_thread_flag'? [-Werror=implicit-function-declaration]
>      357 |  return !test_and_set_tsk_thread_flag(task, TIF_NOTIFY_SIGNAL) &&
>          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>          |          test_and_set_ti_thread_flag
>    include/linux/sched/signal.h:358:10: error: implicit declaration of function 'wake_up_state'; did you mean 'wake_up_sync'? [-Werror=implicit-function-declaration]
>      358 |         !wake_up_state(task, TASK_INTERRUPTIBLE);
>          |          ^~~~~~~~~~~~~
>          |          wake_up_sync
>    include/linux/sched/signal.h:358:30: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function); did you mean 'FOLL_INTERRUPTIBLE'?
>      358 |         !wake_up_state(task, TASK_INTERRUPTIBLE);
>          |                              ^~~~~~~~~~~~~~~~~~
>          |                              FOLL_INTERRUPTIBLE
>    include/linux/sched/signal.h: In function 'set_notify_signal':
>    include/linux/sched/signal.h:368:3: error: implicit declaration of function 'kick_process'; did you mean 'copy_process'? [-Werror=implicit-function-declaration]
>      368 |   kick_process(task);
>          |   ^~~~~~~~~~~~
>          |   copy_process
>    include/linux/sched/signal.h: In function 'restart_syscall':
>    include/linux/sched/signal.h:373:2: error: implicit declaration of function 'set_tsk_thread_flag'; did you mean 'set_ti_thread_flag'? [-Werror=implicit-function-declaration]
>      373 |  set_tsk_thread_flag(current, TIF_SIGPENDING);
>          |  ^~~~~~~~~~~~~~~~~~~
>          |  set_ti_thread_flag
>    In file included from arch/arc/include/asm/ptrace.h:11,
>                     from arch/arc/include/asm/processor.h:16,
>                     from include/linux/sched.h:13,
>                     from arch/arc/kernel/asm-offsets.c:6:
>
>
> vim +/__UNIQUE_ID_guard255 +166 include/linux/compiler.h
>
> fe8c8a126806fe Cesar Eduardo Barros 2013-11-25  165
> a8306f2d4dcea0 Nick Desaulniers     2023-08-31 @166  #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
> 6f33d58794ef4c Rusty Russell        2012-11-22  167
>
> :::::: The code at line 166 was first introduced by commit
> :::::: a8306f2d4dcea03538c70c26d2948483f70254ff compiler.h: unify __UNIQUE_ID
>
> :::::: TO: Nick Desaulniers <ndesaulniers@google.com>
> :::::: CC: Andrew Morton <akpm@linux-foundation.org>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki


      reply	other threads:[~2025-08-26 11:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-23 21:32 kernel test robot
2025-08-26 11:07 ` Lorenzo Stoakes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=247eb488-87a0-4d0f-ae1a-b2d8304dff65@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox