From owner-p4-projects@FreeBSD.ORG Sun May 14 00:51:09 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 4946D16A404; Sun, 14 May 2006 00:51:09 +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 426B616A43E for ; Sun, 14 May 2006 00:51:08 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0D3243D58 for ; Sun, 14 May 2006 00:51:03 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4E0oxK7079070 for ; Sun, 14 May 2006 00:50:59 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4E0owtS079067 for perforce@freebsd.org; Sun, 14 May 2006 00:50:58 GMT (envelope-from jb@freebsd.org) Date: Sun, 14 May 2006 00:50:58 GMT Message-Id: <200605140050.k4E0owtS079067@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 97117 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: Sun, 14 May 2006 00:51:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=97117 Change 97117 by jb@jb_freebsd2 on 2006/05/14 00:50:01 Use the thread-local-key including the interrupt level from the per-cpu structure. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#22 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#22 (text+ko) ==== @@ -327,8 +327,8 @@ /* * The key for a thread-local variable consists of the lower 61 bits of the - * t_did, plus the 3 bits of the highest active interrupt above LOCK_LEVEL. - * We add DIF_VARIABLE_MAX to t_did to assure that the thread key is never + * td_tid, plus the 3 bits of the highest active interrupt. + * We add DIF_VARIABLE_MAX to td_tid to assure that the thread key is never * equal to a variable identifier. This is necessary (but not sufficient) to * assure that global associative arrays never collide with thread-local * variables. To guarantee that they cannot collide, we must also define the @@ -340,23 +340,15 @@ * no way for a global variable key signature to match a thread-local key * signature. */ -#if defined(sun) #define DTRACE_TLS_THRKEY(where) { \ uint_t intr = 0; \ - uint_t actv = CPU->cpu_intr_actv >> (LOCK_LEVEL + 1); \ + uint_t actv = pcpu_find(curcpu)->pc_intr_actv; \ for (; actv; actv >>= 1) \ intr++; \ ASSERT(intr < (1 << 3)); \ - (where) = ((curthread->t_did + DIF_VARIABLE_MAX) & \ - (((uint64_t)1 << 61) - 1)) | ((uint64_t)intr << 61); \ -} -#else -#define DTRACE_TLS_THRKEY(where) { \ - uint_t intr = 0; \ (where) = ((curthread->td_tid + DIF_VARIABLE_MAX) & \ (((uint64_t)1 << 61) - 1)) | ((uint64_t)intr << 61); \ } -#endif #define DTRACE_STORE(type, tomax, offset, what) \ *((type *)((uintptr_t)(tomax) + (uintptr_t)offset)) = (type)(what);