tree:
https://github.com/zen-kernel/zen-kernel 5.15/prjc
head: 88afbbeeefd1e9ceca6efea72562fca5fc546daf
commit: d9b7f3286c71166d00ccfcb64f13c1147210e865 [197/239] sched/alt: [Sync] b03fbd4ff24c
sched: Introduce task_is_running()
config: i386-randconfig-a003-20211118 (attached as .config)
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://github.com/zen-kernel/zen-kernel/commit/d9b7f3286c71166d00ccfcb64...
git remote add zen
https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen 5.15/prjc
git checkout d9b7f3286c71166d00ccfcb64f13c1147210e865
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
kernel/sched/alt_core.c:830:6: warning: no previous prototype for function
'resched_curr' [-Wmissing-prototypes]
void resched_curr(struct rq *rq)
^
kernel/sched/alt_core.c:830:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
void resched_curr(struct rq *rq)
^
static
kernel/sched/alt_core.c:853:6: warning: no previous prototype for function
'resched_cpu' [-Wmissing-prototypes]
void resched_cpu(int cpu)
^
kernel/sched/alt_core.c:853:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
void resched_cpu(int cpu)
^
static
kernel/sched/alt_core.c:1940:5: error: no member named 'state' in 'struct
task_struct'
p->state = TASK_RUNNING;
~ ^
kernel/sched/alt_core.c:2305:12: error: no member named 'state' in 'struct
task_struct'
if (!(p->state & state))
~ ^
kernel/sched/alt_core.c:2310:6: error: no member named 'state' in 'struct
task_struct'
p->state = TASK_RUNNING;
~ ^
kernel/sched/alt_core.c:2323:11: error: no member named 'state' in 'struct
task_struct'
if (!(p->state & state))
~ ^
kernel/sched/alt_core.c:2485:14: error: no member named 'state' in 'struct
task_struct'
switch (p->state) {
~ ^
kernel/sched/alt_core.c:2561:5: error: no member named 'state' in 'struct
task_struct'
p->state = TASK_NEW;
~ ^
kernel/sched/alt_core.c:2713:5: error: no member named 'state' in 'struct
task_struct'
p->state = TASK_RUNNING;
~ ^
kernel/sched/alt_core.c:3066:21: error: no member named 'state' in 'struct
task_struct'
prev_state = prev->state;
~~~~ ^
kernel/sched/alt_core.c:3844:24: error: no member named 'state' in 'struct
task_struct'
if (!preempt && prev->state && prev->non_block_count) {
~~~~ ^
kernel/sched/alt_core.c:4111:21: error: no member named 'state' in 'struct
task_struct'
prev_state = prev->state;
~~~~ ^
kernel/sched/alt_core.c:4112:52: error: no member named 'state' in 'struct
task_struct'
if (!preempt && prev_state && prev_state == prev->state) {
~~~~ ^
kernel/sched/alt_core.c:4114:10: error: no member named 'state' in 'struct
task_struct'
prev->state = TASK_RUNNING;
~~~~ ^
kernel/sched/alt_core.c:4292:24: error: no member named 'state' in 'struct
task_struct'
WARN_ON_ONCE(current->state);
~~~~~~~ ^
include/asm-generic/bug.h:104:25: note: expanded from macro 'WARN_ON_ONCE'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
kernel/sched/alt_core.c:6064:11: error: no member named 'state' in 'struct
task_struct'
if (!(p->state & state_filter))
~ ^
kernel/sched/alt_core.c:6071:49: error: no member named 'state' in 'struct
task_struct'
if (state_filter == TASK_UNINTERRUPTIBLE && p->state == TASK_IDLE)
~ ^
kernel/sched/alt_core.c:6078:6: error: conflicting types for
'show_state_filter'
void show_state_filter(unsigned long state_filter)
^
include/linux/sched/debug.h:17:13: note: previous declaration is here
extern void show_state_filter(unsigned int state_filter);
^
kernel/sched/alt_core.c:6145:8: error: no member named 'state' in 'struct
task_struct'
idle->state = TASK_RUNNING;
~~~~ ^
kernel/sched/alt_core.c:6831:21: error: no member named 'state' in 'struct
task_struct'
WARN_ONCE(current->state != TASK_RUNNING &&
current->task_state_change,
~~~~~~~ ^
include/asm-generic/bug.h:150:18: note: expanded from macro 'WARN_ONCE'
DO_ONCE_LITE_IF(condition, WARN, 1, format)
^~~~~~~~~
include/linux/once_lite.h:15:27: note: expanded from macro 'DO_ONCE_LITE_IF'
bool __ret_do_once = !!(condition); \
^~~~~~~~~
kernel/sched/alt_core.c:6834:13: error: no member named 'state' in 'struct
task_struct'
current->state,
~~~~~~~ ^
include/asm-generic/bug.h:150:38: note: expanded from macro 'WARN_ONCE'
DO_ONCE_LITE_IF(condition, WARN, 1, format)
^~~~~~
include/linux/once_lite.h:19:9: note: expanded from macro 'DO_ONCE_LITE_IF'
func(__VA_ARGS__); \
^~~~~~~~~~~
include/asm-generic/bug.h:132:29: note: expanded from macro 'WARN'
__WARN_printf(TAINT_WARN, format); \
^~~~~~
include/asm-generic/bug.h:99:17: note: expanded from macro '__WARN_printf'
__warn_printk(arg); \
^~~
kernel/sched/alt_core.c:6847:16: warning: variable 'preempt_disable_ip' set but
not used [-Wunused-but-set-variable]
unsigned long preempt_disable_ip;
^
> kernel/sched/alt_core.c:7042:20: warning: no previous prototype
for function 'sched_create_group' [-Wmissing-prototypes]
struct
task_group *sched_create_group(struct task_group *parent)
^
kernel/sched/alt_core.c:7042:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
struct task_group *sched_create_group(struct task_group *parent)
^
static
> kernel/sched/alt_core.c:7053:6: warning: no previous prototype
for function 'sched_online_group' [-Wmissing-prototypes]
void
sched_online_group(struct task_group *tg, struct task_group *parent)
^
kernel/sched/alt_core.c:7053:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
void sched_online_group(struct task_group *tg, struct task_group *parent)
^
static
> kernel/sched/alt_core.c:7064:6: warning: no previous prototype
for function 'sched_destroy_group' [-Wmissing-prototypes]
void
sched_destroy_group(struct task_group *tg)
^
kernel/sched/alt_core.c:7064:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
void sched_destroy_group(struct task_group *tg)
^
static
> kernel/sched/alt_core.c:7070:6: warning: no previous prototype
for function 'sched_offline_group' [-Wmissing-prototypes]
void
sched_offline_group(struct task_group *tg)
^
kernel/sched/alt_core.c:7070:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
void sched_offline_group(struct task_group *tg)
^
static
kernel/sched/alt_core.c:7209:20: warning: initializer overrides prior initialization of
this subobject [-Winitializer-overrides]
.legacy_cftypes = cpu_legacy_files,
^~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:7208:20: note: previous initialization is here
.legacy_cftypes = cpu_files,
^~~~~~~~~
8 warnings and 19 errors generated.
vim +/sched_create_group +7042 kernel/sched/alt_core.c
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6841
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6842 void ___might_sleep(const char *file, int
line, int preempt_offset)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6843 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6844 /* Ratelimiting timestamp: */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6845 static unsigned long prev_jiffy;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6846
cb06db4ef97b1e9 Alfred Chen 2019-08-19 @6847 unsigned long preempt_disable_ip;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6848
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6849 /* WARN_ON_ONCE() by default, no rate limit
required: */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6850 rcu_sleep_check();
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6851
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6852 if ((preempt_count_equals(preempt_offset)
&& !irqs_disabled() &&
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6853 !is_idle_task(current) &&
!current->non_block_count) ||
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6854 system_state == SYSTEM_BOOTING ||
system_state > SYSTEM_RUNNING ||
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6855 oops_in_progress)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6856 return;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6857 if (time_before(jiffies, prev_jiffy + HZ)
&& prev_jiffy)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6858 return;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6859 prev_jiffy = jiffies;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6860
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6861 /* Save this before calling printk(), since
that will clobber it: */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6862 preempt_disable_ip =
get_preempt_disable_ip(current);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6863
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6864 printk(KERN_ERR
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6865 "BUG: sleeping function called from
invalid context at %s:%d\n",
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6866 file, line);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6867 printk(KERN_ERR
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6868 "in_atomic(): %d, irqs_disabled():
%d, non_block: %d, pid: %d, name: %s\n",
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6869 in_atomic(), irqs_disabled(),
current->non_block_count,
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6870 current->pid, current->comm);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6871
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6872 if (task_stack_end_corrupted(current))
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6873 printk(KERN_EMERG "Thread overran
stack, or stack corrupted\n");
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6874
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6875 debug_show_held_locks(current);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6876 if (irqs_disabled())
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6877 print_irqtrace_events(current);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6878 #ifdef CONFIG_DEBUG_PREEMPT
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6879 if (!preempt_count_equals(preempt_offset))
{
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6880 pr_err("Preemption disabled
at:");
d57edc338350f5f Alfred Chen 2020-08-02 6881 print_ip_sym(KERN_ERR,
preempt_disable_ip);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6882 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6883 #endif
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6884 dump_stack();
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6885 add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6886 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6887 EXPORT_SYMBOL(___might_sleep);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6888
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6889 void __cant_sleep(const char *file, int
line, int preempt_offset)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6890 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6891 static unsigned long prev_jiffy;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6892
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6893 if (irqs_disabled())
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6894 return;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6895
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6896 if (!IS_ENABLED(CONFIG_PREEMPT_COUNT))
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6897 return;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6898
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6899 if (preempt_count() > preempt_offset)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6900 return;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6901
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6902 if (time_before(jiffies, prev_jiffy + HZ)
&& prev_jiffy)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6903 return;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6904 prev_jiffy = jiffies;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6905
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6906 printk(KERN_ERR "BUG: assuming atomic
context at %s:%d\n", file, line);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6907 printk(KERN_ERR "in_atomic(): %d,
irqs_disabled(): %d, pid: %d, name: %s\n",
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6908 in_atomic(), irqs_disabled(),
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6909 current->pid, current->comm);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6910
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6911 debug_show_held_locks(current);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6912 dump_stack();
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6913 add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6914 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6915 EXPORT_SYMBOL_GPL(__cant_sleep);
b0e39e1ae101c8d Alfred Chen 2021-02-03 6916
b0e39e1ae101c8d Alfred Chen 2021-02-03 6917 #ifdef CONFIG_SMP
b0e39e1ae101c8d Alfred Chen 2021-02-03 6918 void __cant_migrate(const char *file, int
line)
b0e39e1ae101c8d Alfred Chen 2021-02-03 6919 {
613ad5e4353f72d Alfred Chen 2021-02-28 6920 static unsigned long prev_jiffy;
613ad5e4353f72d Alfred Chen 2021-02-28 6921
613ad5e4353f72d Alfred Chen 2021-02-28 6922 if (irqs_disabled())
613ad5e4353f72d Alfred Chen 2021-02-28 6923 return;
613ad5e4353f72d Alfred Chen 2021-02-28 6924
613ad5e4353f72d Alfred Chen 2021-02-28 6925 if (is_migration_disabled(current))
613ad5e4353f72d Alfred Chen 2021-02-28 6926 return;
613ad5e4353f72d Alfred Chen 2021-02-28 6927
613ad5e4353f72d Alfred Chen 2021-02-28 6928 if (!IS_ENABLED(CONFIG_PREEMPT_COUNT))
613ad5e4353f72d Alfred Chen 2021-02-28 6929 return;
613ad5e4353f72d Alfred Chen 2021-02-28 6930
613ad5e4353f72d Alfred Chen 2021-02-28 6931 if (preempt_count() > 0)
613ad5e4353f72d Alfred Chen 2021-02-28 6932 return;
613ad5e4353f72d Alfred Chen 2021-02-28 6933
613ad5e4353f72d Alfred Chen 2021-02-28 6934 if (current->migration_flags &
MDF_FORCE_ENABLED)
613ad5e4353f72d Alfred Chen 2021-02-28 6935 return;
613ad5e4353f72d Alfred Chen 2021-02-28 6936
613ad5e4353f72d Alfred Chen 2021-02-28 6937 if (time_before(jiffies, prev_jiffy + HZ)
&& prev_jiffy)
613ad5e4353f72d Alfred Chen 2021-02-28 6938 return;
613ad5e4353f72d Alfred Chen 2021-02-28 6939 prev_jiffy = jiffies;
613ad5e4353f72d Alfred Chen 2021-02-28 6940
613ad5e4353f72d Alfred Chen 2021-02-28 6941 pr_err("BUG: assuming non migratable
context at %s:%d\n", file, line);
613ad5e4353f72d Alfred Chen 2021-02-28 6942 pr_err("in_atomic(): %d,
irqs_disabled(): %d, migration_disabled() %u pid: %d, name: %s\n",
613ad5e4353f72d Alfred Chen 2021-02-28 6943 in_atomic(), irqs_disabled(),
is_migration_disabled(current),
613ad5e4353f72d Alfred Chen 2021-02-28 6944 current->pid, current->comm);
613ad5e4353f72d Alfred Chen 2021-02-28 6945
613ad5e4353f72d Alfred Chen 2021-02-28 6946 debug_show_held_locks(current);
613ad5e4353f72d Alfred Chen 2021-02-28 6947 dump_stack();
613ad5e4353f72d Alfred Chen 2021-02-28 6948 add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
b0e39e1ae101c8d Alfred Chen 2021-02-03 6949 }
b0e39e1ae101c8d Alfred Chen 2021-02-03 6950 EXPORT_SYMBOL_GPL(__cant_migrate);
b0e39e1ae101c8d Alfred Chen 2021-02-03 6951 #endif
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6952 #endif
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6953
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6954 #ifdef CONFIG_MAGIC_SYSRQ
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6955 void normalize_rt_tasks(void)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6956 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6957 struct task_struct *g, *p;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6958 struct sched_attr attr = {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6959 .sched_policy = SCHED_NORMAL,
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6960 };
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6961
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6962 read_lock(&tasklist_lock);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6963 for_each_process_thread(g, p) {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6964 /*
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6965 * Only normalize user tasks:
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6966 */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6967 if (p->flags & PF_KTHREAD)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6968 continue;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6969
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6970 if (!rt_task(p)) {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6971 /*
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6972 * Renice negative nice level userspace
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6973 * tasks back to 0:
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6974 */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6975 if (task_nice(p) < 0)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6976 set_user_nice(p, 0);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6977 continue;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6978 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6979
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6980 __sched_setscheduler(p, &attr, false,
false);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6981 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6982 read_unlock(&tasklist_lock);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6983 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6984 #endif /* CONFIG_MAGIC_SYSRQ */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6985
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6986 #if defined(CONFIG_IA64) ||
defined(CONFIG_KGDB_KDB)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6987 /*
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6988 * These functions are only useful for the
IA64 MCA handling, or kdb.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6989 *
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6990 * They can only be called when the whole
system has been
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6991 * stopped - every CPU needs to be
quiescent, and no scheduling
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6992 * activity can take place. Using them for
anything else would
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6993 * be a serious bug, and as a result, they
aren't even visible
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6994 * under any other configuration.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6995 */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6996
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6997 /**
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6998 * curr_task - return the current task for a
given CPU.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 6999 * @cpu: the processor in question.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7000 *
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7001 * ONLY VALID WHEN THE WHOLE SYSTEM IS
STOPPED!
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7002 *
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7003 * Return: The current task for @cpu.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7004 */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7005 struct task_struct *curr_task(int cpu)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7006 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7007 return cpu_curr(cpu);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7008 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7009
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7010 #endif /* defined(CONFIG_IA64) ||
defined(CONFIG_KGDB_KDB) */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7011
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7012 #ifdef CONFIG_IA64
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7013 /**
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7014 * ia64_set_curr_task - set the current task
for a given CPU.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7015 * @cpu: the processor in question.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7016 * @p: the task pointer to set.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7017 *
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7018 * Description: This function must only be
used when non-maskable interrupts
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7019 * are serviced on a separate stack. It
allows the architecture to switch the
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7020 * notion of the current task on a CPU in a
non-blocking manner. This function
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7021 * must be called with all CPU's
synchronised, and interrupts disabled, the
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7022 * and caller must save the original value
of the current task (see
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7023 * curr_task() above) and restore that value
before reenabling interrupts and
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7024 * re-starting the system.
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7025 *
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7026 * ONLY VALID WHEN THE WHOLE SYSTEM IS
STOPPED!
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7027 */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7028 void ia64_set_curr_task(int cpu, struct
task_struct *p)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7029 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7030 cpu_curr(cpu) = p;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7031 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7032
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7033 #endif
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7034
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7035 #ifdef CONFIG_CGROUP_SCHED
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7036 static void sched_free_group(struct
task_group *tg)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7037 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7038 kmem_cache_free(task_group_cache, tg);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7039 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7040
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7041 /* allocate runqueue etc for a new task
group */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 @7042 struct task_group *sched_create_group(struct
task_group *parent)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7043 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7044 struct task_group *tg;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7045
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7046 tg = kmem_cache_alloc(task_group_cache,
GFP_KERNEL | __GFP_ZERO);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7047 if (!tg)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7048 return ERR_PTR(-ENOMEM);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7049
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7050 return tg;
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7051 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7052
cb06db4ef97b1e9 Alfred Chen 2019-08-19 @7053 void sched_online_group(struct task_group
*tg, struct task_group *parent)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7054 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7055 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7056
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7057 /* rcu callback to free various structures
associated with a task group */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7058 static void sched_free_group_rcu(struct
rcu_head *rhp)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7059 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7060 /* Now it should be safe to free those
cfs_rqs */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7061 sched_free_group(container_of(rhp, struct
task_group, rcu));
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7062 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7063
cb06db4ef97b1e9 Alfred Chen 2019-08-19 @7064 void sched_destroy_group(struct task_group
*tg)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7065 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7066 /* Wait for possible concurrent references
to cfs_rqs complete */
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7067 call_rcu(&tg->rcu,
sched_free_group_rcu);
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7068 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7069
cb06db4ef97b1e9 Alfred Chen 2019-08-19 @7070 void sched_offline_group(struct task_group
*tg)
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7071 {
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7072 }
cb06db4ef97b1e9 Alfred Chen 2019-08-19 7073
:::::: The code at line 7042 was first introduced by commit
:::::: cb06db4ef97b1e99a0350d328e6044f374941410 Project C v5.7.5-r2
:::::: TO: Alfred Chen <cchalpha(a)gmail.com>
:::::: CC: Alfred Chen <cchalpha(a)gmail.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org