From owner-p4-projects@FreeBSD.ORG Fri Mar 24 20:43:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D30BD16A422; Fri, 24 Mar 2006 20:43:57 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F1D116A401 for ; Fri, 24 Mar 2006 20:43:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BC5C43D46 for ; Fri, 24 Mar 2006 20:43:57 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2OKhv0Q012267 for ; Fri, 24 Mar 2006 20:43:57 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2OKhvZX012264 for perforce@freebsd.org; Fri, 24 Mar 2006 20:43:57 GMT (envelope-from jhb@freebsd.org) Date: Fri, 24 Mar 2006 20:43:57 GMT Message-Id: <200603242043.k2OKhvZX012264@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 93945 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2006 20:43:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=93945 Change 93945 by jhb@jhb_twclab on 2006/03/24 20:43:26 The volatile cast didn't work on amd64 for some reason (gcc bug?). Just make the td_state member of struct thread volatile. Affected files ... .. //depot/projects/smpng/sys/kern/kern_mutex.c#120 edit .. //depot/projects/smpng/sys/sys/proc.h#168 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_mutex.c#120 (text+ko) ==== @@ -551,14 +551,8 @@ if (m != &Giant && TD_IS_RUNNING(owner)) { #endif turnstile_release(&m->mtx_object); - - /* - * Inline expansion of TD_IS_RUNNING(owner) to - * force volatile. - */ while (mtx_rawowner(m) == owner && - (volatile enum _td_state)owner->td_state == - TDS_RUNNING) { + TD_IS_RUNNING(owner)) { cpu_spinwait(); } continue; ==== //depot/projects/smpng/sys/sys/proc.h#168 (text+ko) ==== @@ -311,7 +311,7 @@ * or already have been set in the allocator, constructor, etc. */ struct pcb *td_pcb; /* (k) Kernel VA of pcb and kstack. */ - enum _td_state { + volatile enum { TDS_INACTIVE = 0x0, TDS_INHIBITED, TDS_CAN_RUN,