Skip to content

Commit

Permalink
Don't run pollers in time_wait() when a lock is held
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
ozbenh authored and stewartsmith committed Feb 18, 2015
1 parent 772c78a commit 3db397e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/timebase.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/* Copyright 2013-2014 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -40,7 +41,14 @@ static void time_wait_poll(unsigned long duration)

void time_wait(unsigned long duration)
{
if (this_cpu() != boot_cpu)
struct cpu_thread *c = this_cpu();

if (this_cpu()->lock_depth) {
time_wait_nopoll(duration);
return;
}

if (c != boot_cpu)
time_wait_nopoll(duration);
else
time_wait_poll(duration);
Expand Down

0 comments on commit 3db397e

Please sign in to comment.