From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66270 invoked by alias); 3 Oct 2016 16:46:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 65743 invoked by uid 89); 3 Oct 2016 16:46:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1194 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Oct 2016 16:46:44 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18D8861A0F; Mon, 3 Oct 2016 16:46:43 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-162.phx2.redhat.com [10.3.116.162]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u93Gkgjt031418; Mon, 3 Oct 2016 12:46:42 -0400 Subject: Re: [PATCH] Set -fprofile-update=atomic when -pthread is present To: Nathan Sidwell , =?UTF-8?Q?Martin_Li=c5=a1ka?= , Andi Kleen References: <87f2bc4f-c4df-eadd-aec6-a937ed0ccaba@acm.org> <1253ac69-3301-f185-e43a-a34cadf8f51e@suse.cz> <67fda6d2-9b3e-a0d1-effc-34e1115030b2@acm.org> <1ff3cc75-7cee-79f3-395b-ef7a4d286a3d@acm.org> <04a05835-4666-4d7d-c1a9-d4bcc4ea924a@suse.cz> <87k2fpdatl.fsf@tassilo.jf.intel.com> <6f8b1905-818b-bfff-1bf3-5ba04f3b4b64@suse.cz> <20160818155130.GE5871@two.firstfloor.org> <631cf1bd-8ae9-f07b-5672-5084b699f650@redhat.com> <2c750f4c-c96c-2b22-43ae-53bbebf18af8@suse.cz> <73aa44d7-5287-e4b8-6188-a87d52d3d6b9@acm.org> Cc: gcc-patches@gcc.gnu.org, jh@suse.cz From: Jeff Law Message-ID: <73a8abe7-3d49-4be0-54ba-e2de8af71b73@redhat.com> Date: Mon, 03 Oct 2016 16:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <73aa44d7-5287-e4b8-6188-a87d52d3d6b9@acm.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00092.txt.bz2 On 10/03/2016 06:26 AM, Nathan Sidwell wrote: > On 10/03/16 08:13, Martin Liška wrote: >> On 08/18/2016 05:53 PM, Jeff Law wrote: >>> On 08/18/2016 09:51 AM, Andi Kleen wrote: >>>>> I'd prefer to make updates atomic in multi-threaded applications. >>>>> The best proxy we have for that is -pthread. >>>>> >>>>> Is it slower, most definitely, but odds are we're giving folks >>>>> garbage data otherwise, which in many ways is even worse. >>>> >>>> It will likely be catastrophically slower in some cases. >>>> >>>> Catastrophically as in too slow to be usable. >>>> >>>> An atomic instruction is a lot more expensive than a single >>>> increment. Also >>>> they sometimes are really slow depending on the state of the machine. >>> And for those cases there's a way to override. >>> >>> The default should be set for correctness. >>> >>> jeff >> >> I would to somehow resolve the discussion related to default value >> selection. >> Is the prevailing consensus that we should set -fprofile-update=atomic >> when >> -pthread is set? If so, I'll prepare a patch. I tend to do it this way. > > This is my preference. Likewise. jeff