mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "brookxu.cn" <brookxu.cn@gmail.com>,
	bsingharora@gmail.com, juri.lelli@redhat.com,
	peterz@infradead.org, vincent.guittot@linaro.org
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] delayacct: convert task->delays to a object
Date: Sun, 8 Oct 2023 21:42:02 +0800	[thread overview]
Message-ID: <202310082109.JOBtnIOu-lkp@intel.com> (raw)
In-Reply-To: <531ddc82793a39f4c09316d701a4b1170bcad4ab.1696761522.git.chunguang.xu@shopee.com>

Hi brookxu.cn,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on linus/master v6.6-rc4 next-20231006]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/brookxu-cn/delayacct-introduce-delayacct_enabled-to-simplify-implement/20231008-185144
base:   tip/sched/core
patch link:    https://lore.kernel.org/r/531ddc82793a39f4c09316d701a4b1170bcad4ab.1696761522.git.chunguang.xu%40shopee.com
patch subject: [PATCH 2/3] delayacct: convert task->delays to a object
config: riscv-randconfig-002-20231008 (https://download.01.org/0day-ci/archive/20231008/202310082109.JOBtnIOu-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231008/202310082109.JOBtnIOu-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/202310082109.JOBtnIOu-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/riscv/include/asm/compat.h:12,
                    from arch/riscv/include/asm/pgtable.h:119,
                    from include/linux/pgtable.h:6,
                    from include/linux/kasan.h:33,
                    from include/linux/slab.h:180,
                    from include/linux/delayacct.h:62,
                    from include/linux/sched.h:40,
                    from include/linux/mm.h:28,
                    from arch/riscv/kernel/asm-offsets.c:10:
   include/linux/sched/task_stack.h: In function 'task_stack_page':
>> include/linux/sched/task_stack.h:21:20: error: invalid use of undefined type 'const struct task_struct'
      21 |         return task->stack;
         |                    ^~
   include/linux/sched/task_stack.h: In function 'end_of_stack':
   include/linux/sched/task_stack.h:31:20: error: invalid use of undefined type 'const struct task_struct'
      31 |         return task->stack;
         |                    ^~
   include/linux/sched/task_stack.h: In function 'try_get_task_stack':
>> include/linux/sched/task_stack.h:68:42: error: invalid use of undefined type 'struct task_struct'
      68 |         return refcount_inc_not_zero(&tsk->stack_refcount) ?
         |                                          ^~
   make[3]: *** [scripts/Makefile.build:116: arch/riscv/kernel/asm-offsets.s] Error 1 shuffle=2275994632
   make[3]: Target 'prepare' not remade because of errors.
   make[2]: *** [Makefile:1202: prepare0] Error 2 shuffle=2275994632
   make[2]: Target 'prepare' not remade because of errors.
   make[1]: *** [Makefile:234: __sub-make] Error 2 shuffle=2275994632
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:234: __sub-make] Error 2 shuffle=2275994632
   make: Target 'prepare' not remade because of errors.


vim +21 include/linux/sched/task_stack.h

