From nobody@FreeBSD.org Thu Dec 20 23:00:36 2007 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 834EE16A418 for ; Thu, 20 Dec 2007 23:00:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 7597613C45A for ; Thu, 20 Dec 2007 23:00:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lBKN0DXk013451 for ; Thu, 20 Dec 2007 23:00:13 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id lBKN0D4S013450; Thu, 20 Dec 2007 23:00:13 GMT (envelope-from nobody) Message-Id: <200712202300.lBKN0D4S013450@www.freebsd.org> Date: Thu, 20 Dec 2007 23:00:13 GMT From: Kuteynikov Dmitriy To: freebsd-gnats-submit@FreeBSD.org Subject: Multithreading problem X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 118910 >Category: threads >Synopsis: Multithreading problem >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-threads >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 20 23:10:01 UTC 2007 >Closed-Date: Fri Dec 21 20:17:20 UTC 2007 >Last-Modified: Fri Dec 21 20:17:20 UTC 2007 >Originator: Kuteynikov Dmitriy >Release: 7.0-BETA2 >Organization: MEPHI >Environment: FreeBSD av113962 7.0-BETA2 FreeBSD 7.0-BETA2 #0: Fri Nov 2 16:47:33 UTC 2007 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: I have average computer: Athlon XP 2000+ with 1024 Mb RAM. When I listen music (in Rhythmbox) and move a window of any application for 3 or more seconds music stops to play. I haven't noticed this problem in previous releases. Is it multithreading problem in kernel? >How-To-Repeat: pkg_add -r fluxbox pkg_add -r rhythmbox startx fluxbox rhythmbox Turn on music and move xterm window for some seconds. >Fix: >Release-Note: >Audit-Trail: From: David Xu To: Kuteynikov Dmitriy Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: threads/118910: Multithreading problem Date: Fri, 21 Dec 2007 14:56:35 +0800 The kernel condition variable implementation is problematic, a thread sleeping on a condition variable does not raise its priority to some I/O priority, but most code will raise thread's priority to some level with msleep(). The code in sound driver use lots of cv_broadcast call(), it does not raise thread priority, this causes the music player does not have more chances to do I/O while other I/O bound applications will have. The kernel condition variable also causes top() to display incorrect priority because cv_wait does not update the priority but it is updated by cv_broadcastpri() which is too late for top to display. The kernel condition variable's initialization function should accept a thread priority parameter, and all thread sleep on the condition variable should use the priority. Regards, David Xu State-Changed-From-To: open->closed State-Changed-By: ariff State-Changed-When: Fri Dec 21 20:16:43 UTC 2007 State-Changed-Why: The submitter agrees that the issue has been solved and has nothing to do with multithreading. Brief solution can be found here: http://lists.freebsd.org/pipermail/freebsd-threads/2007-December/004087.html http://www.freebsd.org/cgi/query-pr.cgi?pr=118910 >Unformatted: