New SCHED_SMP diff.
Attilio Rao
attilio at freebsd.org
Mon Jul 2 22:19:01 UTC 2007
2007/7/2, Jeff Roberson <jroberson at chesapeake.net>:
> I forgot:
>
> http://people.freebsd.org/~jeff/schedsmp.diff
>
> --- amd64/amd64/cpu_switch.S 6 Jun 2007 07:35:07 -0000 1.158
> +++ amd64/amd64/cpu_switch.S 2 Jul 2007 05:43:31 -0000
> @@ -148,13 +148,7 @@
> movq %cr3,%rax
> cmpq %rcx,%rax /* Same address space? */
> jne swinact
> - movq %rdx, TD_LOCK(%rdi) /* Release the old thread */
> - /* Wait for the new thread to become unblocked */
> - movq $blocked_lock, %rdx
> -1:
> - movq TD_LOCK(%rsi),%rcx
> - cmpq %rcx, %rdx
> - je 1b
> + xchgq %rdx, TD_LOCK(%rdi) /* Release the old thread */
I don't think here you need an atomic instruction, a memory barrier
throug sfence is good enough in order to make thread migration
consistent.
Attilio
--
Peace can only be achieved by understanding - A. Einstein
More information about the freebsd-current
mailing list