diff --git a/.github/workflows/freebsd-ci.yml b/.github/workflows/freebsd-ci.yml index f1693b7f..a48217af 100644 --- a/.github/workflows/freebsd-ci.yml +++ b/.github/workflows/freebsd-ci.yml @@ -17,12 +17,17 @@ jobs: matrix: debug: ['--enable-debug', '--disable-debug'] prof: ['--enable-prof', '--disable-prof'] + dps: ['', '--enable-dynamic-page-size'] arch: ['64-bit', '32-bit'] uncommon: - '' - '--with-lg-page=16 --with-malloc-conf=tcache:false' - - name: FreeBSD (${{ matrix.arch }}, debug=${{ matrix.debug }}, prof=${{ matrix.prof }}${{ matrix.uncommon && ', uncommon' || '' }}) + exclude: + - dps: '--enable-dynamic-page-size' + arch: '32-bit' + - dps: '--enable-dynamic-page-size' + uncommon: '--with-lg-page=16 --with-malloc-conf=tcache:false' + name: FreeBSD (${{ matrix.arch }}, debug=${{ matrix.debug }}, prof=${{ matrix.prof }}${{ matrix.dps && format(', dps={0}', matrix.dps) || '' }}${{ matrix.uncommon && ', uncommon' || '' }}) steps: - uses: actions/checkout@v7 @@ -53,7 +58,7 @@ jobs: autoconf # Configure with matrix options - ./configure --with-jemalloc-prefix=ci_ ${{ matrix.debug }} ${{ matrix.prof }} ${{ matrix.uncommon }} + ./configure --with-jemalloc-prefix=ci_ ${{ matrix.debug }} ${{ matrix.prof }} ${{ matrix.dps }} ${{ matrix.uncommon }} # Get CPU count for parallel builds export JFLAG=$(sysctl -n kern.smp.cpus) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 3740a924..35d15b5f 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -62,6 +62,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: --with-lg-page=16 EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-dynamic-page-size + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -123,6 +128,11 @@ jobs: CXX: clang++ CONFIGURE_FLAGS: --with-lg-page=16 EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes" + - env: + CC: clang + CXX: clang++ + CONFIGURE_FLAGS: --enable-dynamic-page-size + EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes" - env: CC: clang CXX: clang++ @@ -250,6 +260,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--enable-debug --with-lg-page=16" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-debug --enable-dynamic-page-size" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -295,6 +310,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--enable-prof --with-lg-page=16" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-prof --enable-dynamic-page-size" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -335,6 +355,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--disable-stats --with-lg-page=16" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--disable-stats --enable-dynamic-page-size" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -370,6 +395,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--disable-libdl --with-lg-page=16" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--disable-libdl --enable-dynamic-page-size" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -400,6 +430,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--enable-opt-safety-checks --with-lg-page=16" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-opt-safety-checks --enable-dynamic-page-size" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -450,6 +485,31 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--with-lg-page=16 --with-malloc-conf=background_thread:true" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --enable-prof --enable-prof-libunwind" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-malloc-conf=tcache:false" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-malloc-conf=dss:primary" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-malloc-conf=percpu_arena:percpu" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-malloc-conf=background_thread:true" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -530,6 +590,86 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--enable-cxx-infallible-new --enable-debug" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=12 --with-malloc-conf=lg_page:12 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=13 --with-malloc-conf=lg_page:12 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=13 --with-malloc-conf=lg_page:13 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=14 --with-malloc-conf=lg_page:12 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=14 --with-malloc-conf=lg_page:13 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=14 --with-malloc-conf=lg_page:14 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=15 --with-malloc-conf=lg_page:12 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=15 --with-malloc-conf=lg_page:13 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=15 --with-malloc-conf=lg_page:14 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=15 --with-malloc-conf=lg_page:15 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=16 --with-malloc-conf=lg_page:12 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=16 --with-malloc-conf=lg_page:13 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=16 --with-malloc-conf=lg_page:14 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=16 --with-malloc-conf=lg_page:15 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=16 --with-malloc-conf=lg_page:16 --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --with-min-lg-page=12 --with-max-lg-page=16 --with-malloc-conf=lg_page:12" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" steps: - uses: actions/checkout@v7 @@ -658,6 +798,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--with-lg-page=16 --with-lg-hugepage=29" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-dynamic-page-size + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" - env: CC: gcc CXX: g++ @@ -688,6 +833,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: --enable-cxx-infallible-new EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index b6b17c46..a72633da 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -50,6 +50,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: --with-lg-page=16 EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-dynamic-page-size + EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" - env: CC: gcc CXX: g++ @@ -65,6 +70,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: --enable-cxx-infallible-new EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" steps: - uses: actions/checkout@v7 @@ -157,6 +167,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--with-lg-page=16 --with-lg-hugepage=29" EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-dynamic-page-size + EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" - env: CC: gcc CXX: g++ @@ -172,6 +187,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: --enable-cxx-infallible-new EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-dynamic-page-size --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" steps: - uses: actions/checkout@v7 diff --git a/scripts/gen_gh_actions.py b/scripts/gen_gh_actions.py index 8d78241a..b6e454eb 100755 --- a/scripts/gen_gh_actions.py +++ b/scripts/gen_gh_actions.py @@ -107,6 +107,7 @@ configure_flag_unusuals = [Option.as_configure_flag(opt) for opt in ( '--enable-opt-safety-checks', '--with-lg-page=16', '--with-lg-page=16 --with-lg-hugepage=29', + '--enable-dynamic-page-size', )] LARGE_HUGEPAGE = Option.as_configure_flag("--with-lg-page=16 --with-lg-hugepage=29") @@ -119,6 +120,22 @@ malloc_conf_unusuals = [Option.as_malloc_conf(opt) for opt in ( )] +# Pairs of configure flag fragments that configure.ac rejects outright. A +# combination containing both sides of a pair would fail at ./configure time, +# so it must never be emitted. +conflicting_configure_flags = ( + ('--enable-dynamic-page-size', '--with-lg-page'), + ('--enable-dynamic-page-size', 'CROSS_COMPILE_32BIT'), +) + + +def has_flag_conflict(combination): + flags = ' '.join(x.value for x in combination + if (x.type == Option.Type.CONFIGURE_FLAG or x.type == Option.Type.FEATURE)) + return any(first in flags and second in flags + for first, second in conflicting_configure_flags) + + all_unusuals = (compilers_unusual + feature_unusuals + configure_flag_unusuals + malloc_conf_unusuals) @@ -200,7 +217,8 @@ def generate_job_matrix_entries(os, arch, exclude, max_unusual_opts, unusuals=al entries = [] for combination in chain.from_iterable( [combinations(unusuals, i) for i in range(max_unusual_opts + 1)]): - if not any(excluded in combination for excluded in exclude): + if (not any(excluded in combination for excluded in exclude) + and not has_flag_conflict(combination)): env_dict = format_env_dict(os, arch, combination) entries.append(env_dict) return entries @@ -313,6 +331,46 @@ def generate_linux_job(arch): } ] + MIN_LG_PAGE = 0 + MAX_LG_PAGE = 0 + if arch == AMD64: + MIN_LG_PAGE = 12 + MAX_LG_PAGE = 16 + + dps_flags = [] + if 0 < MIN_LG_PAGE: + min_lg_page = MIN_LG_PAGE + for max_lg_page in range(min_lg_page, MAX_LG_PAGE + 1): + for lg_page in range(min_lg_page, max_lg_page + 1): + flags_list = [ + f'--enable-dynamic-page-size', + f'--with-min-lg-page={min_lg_page}', + f'--with-max-lg-page={max_lg_page}', + f'--with-malloc-conf=lg_page:{lg_page}', + f'--enable-debug', + ] + flags = ' '.join(flags_list) + dps_flags.append(flags) + flags_list = [ + f'--enable-dynamic-page-size', + f'--with-min-lg-page={MIN_LG_PAGE}', + f'--with-max-lg-page={MAX_LG_PAGE}', + f'--with-malloc-conf=lg_page:{MIN_LG_PAGE}', + ] + dps_flags.append(' '.join(flags_list)) + + if arch == ARM64: + dps_flags.append('--enable-dynamic-page-size --enable-debug') + + dps_entries = [] + for flags in dps_flags: + dps_entries.append({ + 'CC': 'gcc', + 'CXX': 'g++', + 'CONFIGURE_FLAGS': flags, + 'EXTRA_CFLAGS': '-Werror -Wno-array-bounds' + }) + # --enable-cxx-infallible-new coverage. Plain variant runs on all arches; # debug-combined variant runs only on AMD64 to bound matrix size. infallible_new_entries = [ @@ -348,6 +406,14 @@ def generate_linux_job(arch): else: job += f" {key}: {value}\n" + for entry in dps_entries: + job += " - env:\n" + for key, value in entry.items(): + if ' ' in str(value): + job += f' {key}: "{value}"\n' + else: + job += f" {key}: {value}\n" + job += f""" steps: - uses: actions/checkout@v7 @@ -481,7 +547,15 @@ def generate_macos_job(arch): 'EXTRA_CFLAGS': macos_extra_cflags }, ] - for entry in infallible_new_entries: + dps_entries = [ + { + 'CC': 'gcc', + 'CXX': 'g++', + 'CONFIGURE_FLAGS': '--enable-dynamic-page-size --enable-debug', + 'EXTRA_CFLAGS': macos_extra_cflags + }, + ] + for entry in infallible_new_entries + dps_entries: job += " - env:\n" for key, value in entry.items(): if ' ' in str(value) or any(c in str(value) for c in [':', ',', '#']): @@ -704,12 +778,17 @@ def generate_freebsd_job(arch): matrix: debug: ['--enable-debug', '--disable-debug'] prof: ['--enable-prof', '--disable-prof'] + dps: ['', '--enable-dynamic-page-size'] arch: ['64-bit', '32-bit'] uncommon: - '' - '--with-lg-page=16 --with-malloc-conf=tcache:false' - - name: FreeBSD (${{{{ matrix.arch }}}}, debug=${{{{ matrix.debug }}}}, prof=${{{{ matrix.prof }}}}${{{{ matrix.uncommon && ', uncommon' || '' }}}}) + exclude: + - dps: '--enable-dynamic-page-size' + arch: '32-bit' + - dps: '--enable-dynamic-page-size' + uncommon: '--with-lg-page=16 --with-malloc-conf=tcache:false' + name: FreeBSD (${{{{ matrix.arch }}}}, debug=${{{{ matrix.debug }}}}, prof=${{{{ matrix.prof }}}}${{{{ matrix.dps && format(', dps={{0}}', matrix.dps) || '' }}}}${{{{ matrix.uncommon && ', uncommon' || '' }}}}) steps: - uses: actions/checkout@v7 @@ -740,7 +819,7 @@ def generate_freebsd_job(arch): autoconf # Configure with matrix options - ./configure --with-jemalloc-prefix=ci_ ${{{{ matrix.debug }}}} ${{{{ matrix.prof }}}} ${{{{ matrix.uncommon }}}} + ./configure --with-jemalloc-prefix=ci_ ${{{{ matrix.debug }}}} ${{{{ matrix.prof }}}} ${{{{ matrix.dps }}}} ${{{{ matrix.uncommon }}}} # Get CPU count for parallel builds export JFLAG=$(sysctl -n kern.smp.cpus)