From owner-freebsd-current@FreeBSD.ORG Mon Jul 2 22:19:01 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4212116A421 for ; Mon, 2 Jul 2007 22:19:01 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.freebsd.org (Postfix) with ESMTP id CF4E313C45B for ; Mon, 2 Jul 2007 22:19:00 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by ug-out-1314.google.com with SMTP id o4so1002398uge for ; Mon, 02 Jul 2007 15:18:59 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=adziqe4uw7i30Qm9dv1RAsB/OAuIAowCzrUKAMEuKuJNZUzAZ98FPT5wD6uTD7gpScUb/lGEwHLuIvbnfKjmZ5nefrXd0FdEC5gnefKh5+aCvLxb8PEZJx11TBrVs0/qdzedmhdzpTSwQ/szb9t6pk/vyj/aIWs0wKR0NC6QfsY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=dKmavFignroHIi64OQ3z2yMB04l41R1xAbbCYduBbxM+LPaCdVZ87IC8N4WkfBCgfZHjnLaeNHnqMkCoZ+0O3eTQKeB1zexaUsJ5nhhpBx600VW5OgadMTM23uvOctjAN0N7nkyK8S2ZZXKEgSNQs6NrUWVKBH22GCs0Cpo61QQ= Received: by 10.78.176.20 with SMTP id y20mr3219898hue.1183414739526; Mon, 02 Jul 2007 15:18:59 -0700 (PDT) Received: by 10.78.97.18 with HTTP; Mon, 2 Jul 2007 15:18:59 -0700 (PDT) Message-ID: <3bbf2fe10707021518l3d4257d6o3b8838faa6d1ace5@mail.gmail.com> Date: Tue, 3 Jul 2007 00:18:59 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jeff Roberson" In-Reply-To: <20070701224741.M552@10.0.0.1> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070701224452.I552@10.0.0.1> <20070701224741.M552@10.0.0.1> X-Google-Sender-Auth: f6343d52dbb612a7 Cc: current@freebsd.org Subject: Re: New SCHED_SMP diff. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2007 22:19:01 -0000 2007/7/2, Jeff Roberson : > 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