From owner-svn-src-projects@FreeBSD.ORG Thu May 12 22:06:40 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E088106564A; Thu, 12 May 2011 22:06:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id C457B8FC12; Thu, 12 May 2011 22:06:39 +0000 (UTC) Received: by gwb15 with SMTP id 15so884077gwb.13 for ; Thu, 12 May 2011 15:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WeNuJA3WGWJkg5+gEUzakTwV3EGarr8+DM14REdcSMM=; b=BwktMzdu4+AHxc3un969gezZ9+X8/nveFsY/0TEGSoFNxdF8h4KWBJ+NlYhvUmjVzG TsImukz+VoRzK0bAfzAl0YUPowCS7CuFzIQGqKgX/GdzWSoZ28TpinWu1Ks5JT8+C4jI r9CKqxIKlhDPzLe3tbHRMw4S2I+QlB5sL7yxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=LTJtIUeeOFXskCMiWenK41/R9mZb+MpIeaPylMtNCrwDm8EknrV9Cv4bczx0v9CZz1 kYkT8wLkpezE/JYqT770merHG5aLzbM6NBIc7QrKGCiYb/0y0ebUfk64jr8eFij7EPNk x7SOR09uMmGY13mSz041ZVeGhKHgSw4uQTTyk= MIME-Version: 1.0 Received: by 10.236.180.36 with SMTP id i24mr842968yhm.305.1305237999027; Thu, 12 May 2011 15:06:39 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.111.33 with HTTP; Thu, 12 May 2011 15:06:38 -0700 (PDT) In-Reply-To: References: <201105080039.p480doiZ021493@svn.freebsd.org> Date: Fri, 13 May 2011 00:06:38 +0200 X-Google-Sender-Auth: y8pTsF4yO_uenflwywaK3HuOM_g Message-ID: From: Attilio Rao To: mdf@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Artem Belevich , Oleksandr Tymoshenko , Bruce Evans , svn-src-projects@freebsd.org, Warner Losh Subject: Re: svn commit: r221614 - projects/largeSMP/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 22:06:40 -0000 2011/5/12 : > On Thu, May 12, 2011 at 2:12 PM, Attilio Rao wrote: >> 2011/5/12 Artem Belevich : >>> On Thu, May 12, 2011 at 10:05 PM, Attilio Rao wro= te: >>>> I spoke in person with Artem and in the end I just decided to make the >>>> smallest possible subset of changes to fix the _long on 32 bits and >>>> then "completed" (as some of them already exist today) the macro >>>> converting the arguments to u_int stuff: >>>> http://www.freebsd.org/~attilio/largeSMP/mips-atomic2.diff >>> >>> Attilio, >>> >>> Let's get back for a second to the original issue you had that propted >>> you to do atomic ops changes. >>> If I understand you correctly, your code was passing cpuset_t* as an >>> argument to atomic_something_long and that caused compiler to complain >>> that cpuset_t* is not uint32_t*. >>> >>> Could you post definition of cpuset_t ? >>> >>> It's possible that compiler was actually correct. For instance, >>> compiler would be right to complain if cpuset_t is a packed structure, >>> even if that structure is made of a single uint32_t field. >> >> It doesn't do the atomic of =C2=A0cpuset_t, it does atomic of members of >> cpuset_t which are actually long. > > Isn't this an argument for making it an array of u_int, even though > it's marginally pessimal on amd64 and other 64-bit arches? =C2=A0There is > guaranteed support for a int-sized (or perhaps 32-bit sized) atomic > op. > There is also guaratees for long-sized atomic operations. I'm not sure what atomic(9) says, but the truth is that long on FreeBSD always matches word boundry, so there is no problem (Bruce thinks that long actually had to be double the size of words, hence the theoretically possible difficulties for atomic operation, but actually that never was the case on FreeBSD). Attilio --=20 Peace can only be achieved by understanding - A. Einstein