From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62430 invoked by alias); 2 Aug 2019 09:19:44 -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 62375 invoked by uid 89); 2 Aug 2019 09:19:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=invention, ambition X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Aug 2019 09:19:40 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 56548AF54; Fri, 2 Aug 2019 09:19:37 +0000 (UTC) Subject: Re: [PATCH] Properly detect working jobserver in gcc driver. To: Jan Hubicka , Richard Biener Cc: Jakub Jelinek , Jeff Law , GCC Patches , Michael Matz References: <20190801131932.GA2726@tucnak> <089f4b9d-a29a-5031-a272-e005cb5ce78c@suse.cz> <20190801144126.GC2726@tucnak> <20190802074450.GG2726@tucnak> <20190802085001.GK2726@tucnak> <20190802091543.spbiwrpkfgmc3wil@kam.mff.cuni.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <0221cd30-5ce4-624f-afe5-15525092821a@suse.cz> Date: Fri, 02 Aug 2019 09:19:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190802091543.spbiwrpkfgmc3wil@kam.mff.cuni.cz> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00126.txt.bz2 On 8/2/19 11:15 AM, Jan Hubicka wrote: >> On Fri, Aug 2, 2019 at 10:50 AM Jakub Jelinek wrote: >>> >>> On Fri, Aug 02, 2019 at 10:47:10AM +0200, Martin LiĀ¹ka wrote: >>>>> Can you strace if other fds are opened and not closed in the spot you had it >>>>> before? Advantage of doing it there is that it will not be done for all the >>>>> -E/-S/-c compilations when the linker is not spawned. >>>> >>>> I've used the same trick which you used and I'm attaching the output. >>>> I believe it's fine, I can't see any opened fd by GCC. >>> >>> LGTM. >> Hi. >> Btw, we discussed yesterday on the phone and the conclusion was to >> make -flto auto-detect a job-server (but not fall back to # of threads) >> and add -flto=auto to auto-detect a job-server and fall back to # of threads. >> That basically makes -flto=jobserver the default behavior which means >> we should document -flto=1 as a way to override jobserver detection. > > And concerning to the yesterday discussion, my preference would still be > -flto to first try presence of jobserver and default to number of > threads otherwise. It seems like user friendly default to me and other > tools with reasonable parallelism support usually behaves this way, too. I also like the default as Honza defined. > > Sure one can use -flto=auto everywhere but then one needs to use > different options for differnt compilers. It would be nice to make > -flto to do right hting for majority of users including those like me > who cut&paste command lines from Make output and execute them by hand. Note that our ambition is to ideally backport the patches to our gcc9 package. The auto-detection of job-server with -flto is a behavior change that will happen in the gcc9 package. To be honest I don't like the invention of 'auto' value for -flto command. That would be useful just for gcc9 right now :/ Martin > > The fork bombing is IMO relatively rare and it was not what Jakub ran > into (it was broken jobserv detection). > After all whole distro built with Martin's orriginal approach of > -flto= which forkbombs on every possible occasion. > > Said that, I could live with more conservative defaults. > Honza >