diff options
| author | Pavankumar Kondeti <pkondeti@codeaurora.org> | 2017-12-30 11:16:45 +0530 |
|---|---|---|
| committer | Pavankumar Kondeti <pkondeti@codeaurora.org> | 2017-12-30 11:51:59 +0530 |
| commit | 9c933388d8783e46d50c1fd049bd2be68f3d32f5 (patch) | |
| tree | 9005c6ccfc5fd27ee81a37688675f63ebb3e28ab /kernel/sched/hmp.c | |
| parent | 8ed108c9770aa1fb055f8129121e60a708067f3f (diff) | |
sched: Fix spinlock recursion in sched_exit()
The exiting task's prev_window and curr_window arrays are freed
with rq->lock acquired. The kfree() may wakeup kswapd and if
kswapd wakeup needs the same rq->lock, we hit a deadlock. Fix
this issue by freeing these arrays after releasing the lock.
Since the task is already marked as exiting under lock, delaying
the freeing of the current and window arrays will not have
any side effect.
Change-Id: I3282d91ba715765e38177b9d66be32aaed989303
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Diffstat (limited to 'kernel/sched/hmp.c')
| -rw-r--r-- | kernel/sched/hmp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched/hmp.c b/kernel/sched/hmp.c index ae6876e62c0f..70a556f0dd06 100644 --- a/kernel/sched/hmp.c +++ b/kernel/sched/hmp.c @@ -1526,6 +1526,10 @@ unsigned int cpu_temp(int cpu) return 0; } +/* + * kfree() may wakeup kswapd. So this function should NOT be called + * with any CPU's rq->lock acquired. + */ void free_task_load_ptrs(struct task_struct *p) { kfree(p->ravg.curr_window_cpu); |
