From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 08:17:02 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18868106564A; Mon, 19 Mar 2012 08:17:02 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D977D8FC14; Mon, 19 Mar 2012 08:17:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2J8Gvb7071691; Mon, 19 Mar 2012 08:16:59 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F66EB7A.7030107@gmail.com> Date: Mon, 19 Mar 2012 16:16:58 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> <20120318185014.GK1340@garage.freebsd.pl> <4F668422.1000308@freebsd.org> <20120319073326.GO1340@garage.freebsd.pl> In-Reply-To: <20120319073326.GO1340@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Julian Elischer , David Xu Subject: Re: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 08:17:02 -0000 On 2012/3/19 15:33, Pawel Jakub Dawidek wrote: > On Sun, Mar 18, 2012 at 05:56:02PM -0700, Julian Elischer wrote: >> On 3/18/12 11:50 AM, Pawel Jakub Dawidek wrote: >>> On Mon, Feb 27, 2012 at 01:38:52PM +0000, David Xu wrote: >>>> Author: davidxu >>>> Date: Mon Feb 27 13:38:52 2012 >>>> New Revision: 232209 >>>> URL: http://svn.freebsd.org/changeset/base/232209 >>>> >>>> Log: >>>> Follow changes made in revision 232144, pass absolute timeout to kernel, >>>> this eliminates a clock_gettime() syscall. >>> This or some other change has broken CLOCK_MONOTONIC usage with >>> condition variables. >>> >>> You should be able to reproduce this by something like this: >>> >>> pthread_cond_t cv; >>> pthread_condattr_t attr; >>> pthread_mutex_t lock; >>> struct timespec ts; >>> int error; >>> >>> (void)pthread_mutex_init(&lock, NULL); >>> >>> (void)pthread_condattr_init(&attr); >>> (void)pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); >>> >>> (void)pthread_cond_init(&cv,&attr); >>> (void)pthread_condattr_destroy(&attr); >>> >>> (void)clock_gettime(CLOCK_MONOTONIC,&ts); >>> ts.tv_sec += 10; >>> (void)pthread_mutex_lock(&lock); >>> (void)pthread_cond_timedwait(&cv,&lock,&ts); >>> (void)pthread_mutex_unlock(&lock); >>> >>> This should timeout after 10 seconds, but pthread_cond_timedwait(3) >>> returns immediately with ETIMEDOUT. CLOCK_REALTIME works properly. >>> Bascially pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) is no-op. >>> If you change CLOCK_MONOTONIC to CLOCK_REALTIME in clock_gettime(2) >>> call, it will timeout after 10 seconds. >> this has been broken for a while for me in fact fixing this was, I >> thought, >> one of the reasons for this work.. glad I'm not the omnly person >> seeing it though. >> >> for me it broke sysutils/fio from ports > For me it breaks sbin/hastd and openbsm/auditdistd, but my feeling is > that it is was broken recently. This stuff use to work not so long ago. Hi, Revision 233134 should have fixed the problem. http://svn.freebsd.org/changeset/base/233134