Bug 77510 - genautomata memory footprint for MIPS
Summary: genautomata memory footprint for MIPS
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 5.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build, memory-hog
Depends on:
Blocks:
 
Reported: 2016-09-07 09:09 UTC by Leonid Lisovskiy
Modified: 2020-11-03 05:22 UTC (History)
4 users (show)

See Also:
Host:
Target: MIPS*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-06-28 00:00:00


Attachments
genautomata output MIPS32 (3.42 KB, text/plain)
2016-09-07 09:09 UTC, Leonid Lisovskiy
Details
testing patch (1.58 KB, patch)
2020-07-03 08:06 UTC, Paul Hua
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Lisovskiy 2016-09-07 09:09:57 UTC
Created attachment 39578 [details]
genautomata output MIPS32

Hello,

bootstrapping/crosscompiling gcc 5.4.0 for MIPS, genautomata uses a lot of memory. This causes swapping/thrashing and extremely long build times on low memory systems. According to valgrind massif report, it requires 527MB of heap now.

genautomata output(-time -progress -stats) attached to PR. Probably we need to try to decrease reservations for `xlp_cpu', `xlp_fpu' since simple disable(comment out it in mips.md) of xlp support decreases heap usage down to 43MB.

Similar to bug 70473, which requests that a new bug is filed.
Thank you for your attention!
Comment 1 Eric Gallager 2018-07-08 22:22:05 UTC
I haven't tested for MIPS specifically but I believe it given the genautomata memory footprint on other architectures, so I'll confirm.
Comment 2 Eric Gallager 2019-07-08 04:24:40 UTC
cc-ing MIPS maintainer
Comment 3 Hans-Peter Nilsson 2020-06-28 02:55:01 UTC
I guess I can just add that this problem has only became worse.
With LAST_UPDATED
Fri Jun 26 21:36:32 CEST 2020
Fri Jun 26 19:36:32 UTC 2020 (revision 0fce12c0920:2873383514d:0801f419440c14f6772b28f763ad7d40f7f7a580)
(a.k.a r11-1677)
I just tried to build on CompileFarm gcc24, which is a "EdgeRouter Pro" mips64 with 2 GB memory but no swap, and with "gcc version 8.3.0 (Debian 8.3.0-6)".
Needless to say, genautomata fails.  Also tried in vain: configuring with --enable-checking=release.
Comment 4 Paul Hua 2020-07-03 03:47:42 UTC
I do some testing, adding scheduling description file one by one order by on date.

file		added date	size(M) 
5400.md		8/20/2002	13 
5500.md		8/20/2002	13 
sr71k.md	8/20/2002	18 
7000.md		7/15/2003	20 
9000.md		7/15/2003	22 
sb1.md		4/21/2004	23 
4130.md		5/6/2004	24 
3000.md		6/24/2004	25 
4000.md		7/12/2004	25 
4100.md		7/12/2004	25 
4300.md		7/12/2004	25 
4600.md		7/12/2004	25 
5000.md		7/12/2004	26 
6000.md		7/12/2004	26 
generic.md	7/12/2004	26 
24k.md		5/9/2005	35 
4k.md		5/13/2005	36 
5k.md		7/29/2005	38 
74k.md		4/16/2007	42 
20kc.md		7/16/2007	46 
xlr.md		6/6/2008	47 
loongson2ef.md	6/15/2008	51 
octeon.md	9/21/2008	53 
10000.md	10/6/2008	58 
xlp.md		7/22/2012	450 
p5600.md	6/5/2014	1370 
m5100.md	7/22/2015	1382 
i6400.md	7/23/2015	1502 
p6600.md	6/13/2018	2393 
gs464.md	11/7/2018	2403 
gs464e.md	11/7/2018	2411 
gs264e.md	11/7/2018	2419
Comment 5 Paul Hua 2020-07-03 08:06:36 UTC
Created attachment 48830 [details]
testing patch

this patch reduce reservation of model do not more than 10 cycles. The memory of genautomata down to 1GB.

the patch modified files:

        modified:   gcc/config/mips/gs464.md
        modified:   gcc/config/mips/i6400.md
        modified:   gcc/config/mips/m5100.md
        modified:   gcc/config/mips/p5600.md
        modified:   gcc/config/mips/p6600.md
        modified:   gcc/config/mips/xlp.md
        modified:   gcc/config/mips/xlr.md

I will do some performance test on Loongson 3A1000 (gs464) target.

If someone has other machines, pleae do some performance test.
Comment 6 Eric Gallager 2020-11-03 05:22:41 UTC
(In reply to Paul Hua from comment #5)
> Created attachment 48830 [details]
> testing patch
> 
> this patch reduce reservation of model do not more than 10 cycles. The
> memory of genautomata down to 1GB.
> 
> the patch modified files:
> 
>         modified:   gcc/config/mips/gs464.md
>         modified:   gcc/config/mips/i6400.md
>         modified:   gcc/config/mips/m5100.md
>         modified:   gcc/config/mips/p5600.md
>         modified:   gcc/config/mips/p6600.md
>         modified:   gcc/config/mips/xlp.md
>         modified:   gcc/config/mips/xlr.md
> 
> I will do some performance test on Loongson 3A1000 (gs464) target.
> 
> If someone has other machines, pleae do some performance test.

Please submit this patch to the gcc-patches mailing list for review.