Skip to content

Commit

Permalink
[S390] etr/stp: fix possible deadlock
Browse files Browse the repository at this point in the history
Precreate stop_machine threads in case the machine supports ETR/STP.
Otherwise we might deadlock if a time sync operation gets scheduled
and the creation of stop_machine threads would cause disk I/O.
This is just the minimal fix.
The real fix would be to only precreate stop_machine threads if
ETR/STP is actually used. But that would be a rather large and
complicated patch.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
  • Loading branch information
Heiko Carstens committed Jan 23, 2009
1 parent f9a2f79 commit 179cb81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/s390/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,10 @@ static struct workqueue_struct *time_sync_wq;

static void __init time_init_wq(void)
{
if (!time_sync_wq)
time_sync_wq = create_singlethread_workqueue("timesync");
if (time_sync_wq)
return;
time_sync_wq = create_singlethread_workqueue("timesync");
stop_machine_create();
}

/*
Expand Down

0 comments on commit 179cb81

Please sign in to comment.