lkml.org 
[lkml]   [2020]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RT 21/23] sched: migrate_enable: Busy loop until the migration request is completed
From
Date
On Thu, 2020-02-27 at 08:33 -0600, zanussi@kernel.org wrote:
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> v4.14.170-rt75-rc2 stable review patch.
> If anyone has any objections, please let me know.
>
> -----------
>
>
> [ Upstream commit 140d7f54a5fff02898d2ca9802b39548bf7455f1 ]
>
> If user task changes the CPU affinity mask of a running task it will
> dispatch migration request if the current CPU is no longer allowed. This
> might happen shortly before a task enters a migrate_disable() section.
> Upon leaving the migrate_disable() section, the task will notice that
> the current CPU is no longer allowed and will will dispatch its own
> migration request to move it off the current CPU.
> While invoking __schedule() the first migration request will be
> processed and the task returns on the "new" CPU with "arg.done = 0". Its
> own migration request will be processed shortly after and will result in
> memory corruption if the stack memory, designed for request, was used
> otherwise in the meantime.
>
> Spin until the migration request has been processed if it was accepted.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Tom Zanussi <zanussi@kernel.org>
> ---
> kernel/sched/core.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)

As I said in https://marc.info/?l=linux-rt-users&m=158258256415340&w=2 if
you take thhis you should take the followup 2dcd94b443c5dcbc ("sched:
migrate_enable: Use per-cpu cpu_stop_work")

-Scott


\
 
 \ /
  Last update: 2020-03-03 20:56    [W:0.112 / U:1.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site