From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755602AbcA1Sxv (ORCPT ); Thu, 28 Jan 2016 13:53:51 -0500 Received: from mx6-phx2.redhat.com ([209.132.183.39]:45468 "EHLO mx6-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753434AbcA1Sxr (ORCPT ); Thu, 28 Jan 2016 13:53:47 -0500 Date: Thu, 28 Jan 2016 13:43:13 -0500 (EST) From: Jan Stancek To: Peter Zijlstra Cc: alex shi , guz fnst , mingo@redhat.com, jolsa@redhat.com, riel@redhat.com, linux-kernel@vger.kernel.org Message-ID: <333246323.13611103.1454006593261.JavaMail.zimbra@redhat.com> In-Reply-To: <20160128174903.GV6356@twins.programming.kicks-ass.net> References: <56A8D994.6050205@redhat.com> <56AA39D6.4070509@redhat.com> <20160128174903.GV6356@twins.programming.kicks-ass.net> Subject: Re: [BUG] scheduler doesn't balance thread to idle cpu for 3 seconds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.34.26.57] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF43 (Win)/8.0.6_GA_5922) Thread-Topic: scheduler doesn't balance thread to idle cpu for 3 seconds Thread-Index: e28JuC6voA0BrJsSCtyuUjK/gGSP6g== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Original Message ----- > From: "Peter Zijlstra" > To: "Jan Stancek" > Cc: "alex shi" , "guz fnst" , mingo@redhat.com, jolsa@redhat.com, > riel@redhat.com, linux-kernel@vger.kernel.org > Sent: Thursday, 28 January, 2016 6:49:03 PM > Subject: Re: [BUG] scheduler doesn't balance thread to idle cpu for 3 seconds > > On Thu, Jan 28, 2016 at 04:55:02PM +0100, Jan Stancek wrote: > > On 01/27/2016 03:52 PM, Jan Stancek wrote: > > > Hello, > > > > > > pthread_cond_wait_1/2 [1] is rarely failing for me on 4.5.0-rc1, > > > on x86_64 KVM guest with 2 CPUs. > > > > > > This test [1]: > > > - spawns 2 SCHED_RR threads > > > - first thread with higher priority sets alarm for 2 seconds and blocks > > > on condition > > > - second thread with lower priority is busy looping for 5 seconds > > > - after 2 seconds alarm signal arrives and handler signals condition > > > - high priority thread should resume running > > > > I have slightly modified testcase, so it will finish immediately when high > > prio > > thread is done. And also to allow it to compile outside of openposix > > testsuite. > > Yeah, I 'fixed' the testcase too. > > So I've had it run for almost 2 hours without a single fail. I've > hot-plugged my cpu count down to 2. I can try that too. I'm mostly seeing this on s390 and x86_64 KVM guests, both have 2 CPUs. Have you noticed if iteration times vary or if they stay consitently at ~2 seconds? > > How long should I have to wait for a fail? It's about 1000-2000 iterations for me, which I think you covered by now in those 2 hours. Regards, Jan