diff --git a/include/linux/sched.h b/include/linux/sched.h index ab8fd749b3060d..82c25783fa1a53 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -874,11 +874,15 @@ struct task_struct { const cpumask_t *cpus_ptr; cpumask_t *user_cpus_ptr; cpumask_t cpus_mask; +#ifndef CONFIG_SCHED_ALT void *migration_pending; +#endif #ifdef CONFIG_SMP unsigned short migration_disabled; #endif +#ifndef CONFIG_SCHED_ALT unsigned short migration_flags; +#endif #ifdef CONFIG_PREEMPT_RCU int rcu_read_lock_nesting; diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c index 81f22c061bae30..492b6dbfd418b8 100644 --- a/kernel/sched/alt_core.c +++ b/kernel/sched/alt_core.c @@ -1438,8 +1438,6 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu) __set_task_cpu(p, new_cpu); } -#define MDF_FORCE_ENABLED 0x80 - static void __do_set_cpus_ptr(struct task_struct *p, const struct cpumask *new_mask) { @@ -1474,8 +1472,6 @@ void migrate_disable(void) if (cpumask_test_cpu(cpu, &p->cpus_mask)) { cpu_rq(cpu)->nr_pinned++; p->migration_disabled = 1; - p->migration_flags &= ~MDF_FORCE_ENABLED; - /* * Violates locking rules! see comment in __do_set_cpus_ptr(). */ @@ -1505,10 +1501,6 @@ void migrate_enable(void) * __set_cpus_allowed_ptr(SCA_MIGRATE_ENABLE) doesn't schedule(). */ guard(preempt)(); - /* - * Assumption: current should be running on allowed cpu - */ - WARN_ON_ONCE(!cpumask_test_cpu(smp_processor_id(), &p->cpus_mask)); if (p->cpus_ptr != &p->cpus_mask) __do_set_cpus_ptr(p, &p->cpus_mask); /* @@ -2004,7 +1996,6 @@ static int affine_move_task(struct rq *rq, struct task_struct *p, int dest_cpu, if (likely(p->cpus_ptr != &p->cpus_mask)) __do_set_cpus_ptr(p, &p->cpus_mask); p->migration_disabled = 0; - p->migration_flags |= MDF_FORCE_ENABLED; /* When p is migrate_disabled, rq->lock should be held */ rq->nr_pinned--; } @@ -6461,9 +6452,6 @@ void __cant_migrate(const char *file, int line) if (preempt_count() > 0) return; - if (current->migration_flags & MDF_FORCE_ENABLED) - return; - if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) return; prev_jiffy = jiffies;