Date: Sun, 14 May 2006 00:50:58 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 97117 for review Message-ID: <200605140050.k4E0owtS079067@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605140050.k4E0owtS079067>