From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757980AbcEFHM6 (ORCPT ); Fri, 6 May 2016 03:12:58 -0400 Received: from merlin.infradead.org ([205.233.59.134]:55261 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbcEFHM5 (ORCPT ); Fri, 6 May 2016 03:12:57 -0400 Date: Fri, 6 May 2016 09:12:51 +0200 From: Peter Zijlstra To: Chris Mason , Mike Galbraith , Ingo Molnar , Matt Fleming , linux-kernel@vger.kernel.org Subject: Re: sched: tweak select_idle_sibling to look for idle threads Message-ID: <20160506071251.GM3448@twins.programming.kicks-ass.net> References: <20160502084615.GB3430@twins.programming.kicks-ass.net> <1462200604.3736.42.camel@suse.de> <20160502145817.GW3408@twins.programming.kicks-ass.net> <20160502154725.ckiewczbdubudyc7@floor.masoncoding.com> <20160503143225.GG3448@twins.programming.kicks-ass.net> <20160503151153.wp6jcnjadmw2ypmx@floor.masoncoding.com> <20160504154510.GH3448@twins.programming.kicks-ass.net> <20160504174616.k4xud2w232b6m4by@floor.masoncoding.com> <20160505093338.GK3448@twins.programming.kicks-ass.net> <20160505135844.nfb5czbmgxlhyiw6@floor.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160505135844.nfb5czbmgxlhyiw6@floor.thefacebook.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)