ANDROID: Export some scheduler APIs for vendor modules
Make some scheduler APIs exports to allow vendor
modules to use them. It is necessary for the modules
to migrate tasks as they want.
activate_task:
To make an inactive and migrated task runnable.
deactivate_task:
To make an active task migratible.
check_preempt_curr:
To check whether a migrated task needs to preempt
current task and if so, to do it.
set_task_cpu:
To set a cpu for a migratible task and force
the task to be migrated.
stop_one_cpu_nowait:
To move a queued task, stopper should be used.
Bug: 155241766
Signed-off-by: Choonghoon Park <choong.park@samsung.com>
Change-Id: Ied940640525101efbbcef6eca0c39f15eb580007
This commit is contained in:
committed by
Todd Kjos
parent
a95005100d
commit
a085424328
@@ -1322,6 +1322,7 @@ void activate_task(struct rq *rq, struct task_struct *p, int flags)
|
|||||||
|
|
||||||
p->on_rq = TASK_ON_RQ_QUEUED;
|
p->on_rq = TASK_ON_RQ_QUEUED;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(activate_task);
|
||||||
|
|
||||||
void deactivate_task(struct rq *rq, struct task_struct *p, int flags)
|
void deactivate_task(struct rq *rq, struct task_struct *p, int flags)
|
||||||
{
|
{
|
||||||
@@ -1329,6 +1330,7 @@ void deactivate_task(struct rq *rq, struct task_struct *p, int flags)
|
|||||||
|
|
||||||
dequeue_task(rq, p, flags);
|
dequeue_task(rq, p, flags);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(deactivate_task);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* __normal_prio - return the priority that is based on the static prio
|
* __normal_prio - return the priority that is based on the static prio
|
||||||
@@ -1433,6 +1435,7 @@ void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags)
|
|||||||
if (task_on_rq_queued(rq->curr) && test_tsk_need_resched(rq->curr))
|
if (task_on_rq_queued(rq->curr) && test_tsk_need_resched(rq->curr))
|
||||||
rq_clock_skip_update(rq);
|
rq_clock_skip_update(rq);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(check_preempt_curr);
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
|
|
||||||
@@ -1744,6 +1747,7 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
|
|||||||
|
|
||||||
__set_task_cpu(p, new_cpu);
|
__set_task_cpu(p, new_cpu);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(set_task_cpu);
|
||||||
|
|
||||||
#ifdef CONFIG_NUMA_BALANCING
|
#ifdef CONFIG_NUMA_BALANCING
|
||||||
static void __migrate_swap_task(struct task_struct *p, int cpu)
|
static void __migrate_swap_task(struct task_struct *p, int cpu)
|
||||||
|
|||||||
@@ -370,6 +370,7 @@ bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
|
|||||||
*work_buf = (struct cpu_stop_work){ .fn = fn, .arg = arg, };
|
*work_buf = (struct cpu_stop_work){ .fn = fn, .arg = arg, };
|
||||||
return cpu_stop_queue_work(cpu, work_buf);
|
return cpu_stop_queue_work(cpu, work_buf);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(stop_one_cpu_nowait);
|
||||||
|
|
||||||
static bool queue_stop_cpus_work(const struct cpumask *cpumask,
|
static bool queue_stop_cpus_work(const struct cpumask *cpumask,
|
||||||
cpu_stop_fn_t fn, void *arg,
|
cpu_stop_fn_t fn, void *arg,
|
||||||
|
|||||||
Reference in New Issue
Block a user