lkml.org 
[lkml]   [2016]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: sched: tweak select_idle_sibling to look for idle threads
On Thu, May 05, 2016 at 09:58:44AM -0400, Chris Mason wrote:
> > I'll try and have a prod at the program itself if you have no pending
> > changes on your end.
>
> Sorry, I don't. Look at sleep_for_runtime() and how I test/set the
> global stopping variable in different places. I've almost certainly got
> someone waiting on a wakeup that'll never come.

The below makes it go..

---
schbench.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/schbench.c b/schbench.c
index a0e9f7e..f299959 100644
--- a/schbench.c
+++ b/schbench.c
@@ -49,7 +49,7 @@ static int pipe_test = 0;
static unsigned int max_us = 50000;

/* the message threads flip this to true when they decide runtime is up */
-static unsigned long stopping = 0;
+static volatile unsigned long stopping = 0;


/*
@@ -746,8 +746,8 @@ static void sleep_for_runtime()
else
break;
}
- stopping = 1;
__sync_synchronize();
+ stopping = 1;
}

int main(int ac, char **av)
\
 
 \ /
  Last update: 2016-05-06 09:41    [W:0.128 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site