From owner-freebsd-threads@FreeBSD.ORG Thu Dec 4 19:37:11 2014 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AC4212A for ; Thu, 4 Dec 2014 19:37:11 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 026279AD for ; Thu, 4 Dec 2014 19:37:11 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4JbA5D081280 for ; Thu, 4 Dec 2014 19:37:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 195098] pthread lock performance degradation on single CPU VM Date: Thu, 04 Dec 2014 19:37:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 10.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 19:37:11 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195098 --- Comment #3 from Ed Maste --- It appears that in the "slow" case the repro code is spinning in the pthread_yield() at line 107 - i.e., trying to allow the contender threads run, but the main thread immediately resumes. 98 /* Wait until every thread is ready. */ 99 dbgprintf ("Main thread before synchronizing for round %d\n", repeat); 100 for (;;) 101 { 102 int ready_count = 0; 103 for (i = 0; i < THREAD_COUNT; i++) 104 ready_count += ready[i]; 105 if (ready_count == THREAD_COUNT) 106 break; 107 pthread_yield (); 108 } -- You are receiving this mail because: You are the assignee for the bug.