f3ac60671954c8 Ingo Molnar     2017-02-03  13  
f3ac60671954c8 Ingo Molnar     2017-02-03  14  /*
f3ac60671954c8 Ingo Molnar     2017-02-03  15   * When accessing the stack of a non-current task that might exit, use
f3ac60671954c8 Ingo Molnar     2017-02-03  16   * try_get_task_stack() instead.  task_stack_page will return a pointer
f3ac60671954c8 Ingo Molnar     2017-02-03  17   * that could get freed out from under you.
f3ac60671954c8 Ingo Molnar     2017-02-03  18   */
e87f4152e54261 Borislav Petkov 2022-03-23  19  static __always_inline void *task_stack_page(const struct task_struct *task)
f3ac60671954c8 Ingo Molnar     2017-02-03  20  {
f3ac60671954c8 Ingo Molnar     2017-02-03 @21  	return task->stack;
f3ac60671954c8 Ingo Molnar     2017-02-03  22  }
f3ac60671954c8 Ingo Molnar     2017-02-03  23  
f3ac60671954c8 Ingo Molnar     2017-02-03  24  #define setup_thread_stack(new,old)	do { } while(0)
f3ac60671954c8 Ingo Molnar     2017-02-03  25  
e0b081d17a9f4e Josh Poimboeuf  2023-04-12  26  static __always_inline unsigned long *end_of_stack(const struct task_struct *task)
f3ac60671954c8 Ingo Molnar     2017-02-03  27  {
9cc2fa4f4a92cc Helge Deller    2021-10-05  28  #ifdef CONFIG_STACK_GROWSUP
9cc2fa4f4a92cc Helge Deller    2021-10-05  29  	return (unsigned long *)((unsigned long)task->stack + THREAD_SIZE) - 1;
9cc2fa4f4a92cc Helge Deller    2021-10-05  30  #else
f3ac60671954c8 Ingo Molnar     2017-02-03  31  	return task->stack;
9cc2fa4f4a92cc Helge Deller    2021-10-05  32  #endif
f3ac60671954c8 Ingo Molnar     2017-02-03  33  }
f3ac60671954c8 Ingo Molnar     2017-02-03  34  
f3ac60671954c8 Ingo Molnar     2017-02-03  35  #elif !defined(__HAVE_THREAD_FUNCTIONS)
f3ac60671954c8 Ingo Molnar     2017-02-03  36  
f3ac60671954c8 Ingo Molnar     2017-02-03  37  #define task_stack_page(task)	((void *)(task)->stack)
f3ac60671954c8 Ingo Molnar     2017-02-03  38  
f3ac60671954c8 Ingo Molnar     2017-02-03  39  static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org)
f3ac60671954c8 Ingo Molnar     2017-02-03  40  {
f3ac60671954c8 Ingo Molnar     2017-02-03  41  	*task_thread_info(p) = *task_thread_info(org);
f3ac60671954c8 Ingo Molnar     2017-02-03  42  	task_thread_info(p)->task = p;
f3ac60671954c8 Ingo Molnar     2017-02-03  43  }
f3ac60671954c8 Ingo Molnar     2017-02-03  44  
f3ac60671954c8 Ingo Molnar     2017-02-03  45  /*
f3ac60671954c8 Ingo Molnar     2017-02-03  46   * Return the address of the last usable long on the stack.
f3ac60671954c8 Ingo Molnar     2017-02-03  47   *
f3ac60671954c8 Ingo Molnar     2017-02-03  48   * When the stack grows down, this is just above the thread
f3ac60671954c8 Ingo Molnar     2017-02-03  49   * info struct. Going any lower will corrupt the threadinfo.
f3ac60671954c8 Ingo Molnar     2017-02-03  50   *
f3ac60671954c8 Ingo Molnar     2017-02-03  51   * When the stack grows up, this is the highest address.
f3ac60671954c8 Ingo Molnar     2017-02-03  52   * Beyond that position, we corrupt data on the next page.
f3ac60671954c8 Ingo Molnar     2017-02-03  53   */
f3ac60671954c8 Ingo Molnar     2017-02-03  54  static inline unsigned long *end_of_stack(struct task_struct *p)
f3ac60671954c8 Ingo Molnar     2017-02-03  55  {
f3ac60671954c8 Ingo Molnar     2017-02-03  56  #ifdef CONFIG_STACK_GROWSUP
f3ac60671954c8 Ingo Molnar     2017-02-03  57  	return (unsigned long *)((unsigned long)task_thread_info(p) + THREAD_SIZE) - 1;
f3ac60671954c8 Ingo Molnar     2017-02-03  58  #else
f3ac60671954c8 Ingo Molnar     2017-02-03  59  	return (unsigned long *)(task_thread_info(p) + 1);
f3ac60671954c8 Ingo Molnar     2017-02-03  60  #endif
f3ac60671954c8 Ingo Molnar     2017-02-03  61  }
f3ac60671954c8 Ingo Molnar     2017-02-03  62  
f3ac60671954c8 Ingo Molnar     2017-02-03  63  #endif
f3ac60671954c8 Ingo Molnar     2017-02-03  64  
f3ac60671954c8 Ingo Molnar     2017-02-03  65  #ifdef CONFIG_THREAD_INFO_IN_TASK
f3ac60671954c8 Ingo Molnar     2017-02-03  66  static inline void *try_get_task_stack(struct task_struct *tsk)
f3ac60671954c8 Ingo Molnar     2017-02-03  67  {
f0b89d3958d73c Elena Reshetova 2019-01-18 @68  	return refcount_inc_not_zero(&tsk->stack_refcount) ?
f3ac60671954c8 Ingo Molnar     2017-02-03  69  		task_stack_page(tsk) : NULL;
f3ac60671954c8 Ingo Molnar     2017-02-03  70  }
f3ac60671954c8 Ingo Molnar     2017-02-03  71  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2023-10-08 13:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 10:49 [PATCH 0/3] delayacct: optimization & code simplify brookxu.cn
2023-10-08 10:49 ` [PATCH 1/3] delayacct: introduce delayacct_enabled() to simplify implement brookxu.cn
2023-10-08 10:56   ` Peter Zijlstra
2023-10-08 11:03     ` brookxu
2023-10-08 10:49 ` [PATCH 2/3] delayacct: convert task->delays to a object brookxu.cn
2023-10-08 10:58   ` Peter Zijlstra
2023-10-08 11:10     ` brookxu
2023-10-09  8:43       ` Peter Zijlstra
2023-10-09 10:29         ` brookxu
2023-10-09 14:17           ` Peter Zijlstra
2023-10-09 11:38         ` brookxu
2023-10-09 14:18           ` Peter Zijlstra
2023-10-08 13:42   ` kernel test robot [this message]
2023-10-08 15:47   ` kernel test robot
2023-10-08 16:18   ` kernel test robot
2023-10-08 10:49 ` [PATCH 3/3] delayacct: remove delayacct_on to simplify the code brookxu.cn

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=202310082109.JOBtnIOu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brookxu.cn@gmail.com \
    --cc=bsingharora@gmail.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.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

Powered by JetHome