Bug 109310 - --enable-link-mutex is quite duplicate to --enable-link-serialization
Summary: --enable-link-mutex is quite duplicate to --enable-link-serialization
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: patch
: 117401 (view as bug list)
Depends on:
Blocks: 84402
  Show dependency treegraph
 
Reported: 2023-03-28 04:16 UTC by Martin Liška
Modified: 2024-11-02 06:20 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2023-03-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2023-03-28 04:16:23 UTC
As mentioned in PR96794, --enable-link-mutex is problematic from LTO point of view as each linker invocation holds a jobserver token, and thus LTRANS phase runs with a limited number of jobs.

On the other hand, --enable-link-serialization works fine:
https://gist.githubusercontent.com/marxin/13895e6614c1d73301d05005ed4475b7/raw/bc5eb701024f3d0b912e4e3fb58b96e7abae327c/gcc13-serial-linking.svg

So my question is if we can drop --enable-link-mutex? Note the --enable-link-serialization option is more generic as it accepts an option argument (N).

I see only a minimal benefit of --enable-link-mutex and that's the fact it periodically prints a message that it attempts to acquire a lock. That can be useful for builder timeout when it comes to a very slow machine. But still, we should be able to link a FE in a reasonable amount of time.

Jakub, what do you think?
Comment 1 Jakub Jelinek 2023-03-28 05:50:33 UTC
So perhaps for GCC13 emit some kind of deprecation message for it and suggest using --enable-link-serialization instead and delete later?
Comment 2 Martin Liška 2023-03-29 13:00:15 UTC
(In reply to Jakub Jelinek from comment #1)
> So perhaps for GCC13 emit some kind of deprecation message for it and
> suggest using --enable-link-serialization instead and delete later?

Yes, I've just sent a patch:
https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614841.html
Comment 3 GCC Commits 2023-03-29 13:05:08 UTC
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:8b2766e87dbf0d20808bc92d8e6ee7f876d19ab2

commit r13-6929-g8b2766e87dbf0d20808bc92d8e6ee7f876d19ab2
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Mar 29 14:52:42 2023 +0200

    configure: deprecate --enable-link-mutex option
    
            PR bootstrap/109310
    
    gcc/ChangeLog:
    
            * configure.ac: Emit a warning for deprecated option
            --enable-link-mutex.
            * configure: Regenerate.
Comment 4 Andrew Pinski 2024-11-01 21:55:19 UTC
*** Bug 117401 has been marked as a duplicate of this bug. ***
Comment 5 Eric Gallager 2024-11-02 06:20:09 UTC
(In reply to GCC Commits from comment #3)
> The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:
> 
> https://gcc.gnu.org/g:8b2766e87dbf0d20808bc92d8e6ee7f876d19ab2
> 
> commit r13-6929-g8b2766e87dbf0d20808bc92d8e6ee7f876d19ab2
> Author: Martin Liska <mliska@suse.cz>
> Date:   Wed Mar 29 14:52:42 2023 +0200
> 
>     configure: deprecate --enable-link-mutex option
>     
>             PR bootstrap/109310
>     
>     gcc/ChangeLog:
>     
>             * configure.ac: Emit a warning for deprecated option
>             --enable-link-mutex.
>             * configure: Regenerate.

IMO this should also get a mention in the GCC 13 release notes:
https://gcc.gnu.org/gcc-13/changes.html