From owner-svn-src-head@FreeBSD.ORG Mon Nov 3 17:08:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CD6D1065672; Mon, 3 Nov 2008 17:08:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id E476D8FC26; Mon, 3 Nov 2008 17:08:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 226874445; Mon, 03 Nov 2008 18:08:29 +0200 Message-ID: <490F21FC.1020508@FreeBSD.org> Date: Mon, 03 Nov 2008 18:08:28 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Jung-uk Kim References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <200811031050.48765.jkim@FreeBSD.org> In-Reply-To: <200811031050.48765.jkim@FreeBSD.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:08:32 -0000 Jung-uk Kim wrote: > On Sunday 02 November 2008 07:50 am, Alexander Motin wrote: >> Author: mav >> Date: Sun Nov 2 12:50:16 2008 >> New Revision: 184558 >> URL: http://svn.freebsd.org/changeset/base/184558 >> >> Log: >> As soon as we have several threads per process now, it is not >> correct to use process ID as ACPI thread ID. Concurrent requests >> with equal thread IDs broke ACPI mutexes operation causing >> unpredictable errors including AE_AML_MUTEX_NOT_ACQUIRED that I >> have seen. >> >> Use kernel thread ID instead of process ID for ACPI thread. > > Sorry but this patch is incorrect, i.e., td_tid is not unique. You > have to use curthread or (p_pid, td_tid) pair. Unfortunately, even > if you correct this problem, you also have to correct ACPI_THREAD_ID > definition, which is in the vendor code. That's why it wasn't done > yet and it is more complicated than you think, i.e., ACPI-CA assumes > sizeof(ACPI_THREAD_ID) == sizeof(int), etc. Please see the related > ACPI-CA bugs: I'm also sorry, but that is what I see: typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */ ... td->td_tid = alloc_unr(tid_unrhdr); ... tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, &tid_lock); So what have I missed, where is the problem? Why td_tid is not unique and where is the size problem? -- Alexander Motin