public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Make tunable a default feature
@ 2023-03-13 19:06 Adhemerval Zanella
  2023-03-13 19:06 ` [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable Adhemerval Zanella
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Adhemerval Zanella @ 2023-03-13 19:06 UTC (permalink / raw)
  To: libc-alpha, Siddhesh Poyarekar, Florian Weimer

It is enabled as default since 2.26, some features option require it
(such as hwcap mask, huge pages support, and lock elisition tuning),
and assuming its support also simplifies the build permutation.

Adhemerval Zanella (2):
  elf: Remove glibc.rtld.dynamic_sort tunable
  Remove --enable-tunables configure option

 INSTALL                                       |  19 ---
 Makeconfig                                    |   4 -
 NEWS                                          |   3 +
 config.h.in                                   |   3 -
 config.make.in                                |   1 -
 configure                                     |  17 ---
 configure.ac                                  |  10 --
 elf/Makefile                                  |   8 +-
 elf/dl-cache.c                                |   2 +-
 elf/dl-hwcaps.h                               |  11 --
 elf/dl-sort-maps.c                            | 139 +-----------------
 elf/dl-support.c                              |  15 --
 elf/dl-tls.c                                  |   6 -
 elf/dl-tunables.h                             |  35 ++---
 elf/dl-tunables.list                          |   9 --
 elf/dl-usage.c                                |   8 +-
 elf/dso-sort-tests-1.def                      |  15 +-
 elf/dso-sort-tests-2.def                      |  10 +-
 elf/rtld.c                                    |  23 +--
 elf/tst-env-setuid-tunables.c                 |  11 --
 elf/tst-rtld-list-tunables.exp                |   1 -
 gmon/gmon.c                                   |  12 +-
 malloc/Makefile                               |   2 -
 malloc/arena.c                                | 118 +--------------
 malloc/malloc-check.c                         |   8 -
 malloc/malloc.c                               |  14 +-
 manual/install.texi                           |  19 ---
 manual/tunables.texi                          |  13 --
 nptl/pthread_mutex_conf.c                     |   4 +-
 nptl/tst-mutex8.c                             |   2 -
 scripts/build-many-glibcs.py                  |   1 -
 sysdeps/generic/ldsodefs.h                    |  17 ---
 sysdeps/generic/unsecvars.h                   |   8 +-
 sysdeps/mach/hurd/dl-sysdep.c                 |   3 -
 sysdeps/nptl/dl-tls_init_tp.c                 |   2 -
 sysdeps/nptl/pthreadP.h                       |   4 -
 sysdeps/nptl/pthread_early_init.h             |   2 -
 sysdeps/nptl/pthread_mutex_conf.h             |   8 -
 sysdeps/powerpc/cpu-features.c                |   9 +-
 sysdeps/s390/cpu-features.c                   |  14 +-
 sysdeps/sparc/sparc32/dl-machine.h            |   5 +-
 sysdeps/unix/sysv/linux/Makefile              |   4 +-
 .../unix/sysv/linux/aarch64/cpu-features.c    |   6 -
 sysdeps/unix/sysv/linux/dl-sysdep.c           |   3 -
 .../unix/sysv/linux/powerpc/elision-conf.c    |   8 +-
 sysdeps/unix/sysv/linux/s390/elision-conf.c   |   8 +-
 sysdeps/unix/sysv/linux/x86/elision-conf.c    |   8 +-
 sysdeps/unix/sysv/linux/x86_64/64/Makefile    |   2 -
 sysdeps/x86/Makefile                          |  10 --
 sysdeps/x86/cacheinfo.h                       |   8 +-
 sysdeps/x86/cpu-features.c                    |  24 +--
 sysdeps/x86/cpu-tunables.c                    |  45 +++---
 sysdeps/x86/dl-cacheinfo.h                    |  10 --
 sysdeps/x86_64/Makefile                       |   2 -
 54 files changed, 80 insertions(+), 673 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable
  2023-03-13 19:06 [PATCH 0/2] Make tunable a default feature Adhemerval Zanella
@ 2023-03-13 19:06 ` Adhemerval Zanella
  2023-03-22 17:08   ` Siddhesh Poyarekar
  2023-03-13 19:06 ` [PATCH 2/2] Remove --enable-tunables configure option Adhemerval Zanella
  2023-03-14 18:02 ` [PATCH 0/2] Make tunable a default feature Siddhesh Poyarekar
  2 siblings, 1 reply; 18+ messages in thread
From: Adhemerval Zanella @ 2023-03-13 19:06 UTC (permalink / raw)
  To: libc-alpha, Siddhesh Poyarekar, Florian Weimer

And make the DFS algorithm (added on 2.35) the de-facto implementation.
---
 elf/dl-sort-maps.c                  | 139 +---------------------------
 elf/dl-tunables.list                |   9 --
 elf/dso-sort-tests-1.def            |  15 +--
 elf/dso-sort-tests-2.def            |  10 +-
 elf/tst-rtld-list-tunables.exp      |   1 -
 manual/tunables.texi                |  13 ---
 sysdeps/mach/hurd/dl-sysdep.c       |   3 -
 sysdeps/unix/sysv/linux/dl-sysdep.c |   3 -
 8 files changed, 8 insertions(+), 185 deletions(-)

diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
index 325e96388e..72ca5cec33 100644
--- a/elf/dl-sort-maps.c
+++ b/elf/dl-sort-maps.c
@@ -20,112 +20,6 @@
 #include <ldsodefs.h>
 #include <elf/dl-tunables.h>
 
-/* Note: this is the older, "original" sorting algorithm, being used as
-   default up to 2.35.
-
-   Sort array MAPS according to dependencies of the contained objects.
-   If FOR_FINI is true, this is called for finishing an object.  */
-static void
-_dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
-			bool force_first, bool for_fini)
-{
-  /* Allows caller to do the common optimization of skipping the first map,
-     usually the main binary.  */
-  maps += force_first;
-  nmaps -= force_first;
-
-  /* A list of one element need not be sorted.  */
-  if (nmaps <= 1)
-    return;
-
-  unsigned int i = 0;
-  uint16_t seen[nmaps];
-  memset (seen, 0, nmaps * sizeof (seen[0]));
-  while (1)
-    {
-      /* Keep track of which object we looked at this round.  */
-      ++seen[i];
-      struct link_map *thisp = maps[i];
-
-      if (__glibc_unlikely (for_fini))
-	{
-	  /* Do not handle ld.so in secondary namespaces and objects which
-	     are not removed.  */
-	  if (thisp != thisp->l_real || thisp->l_idx == -1)
-	    goto skip;
-	}
-
-      /* Find the last object in the list for which the current one is
-	 a dependency and move the current object behind the object
-	 with the dependency.  */
-      unsigned int k = nmaps - 1;
-      while (k > i)
-	{
-	  struct link_map **runp = maps[k]->l_initfini;
-	  if (runp != NULL)
-	    /* Look through the dependencies of the object.  */
-	    while (*runp != NULL)
-	      if (__glibc_unlikely (*runp++ == thisp))
-		{
-		move:
-		  /* Move the current object to the back past the last
-		     object with it as the dependency.  */
-		  memmove (&maps[i], &maps[i + 1],
-			   (k - i) * sizeof (maps[0]));
-		  maps[k] = thisp;
-
-		  if (seen[i + 1] > nmaps - i)
-		    {
-		      ++i;
-		      goto next_clear;
-		    }
-
-		  uint16_t this_seen = seen[i];
-		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
-		  seen[k] = this_seen;
-
-		  goto next;
-		}
-
-	  if (__glibc_unlikely (for_fini && maps[k]->l_reldeps != NULL))
-	    {
-	      unsigned int m = maps[k]->l_reldeps->act;
-	      struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
-
-	      /* Look through the relocation dependencies of the object.  */
-	      while (m-- > 0)
-		if (__glibc_unlikely (relmaps[m] == thisp))
-		  {
-		    /* If a cycle exists with a link time dependency,
-		       preserve the latter.  */
-		    struct link_map **runp = thisp->l_initfini;
-		    if (runp != NULL)
-		      while (*runp != NULL)
-			if (__glibc_unlikely (*runp++ == maps[k]))
-			  goto ignore;
-		    goto move;
-		  }
-	    ignore:;
-	    }
-
-	  --k;
-	}
-
-    skip:
-      if (++i == nmaps)
-	break;
-    next_clear:
-      memset (&seen[i], 0, (nmaps - i) * sizeof (seen[0]));
-
-    next:;
-    }
-}
-
-#if !HAVE_TUNABLES
-/* In this case, just default to the original algorithm.  */
-strong_alias (_dl_sort_maps_original, _dl_sort_maps);
-#else
-
 /* We use a recursive function due to its better clarity and ease of
    implementation, as well as faster execution speed. We already use
    alloca() for list allocation during the breadth-first search of
@@ -180,9 +74,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
 /* Topologically sort array MAPS according to dependencies of the contained
    objects.  */
 
-static void
-_dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
-		   bool force_first, bool for_fini)
+void
+_dl_sort_maps (struct link_map **maps, unsigned int nmaps, bool force_first,
+	       bool for_fini)
 {
   struct link_map *first_map = maps[0];
   for (int i = nmaps - 1; i >= 0; i--)
@@ -289,30 +183,3 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
       maps[0] = first_map;
     }
 }
-
-void
-_dl_sort_maps_init (void)
-{
-  int32_t algorithm = TUNABLE_GET (glibc, rtld, dynamic_sort, int32_t, NULL);
-  GLRO(dl_dso_sort_algo) = algorithm == 1 ? dso_sort_algorithm_original
-					  : dso_sort_algorithm_dfs;
-}
-
-void
-_dl_sort_maps (struct link_map **maps, unsigned int nmaps,
-	       bool force_first, bool for_fini)
-{
-  /* It can be tempting to use a static function pointer to store and call
-     the current selected sorting algorithm routine, but experimentation
-     shows that current processors still do not handle indirect branches
-     that efficiently, plus a static function pointer will involve
-     PTR_MANGLE/DEMANGLE, further impairing performance of small, common
-     input cases. A simple if-case with direct function calls appears to
-     be the fastest.  */
-  if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
-    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
-  else
-    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
-}
-
-#endif /* HAVE_TUNABLES.  */
diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list
index 695ba7192e..b9fa831000 100644
--- a/elf/dl-tunables.list
+++ b/elf/dl-tunables.list
@@ -162,15 +162,6 @@ glibc {
     }
   }
 
-  rtld {
-    dynamic_sort {
-      type: INT_32
-      minval: 1
-      maxval: 2
-      default: 2
-    }
-  }
-
   gmon {
     minarcs {
       type: INT_32
diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
index 4bf9052db1..f5afd003d8 100644
--- a/elf/dso-sort-tests-1.def
+++ b/elf/dso-sort-tests-1.def
@@ -2,10 +2,6 @@
 # This file is to be processed by ../scripts/dso-ordering-test.py, see usage
 # in elf/Makefile for how it is executed.
 
-# We test both dynamic loader sorting algorithms
-tunable_option: glibc.rtld.dynamic_sort=1
-tunable_option: glibc.rtld.dynamic_sort=2
-
 # Sequence of single dependencies with no cycles.
 tst-dso-ordering1: a->b->c
 output: c>b>a>{}<a<b<c
@@ -56,18 +52,15 @@ output: b>a>{}<a<b
 # relocation(dynamic) dependencies. While this is technically unspecified, the
 # presumed reasonable practical behavior is for the destructor order to respect
 # the static DT_NEEDED links (here this means the a->b->c->d order).
-# The older dynamic_sort=1 algorithm does not achieve this, while the DFS-based
-# dynamic_sort=2 algorithm does, although it is still arguable whether going
-# beyond spec to do this is the right thing to do.
+# The DFS-based sorting algorithm does it, although it is still arguable whether
+# going beyond spec to do this is the right thing to do.
 # The below expected outputs are what the two algorithms currently produce
 # respectively, for regression testing purposes.
 tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
-output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
-output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
+output: {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
 
 # Test that even in the presence of dependency loops involving dlopen'ed
 # object, that object is initialized last (and not unloaded prematurely).
 # Final destructor order is indeterminate due to the cycle.
 tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
-output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
-output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
+output: {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
diff --git a/elf/dso-sort-tests-2.def b/elf/dso-sort-tests-2.def
index b79e79ecb7..183d311fba 100644
--- a/elf/dso-sort-tests-2.def
+++ b/elf/dso-sort-tests-2.def
@@ -1,11 +1,4 @@
 # Large DSO sorting testcase adapted from Red Hat Bugzilla 1162810
-#
-# Note that below we specify different expected outputs between dynamic_sort=1
-# and dynamic_sort=2 algorithms, due to circular dependencies in the testcase
-# causing different sorting behavior.  These expected outputs are what the two
-# algorithms currently produce, and are used for regression comparison tests.
-# They are not "definitively" correct outputs, for circular dependencies
-# inherently have unspecified behavior.
 
 xtest(tst-redhat-1162810):
 {}->A101
@@ -610,5 +603,4 @@ M30X22
 M30X23
 M30X24
 M30X25
-xfail_output(glibc.rtld.dynamic_sort=1): M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M27X14>M28X18>M27X15>M28X13>M27X11>M28X23>M27X25>M28X14>M28X25>M27X23>M27X22>M28X24>M27X21>M27X13>M27X19>M27X17>M26X11>M26X23>M26X21>M26X22>M26X20>M26X16>M25X21>M17X22>M15X15>M20X14>M20X16>M18X18>M28X12>M27X24>M25X17>M27X20>M26X18>M26X17>M27X16>M26X19>M25X18>M26X24>M25X20>M24X17>M23X18>M25X13>M26X13>M17X23>M16X16>M26X12>M25X12>M26X15>M24X19>M25X23>M25X24>M25X25>M24X20>M25X19>M24X21>M23X17>M22X21>M24X14>M23X22>M24X24>M22X20>M24X13>M25X11>M24X12>M25X15>M23X15>M25X16>M24X22>M23X13>M24X18>M23X14>M22X22>M21X20>M24X25>M23X16>M22X25>M21X19>M22X14>M23X11>M22X15>M21X18>M22X19>M21X17>M20X17>M19X17>M21X24>M21X12>M20X22>M19X16>M18X25>M19X21>M19X20>M18X24>M20X12>M19X11>M23X20>M22X24>M22X16>M21X21>M25X14>M23X19>M23X24>M20X24>M19X12>M18X15>M17X14>M16X18>M14X25>M16X22>M16X20>M17X17>M22X12>M21X11>M20X15>M18X22>M19X24>M19X18>M18X21>M17X16>M17X18>M16X21>M15X20>M19X22>M18X20>M18X11>M17X19>M16X17>M15X21>M16X14>M16X13>M15X22>M14X20>M17X25>M16X19>M14X21>M13X24>M12X12>M16X24>M15X23>M14X16>M16X15>M15X25>M15X11>M15X12>M14X15>M13X14>M14X22>M13X20>M12X13>M11X11>M22X23>M21X15>M21X16>M20X21>M20X20>M18X17>M19X25>M18X23>M21X13>M15X17>M15X18>M18X19>M17X24>M16X12>M17X13>M20X25>M19X23>M15X19>M14X13>M13X18>M15X13>M17X12>M16X11>M18X13>M18X12>M14X11>M14X24>M13X19>M15X14>M17X20>M20X11>M20X13>M21X14>M15X24>M14X12>M13X22>M14X23>M13X23>M14X19>M17X15>M16X25>M17X11>M18X14>M19X19>M21X25>M13X12>M13X11>M14X18>M13X13>M12X11>M15X16>M14X14>M27X12>M17X21>M20X23>M22X13>M21X22>M24X16>M24X15>M26X25>M23X25>M26X14>M23X12>M22X18>M24X11>M16X23>M19X14>M19X13>M21X23>M22X17>M23X23>M23X21>M25X22>M18X16>M19X15>M20X18>M20X19>M22X11>M24X23>C156>C118>C143>C137>C147>C106>C168>C113>C163>C155>C105>C146>C187>A150>C139>C180>C164>C193>C157>A191>C158>B188>A159>C184>C121>C154>B171>A105>C131>C104>B104>C161>C111>B145>C160>B155>A163>C112>C142>B148>C133>B198>A198>A115>C114>B157>A156>C175>B144>A120>C173>B184>A174>C126>B107>A139>C194>B194>A194>C116>B116>C166>B160>B110>A110>C128>B128>A128>C179>B162>A154>C186>B187>A179>C124>B181>A101>C153>B158>A136>C135>C176>A192>B133>A133>C177>B177>A177>C185>C103>B141>A141>C183>A162>C192>C129>B179>C144>B124>B183>C127>B127>A127>B108>A112>B153>A153>C167>B167>A186>A122>C162>A144>B149>C174>B131>A185>C141>B106>A126>A167>C140>B122>A170>C198>B143>C117>C123>B123>A147>A106>C200>B169>C191>B175>A123>B118>A182>C132>B151>A145>A104>A109>C159>C150>B119>A119>A178>B164>B114>A164>C181>A102>C122>B134>A157>A116>C195>B191>B111>C172>B172>A118>B129>A129>C149>A107>C170>B197>A197>A173>B168>A132>C107>B165>A160>A131>C188>A168>B109>C178>A189>A148>C119>C190>C120>B166>B176>C108>B135>B139>A103>B178>A169>B132>C125>C138>B163>A111>B170>C110>A165>C151>C169>C199>A138>C182>A135>B101>B142>C101>C148>B193>B152>A158>A199>C136>B137>A161>B120>A108>A149>A125>B113>A184>C171>A134>A175>A124>B150>B161>B102>A146>A187>C130>B192>B200>A200>A142>A183>C102>B105>B156>A176>C165>B147>A137>A196>B190>A190>B125>C134>C189>B126>B186>A166>B136>B195>A195>B154>B138>B112>B173>A117>B159>B182>A181>A140>C145>B117>A152>A193>C197>B130>A172>A113>A151>B115>A143>B140>B185>B103>A121>A180>A130>A171>B199>C196>B146>B180>C115>B174>B121>A188>B196>B189>C152>C109>A155>A114>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<A114<A155<C109<C152<B189<B196<A188<B121<B174<C115<B180<B146<C196<B199<A171<A130<A180<A121<B103<B185<B140<A143<B115<A151<A113<A172<B130<C197<A193<A152<B117<C145<A140<A181<B182<B159<A117<B173<B112<B138<B154<A195<B195<B136<A166<B186<B126<C189<C134<B125<A190<B190<A196<A137<B147<C165<A176<B156<B105<C102<A183<A142<A200<B200<B192<C130<A187<A146<B102<B161<B150<A124<A175<A134<C171<A184<B113<A125<A149<A108<B120<A161<B137<C136<A199<A158<B152<B193<C148<C101<B142<B101<A135<C182<A138<C199<C169<C151<A165<C110<B170<A111<B163<C138<C125<B132<A169<B178<A103<B139<B135<C108<B176<B166<C120<C190<C119<A148<A189<C178<B109<A168<C188<A131<A160<B165<C107<A132<B168<A173<A197<B197<C170<A107<C149<A129<B129<A118<B172<C172<B111<B191<C195<A116<A157<B134<C122<A102<C181<A164<B114<B164<A178<A119<B119<C150<C159<A109<A104<A145<B151<C132<A182<B118<A123<B175<C191<B169<C200<A106<A147<B123<C123<C117<B143<C198<A170<B122<C140<A167<A126<B106<C141<A185<B131<C174<B149<A144<C162<A122<A186<B167<C167<A153<B153<A112<B108<A127<B127<C127<B183<B124<C144<B179<C129<C192<A162<C183<A141<B141<C103<C185<A177<B177<C177<A133<B133<A192<C176<C135<A136<B158<C153<A101<B181<C124<A179<B187<C186<A154<B162<C179<A128<B128<C128<A110<B110<B160<C166<B116<C116<A194<B194<C194<A139<B107<C126<A174<B184<C173<A120<B144<C175<A156<B157<C114<A115<A198<B198<C133<B148<C142<C112<A163<B155<C160<B145<C111<C161<B104<C104<C131<A105<B171<C154<C121<C184<A159<B188<C158<A191<C157<C193<C164<C180<C139<A150<C187<C146<C105<C155<C163<C113<C168<C106<C147<C137<C143<C118<C156<M24X23<M22X11<M20X19<M20X18<M19X15<M18X16<M25X22<M23X21<M23X23<M22X17<M21X23<M19X13<M19X14<M16X23<M24X11<M22X18<M23X12<M26X14<M23X25<M26X25<M24X15<M24X16<M21X22<M22X13<M20X23<M17X21<M27X12<M14X14<M15X16<M12X11<M13X13<M14X18<M13X11<M13X12<M21X25<M19X19<M18X14<M17X11<M16X25<M17X15<M14X19<M13X23<M14X23<M13X22<M14X12<M15X24<M21X14<M20X13<M20X11<M17X20<M15X14<M13X19<M14X24<M14X11<M18X12<M18X13<M16X11<M17X12<M15X13<M13X18<M14X13<M15X19<M19X23<M20X25<M17X13<M16X12<M17X24<M18X19<M15X18<M15X17<M21X13<M18X23<M19X25<M18X17<M20X20<M20X21<M21X16<M21X15<M22X23<M11X11<M12X13<M13X20<M14X22<M13X14<M14X15<M15X12<M15X11<M15X25<M16X15<M14X16<M15X23<M16X24<M12X12<M13X24<M14X21<M16X19<M17X25<M14X20<M15X22<M16X13<M16X14<M15X21<M16X17<M17X19<M18X11<M18X20<M19X22<M15X20<M16X21<M17X18<M17X16<M18X21<M19X18<M19X24<M18X22<M20X15<M21X11<M22X12<M17X17<M16X20<M16X22<M14X25<M16X18<M17X14<M18X15<M19X12<M20X24<M23X24<M23X19<M25X14<M21X21<M22X16<M22X24<M23X20<M19X11<M20X12<M18X24<M19X20<M19X21<M18X25<M19X16<M20X22<M21X12<M21X24<M19X17<M20X17<M21X17<M22X19<M21X18<M22X15<M23X11<M22X14<M21X19<M22X25<M23X16<M24X25<M21X20<M22X22<M23X14<M24X18<M23X13<M24X22<M25X16<M23X15<M25X15<M24X12<M25X11<M24X13<M22X20<M24X24<M23X22<M24X14<M22X21<M23X17<M24X21<M25X19<M24X20<M25X25<M25X24<M25X23<M24X19<M26X15<M25X12<M26X12<M16X16<M17X23<M26X13<M25X13<M23X18<M24X17<M25X20<M26X24<M25X18<M26X19<M27X16<M26X17<M26X18<M27X20<M25X17<M27X24<M28X12<M18X18<M20X16<M20X14<M15X15<M17X22<M25X21<M26X16<M26X20<M26X22<M26X21<M26X23<M26X11<M27X17<M27X19<M27X13<M27X21<M28X24<M27X22<M27X23<M28X25<M28X14<M27X25<M28X23<M27X11<M28X13<M27X15<M28X18<M27X14<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
-output(glibc.rtld.dynamic_sort=2): M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18>M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M26X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X17>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17>M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M18X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X16>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22>M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M17X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X12>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146>C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138>C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174>C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130>C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168>C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140>C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188>C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183>C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191>C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120>C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156>C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175>C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137>C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124>C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148>C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119>C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145>C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186>C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101>C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141>C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<B110<C110<A127<B127<C127<A133<B133<C133<A141<B141<C141<A185<B185<C185<A177<B177<C177<A192<B192<C192<A103<B103<C103<A101<B101<C101<A165<B165<C165<A117<B117<C117<A153<B153<C153<A160<B160<C160<A186<B186<C186<A195<B195<C195<A157<B157<C157<A173<B173<C173<A161<B161<C161<A145<B145<C145<A116<B116<C116<A135<B135<C135<A136<B136<C136<A154<B154<C154<A119<B119<C119<A189<B189<C189<A149<B149<C149<A129<B129<C129<A169<B169<C169<A148<B148<C148<A111<B111<C111<A104<B104<C104<A178<B178<C178<A151<B151<C151<A124<B124<C124<A179<B179<C179<A128<B128<C128<A110<B156<C156<A155<B155<C155<A137<B137<C137<A113<B113<C113<A181<B181<C181<A105<B105<C105<A196<B196<C196<A175<B175<C175<A197<B197<C197<A193<B193<C193<A121<B121<C121<A125<B125<C125<A156<B198<C198<A170<B170<C170<A107<B107<C107<A132<B132<C132<A123<B123<C123<A120<B120<C120<A166<B166<C166<A194<B194<C194<A139<B139<C139<A108<B108<C108<A191<B191<C191<A144<B144<C144<A198<B150<C150<A147<B147<C147<A152<B152<C152<A183<B183<C183<A200<B200<C200<A106<B106<C106<A114<B114<C114<A199<B199<C199<A188<B188<C188<A131<B131<C131<A164<B164<C164<A158<B158<C112<A163<B163<C163<A140<B140<C140<A167<B167<C146<A134<B134<C134<A159<B159<C159<A109<B109<C109<A168<B168<C182<A182<B182<C168<A171<B171<C171<A184<B184<C184<A118<B118<C118<A130<B130<C130<A187<B187<C187<A172<B172<C172<A143<B115<C115<A176<B176<C176<A174<B102<C102<A142<B142<C142<A162<B162<C162<A122<B122<C122<A102<B174<C174<A138<B138<C138<A190<B190<C190<A126<B126<C126<A115<B143<C143<A180<B180<C180<A146<B146<C167<A112<B112<C158<A150<M28X12<M18X18<M20X16<M22X24<M24X23<M25X12<M15X15<M17X13<M19X21<M21X19<M23X12<M13X13<M14X18<M15X21<M17X19<M19X12<M21X25<M23X18<M24X17<M25X22<M26X16<M27X12<M17X17<M19X20<M21X23<M23X11<M24X16<M26X12<M16X16<M18X24<M20X22<M21X14<M22X16<M23X23<M24X12<M14X14<M16X17<M18X20<M19X22<M21X15<M22X12<M12X12<M13X22<M13X23<M13X24<M14X19<M14X25<M16X18<M17X15<M18X11<M19X11<M20X11<M21X12<M11X11<M12X11<M13X11<M14X12<M13X12<M14X23<M15X24<M12X13<M13X18<M14X13<M13X19<M14X24<M15X19<M14X11<M13X20<M14X20<M15X20<M14X22<M15X13<M16X20<M15X14<M14X21<M15X16<M16X21<M15X18<M13X14<M14X15<M15X25<M16X15<M15X11<M16X11<M15X12<M16X22<M17X12<M14X16<M15X22<M16X12<M17X22<M16X13<M17X18<M16X14<M17X14<M18X14<M15X23<M16X23<M17X23<M18X25<M19X15<M16X25<M17X16<M18X23<M16X24<M17X21<M15X17<M16X19<M17X24<M18X19<M17X25<M18X15<M19X25<M18X17<M17X11<M18X13<M19X19<M17X20<M18X21<M19X16<M19X17<M20X17<M19X18<M18X22<M19X14<M20X15<M20X12<M22X25<M20X13<M20X14<M18X12<M19X24<M20X21<M21X18<M19X13<M20X18<M21X13<M20X19<M20X20<M21X22<M18X16<M19X23<M20X25<M21X16<M22X23<M21X17<M21X11<M22X13<M22X14<M20X24<M21X20<M21X21<M22X17<M23X20<M22X18<M23X16<M25X11<M22X22<M20X23<M21X24<M22X19<M23X25<M22X20<M23X21<M24X24<M22X21<M23X19<M24X11<M23X22<M24X15<M22X11<M23X14<M24X18<M23X15<M24X13<M23X24<M24X25<M23X17<M24X19<M25X14<M22X15<M23X13<M24X20<M25X24<M25X25<M24X21<M25X20<M25X21<M24X22<M25X15<M25X16<M26X25<M26X11<M25X23<M24X14<M25X19<M26X13<M26X15<M26X20<M25X17<M26X21<M25X18<M26X17<M27X22<M27X23<M26X18<M26X19<M27X16<M28X14<M25X13<M26X22<M27X17<M26X23<M27X13<M27X14<M27X15<M26X24<M27X24<M28X25<M27X11<M28X18<M27X25<M26X14<M27X19<M27X20<M28X13<M27X21<M28X23<M28X24<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
+output: M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18>M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M26X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X17>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17>M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M18X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X16>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22>M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M17X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X12>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146>C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138>C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174>C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130>C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168>C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140>C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188>C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183>C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191>C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120>C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156>C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175>C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137>C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124>C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148>C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119>C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145>C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186>C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101>C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141>C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<B110<C110<A127<B127<C127<A133<B133<C133<A141<B141<C141<A185<B185<C185<A177<B177<C177<A192<B192<C192<A103<B103<C103<A101<B101<C101<A165<B165<C165<A117<B117<C117<A153<B153<C153<A160<B160<C160<A186<B186<C186<A195<B195<C195<A157<B157<C157<A173<B173<C173<A161<B161<C161<A145<B145<C145<A116<B116<C116<A135<B135<C135<A136<B136<C136<A154<B154<C154<A119<B119<C119<A189<B189<C189<A149<B149<C149<A129<B129<C129<A169<B169<C169<A148<B148<C148<A111<B111<C111<A104<B104<C104<A178<B178<C178<A151<B151<C151<A124<B124<C124<A179<B179<C179<A128<B128<C128<A110<B156<C156<A155<B155<C155<A137<B137<C137<A113<B113<C113<A181<B181<C181<A105<B105<C105<A196<B196<C196<A175<B175<C175<A197<B197<C197<A193<B193<C193<A121<B121<C121<A125<B125<C125<A156<B198<C198<A170<B170<C170<A107<B107<C107<A132<B132<C132<A123<B123<C123<A120<B120<C120<A166<B166<C166<A194<B194<C194<A139<B139<C139<A108<B108<C108<A191<B191<C191<A144<B144<C144<A198<B150<C150<A147<B147<C147<A152<B152<C152<A183<B183<C183<A200<B200<C200<A106<B106<C106<A114<B114<C114<A199<B199<C199<A188<B188<C188<A131<B131<C131<A164<B164<C164<A158<B158<C112<A163<B163<C163<A140<B140<C140<A167<B167<C146<A134<B134<C134<A159<B159<C159<A109<B109<C109<A168<B168<C182<A182<B182<C168<A171<B171<C171<A184<B184<C184<A118<B118<C118<A130<B130<C130<A187<B187<C187<A172<B172<C172<A143<B115<C115<A176<B176<C176<A174<B102<C102<A142<B142<C142<A162<B162<C162<A122<B122<C122<A102<B174<C174<A138<B138<C138<A190<B190<C190<A126<B126<C126<A115<B143<C143<A180<B180<C180<A146<B146<C167<A112<B112<C158<A150<M28X12<M18X18<M20X16<M22X24<M24X23<M25X12<M15X15<M17X13<M19X21<M21X19<M23X12<M13X13<M14X18<M15X21<M17X19<M19X12<M21X25<M23X18<M24X17<M25X22<M26X16<M27X12<M17X17<M19X20<M21X23<M23X11<M24X16<M26X12<M16X16<M18X24<M20X22<M21X14<M22X16<M23X23<M24X12<M14X14<M16X17<M18X20<M19X22<M21X15<M22X12<M12X12<M13X22<M13X23<M13X24<M14X19<M14X25<M16X18<M17X15<M18X11<M19X11<M20X11<M21X12<M11X11<M12X11<M13X11<M14X12<M13X12<M14X23<M15X24<M12X13<M13X18<M14X13<M13X19<M14X24<M15X19<M14X11<M13X20<M14X20<M15X20<M14X22<M15X13<M16X20<M15X14<M14X21<M15X16<M16X21<M15X18<M13X14<M14X15<M15X25<M16X15<M15X11<M16X11<M15X12<M16X22<M17X12<M14X16<M15X22<M16X12<M17X22<M16X13<M17X18<M16X14<M17X14<M18X14<M15X23<M16X23<M17X23<M18X25<M19X15<M16X25<M17X16<M18X23<M16X24<M17X21<M15X17<M16X19<M17X24<M18X19<M17X25<M18X15<M19X25<M18X17<M17X11<M18X13<M19X19<M17X20<M18X21<M19X16<M19X17<M20X17<M19X18<M18X22<M19X14<M20X15<M20X12<M22X25<M20X13<M20X14<M18X12<M19X24<M20X21<M21X18<M19X13<M20X18<M21X13<M20X19<M20X20<M21X22<M18X16<M19X23<M20X25<M21X16<M22X23<M21X17<M21X11<M22X13<M22X14<M20X24<M21X20<M21X21<M22X17<M23X20<M22X18<M23X16<M25X11<M22X22<M20X23<M21X24<M22X19<M23X25<M22X20<M23X21<M24X24<M22X21<M23X19<M24X11<M23X22<M24X15<M22X11<M23X14<M24X18<M23X15<M24X13<M23X24<M24X25<M23X17<M24X19<M25X14<M22X15<M23X13<M24X20<M25X24<M25X25<M24X21<M25X20<M25X21<M24X22<M25X15<M25X16<M26X25<M26X11<M25X23<M24X14<M25X19<M26X13<M26X15<M26X20<M25X17<M26X21<M25X18<M26X17<M27X22<M27X23<M26X18<M26X19<M27X16<M28X14<M25X13<M26X22<M27X17<M26X23<M27X13<M27X14<M27X15<M26X24<M27X24<M28X25<M27X11<M28X18<M27X25<M26X14<M27X19<M27X20<M28X13<M27X21<M28X23<M28X24<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
diff --git a/elf/tst-rtld-list-tunables.exp b/elf/tst-rtld-list-tunables.exp
index 2233ea9c7c..f70c16ecb8 100644
--- a/elf/tst-rtld-list-tunables.exp
+++ b/elf/tst-rtld-list-tunables.exp
@@ -11,6 +11,5 @@ glibc.malloc.tcache_max: 0x0 (min: 0x0, max: 0x[f]+)
 glibc.malloc.tcache_unsorted_limit: 0x0 (min: 0x0, max: 0x[f]+)
 glibc.malloc.top_pad: 0x20000 (min: 0x0, max: 0x[f]+)
 glibc.malloc.trim_threshold: 0x0 (min: 0x0, max: 0x[f]+)
-glibc.rtld.dynamic_sort: 2 (min: 1, max: 2)
 glibc.rtld.nns: 0x4 (min: 0x1, max: 0x10)
 glibc.rtld.optional_static_tls: 0x200 (min: 0x0, max: 0x[f]+)
diff --git a/manual/tunables.texi b/manual/tunables.texi
index 70dd2264c5..ae6959379b 100644
--- a/manual/tunables.texi
+++ b/manual/tunables.texi
@@ -47,7 +47,6 @@ glibc.elision.enable: 0 (min: 0, max: 1)
 glibc.malloc.hugetlb: 0x0 (min: 0x0, max: 0xffffffffffffffff)
 glibc.cpu.x86_rep_movsb_threshold: 0x2000 (min: 0x100, max: 0xffffffffffffffff)
 glibc.malloc.mxfast: 0x0 (min: 0x0, max: 0xffffffffffffffff)
-glibc.rtld.dynamic_sort: 2 (min: 1, max: 2)
 glibc.elision.skip_lock_busy: 3 (min: 0, max: 2147483647)
 glibc.malloc.top_pad: 0x20000 (min: 0x0, max: 0xffffffffffffffff)
 glibc.cpu.x86_rep_stosb_threshold: 0x800 (min: 0x1, max: 0xffffffffffffffff)
@@ -334,18 +333,6 @@ changed once allocated at process startup.  The default allocation of
 optional static TLS is 512 bytes and is allocated in every thread.
 @end deftp
 
-@deftp Tunable glibc.rtld.dynamic_sort
-Sets the algorithm to use for DSO sorting, valid values are @samp{1} and
-@samp{2}.  For value of @samp{1}, an older O(n^3) algorithm is used, which is
-long time tested, but may have performance issues when dependencies between
-shared objects contain cycles due to circular dependencies.  When set to the
-value of @samp{2}, a different algorithm is used, which implements a
-topological sort through depth-first search, and does not exhibit the
-performance issues of @samp{1}.
-
-The default value of this tunable is @samp{2}.
-@end deftp
-
 @node Elision Tunables
 @section Elision Tunables
 @cindex elision tunables
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index a2115f6edb..cc4e58043f 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -102,9 +102,6 @@ _dl_sysdep_start (void **start_argptr,
 
       __tunables_init (_environ);
 
-      /* Initialize DSO sorting algorithm after tunables.  */
-      _dl_sort_maps_init ();
-
 #ifdef DL_SYSDEP_INIT
       DL_SYSDEP_INIT;
 #endif
diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
index 1b3dd869b5..4eed762754 100644
--- a/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -109,9 +109,6 @@ _dl_sysdep_start (void **start_argptr,
 
   __tunables_init (_environ);
 
-  /* Initialize DSO sorting algorithm after tunables.  */
-  _dl_sort_maps_init ();
-
   __brk (0);			/* Initialize the break.  */
 
 #ifdef DL_PLATFORM_INIT
-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 2/2] Remove --enable-tunables configure option
  2023-03-13 19:06 [PATCH 0/2] Make tunable a default feature Adhemerval Zanella
  2023-03-13 19:06 ` [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable Adhemerval Zanella
@ 2023-03-13 19:06 ` Adhemerval Zanella
  2023-03-22 16:25   ` Siddhesh Poyarekar
  2023-03-14 18:02 ` [PATCH 0/2] Make tunable a default feature Siddhesh Poyarekar
  2 siblings, 1 reply; 18+ messages in thread
From: Adhemerval Zanella @ 2023-03-13 19:06 UTC (permalink / raw)
  To: libc-alpha, Siddhesh Poyarekar, Florian Weimer

And make always supported.  The configure option was added on glibc 2.25
and some option require it (such as hwcap mask, huge pages support, and
lock elisition tuning).  It also simplifies the build permutations.
---
 INSTALL                                       |  19 ---
 Makeconfig                                    |   4 -
 NEWS                                          |   3 +
 config.h.in                                   |   3 -
 config.make.in                                |   1 -
 configure                                     |  17 ---
 configure.ac                                  |  10 --
 elf/Makefile                                  |   8 +-
 elf/dl-cache.c                                |   2 +-
 elf/dl-hwcaps.h                               |  11 --
 elf/dl-support.c                              |  15 ---
 elf/dl-tls.c                                  |   6 -
 elf/dl-tunables.h                             |  35 ++----
 elf/dl-usage.c                                |   8 +-
 elf/rtld.c                                    |  23 +---
 elf/tst-env-setuid-tunables.c                 |  11 --
 gmon/gmon.c                                   |  12 +-
 malloc/Makefile                               |   2 -
 malloc/arena.c                                | 118 +-----------------
 malloc/malloc-check.c                         |   8 --
 malloc/malloc.c                               |  14 +--
 manual/install.texi                           |  19 ---
 nptl/pthread_mutex_conf.c                     |   4 +-
 nptl/tst-mutex8.c                             |   2 -
 scripts/build-many-glibcs.py                  |   1 -
 sysdeps/generic/ldsodefs.h                    |  17 ---
 sysdeps/generic/unsecvars.h                   |   8 +-
 sysdeps/nptl/dl-tls_init_tp.c                 |   2 -
 sysdeps/nptl/pthreadP.h                       |   4 -
 sysdeps/nptl/pthread_early_init.h             |   2 -
 sysdeps/nptl/pthread_mutex_conf.h             |   8 --
 sysdeps/powerpc/cpu-features.c                |   9 +-
 sysdeps/s390/cpu-features.c                   |  14 +--
 sysdeps/sparc/sparc32/dl-machine.h            |   5 +-
 sysdeps/unix/sysv/linux/Makefile              |   4 +-
 .../unix/sysv/linux/aarch64/cpu-features.c    |   6 -
 .../unix/sysv/linux/powerpc/elision-conf.c    |   8 +-
 sysdeps/unix/sysv/linux/s390/elision-conf.c   |   8 +-
 sysdeps/unix/sysv/linux/x86/elision-conf.c    |   8 +-
 sysdeps/unix/sysv/linux/x86_64/64/Makefile    |   2 -
 sysdeps/x86/Makefile                          |  10 --
 sysdeps/x86/cacheinfo.h                       |   8 +-
 sysdeps/x86/cpu-features.c                    |  24 +---
 sysdeps/x86/cpu-tunables.c                    |  45 ++++---
 sysdeps/x86/dl-cacheinfo.h                    |  10 --
 sysdeps/x86_64/Makefile                       |   2 -
 46 files changed, 72 insertions(+), 488 deletions(-)

diff --git a/INSTALL b/INSTALL
index 970d6627e2..021943d83f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -234,25 +234,6 @@ if 'CFLAGS' is specified it must enable optimization.  For example:
      By default for x86_64, the GNU C Library is built with the vector
      math library.  Use this option to disable the vector math library.
 
-'--enable-tunables'
-     Tunables support allows additional library parameters to be
-     customized at runtime.  This feature is enabled by default.  This
-     option can take the following values:
-
-     'yes'
-          This is the default if no option is passed to configure.  This
-          enables tunables and selects the default frontend (currently
-          'valstring').
-
-     'no'
-          This option disables tunables.
-
-     'valstring'
-          This enables tunables and selects the 'valstring' frontend for
-          tunables.  This frontend allows users to specify tunables as a
-          colon-separated list in a single environment variable
-          'GLIBC_TUNABLES'.
-
 '--disable-crypt'
      Do not install the passphrase-hashing library 'libcrypt' or the
      header file 'crypt.h'.  'unistd.h' will still declare the function
diff --git a/Makeconfig b/Makeconfig
index 2fda4af5f7..3dd69d83b6 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1019,9 +1019,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 
-ifneq (no,$(have-tunables))
 CPPFLAGS += -DTOP_NAMESPACE=glibc
-endif
 
 override CFLAGS	= -std=gnu11 -fgnu89-inline $(config-extra-cflags) \
 		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
@@ -1203,7 +1201,6 @@ endif
 
 # Build the tunables list header early since it could be used by any module in
 # glibc.
-ifneq (no,$(have-tunables))
 before-compile += $(common-objpfx)dl-tunable-list.h
 common-generated += dl-tunable-list.h dl-tunable-list.stmp
 
@@ -1216,7 +1213,6 @@ $(common-objpfx)dl-tunable-list.stmp: \
 	$(AWK) -f $^ > ${@:stmp=T}
 	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
 	touch $@
-endif
 
 # Dump the GCC macros used by the default compiler flags to a header
 # file, so that they can be inspected when using different compiler
diff --git a/NEWS b/NEWS
index 0f76e7a416..3958e133a1 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,9 @@ Deprecated and removed features, and other changes affecting compatibility:
   alternatively stable kernels from versions 6.1.6, 5.15.87, 5.10.163,
   5.4.228, 4.19.270 or 4.14.303.
 
+* The configure option --enable-tunables has been removed.  The tunable
+  features is now always supported.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
diff --git a/config.h.in b/config.h.in
index 09730d9d52..c87008b6a9 100644
--- a/config.h.in
+++ b/config.h.in
@@ -271,9 +271,6 @@
 /* PowerPC32 uses fctidz for floating point to long long conversions.  */
 #define HAVE_PPC_FCTIDZ 0
 
-/* Build glibc with tunables support.  */
-#define HAVE_TUNABLES 0
-
 /* Define if PIE is unsupported.  */
 #undef PIE_UNSUPPORTED
 
diff --git a/config.make.in b/config.make.in
index d7c416cbea..9186a8aac9 100644
--- a/config.make.in
+++ b/config.make.in
@@ -96,7 +96,6 @@ build-nscd = @build_nscd@
 use-nscd = @use_nscd@
 build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
 build-pt-chown = @build_pt_chown@
-have-tunables = @have_tunables@
 pthread-in-libc = @pthread_in_libc@
 
 # Build tools.
diff --git a/configure b/configure
index efb891456a..f357aa0b9c 100755
--- a/configure
+++ b/configure
@@ -664,7 +664,6 @@ INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
 base_machine
-have_tunables
 build_pt_chown
 build_nscd
 libc_cv_static_nss_crypt
@@ -784,7 +783,6 @@ enable_systemtap
 enable_build_nscd
 enable_nscd
 enable_pt_chown
-enable_tunables
 enable_mathvec
 enable_cet
 enable_scv
@@ -1454,8 +1452,6 @@ Optional Features:
   --disable-build-nscd    disable building and installing the nscd daemon
   --disable-nscd          library functions will not contact the nscd daemon
   --enable-pt_chown       Enable building and installing pt_chown
-  --enable-tunables       Enable tunables support. Known values are 'yes',
-                          'no' and 'valstring'
   --enable-mathvec        Enable building and installing mathvec [default
                           depends on architecture]
   --enable-cet            enable Intel Control-flow Enforcement Technology
@@ -3684,19 +3680,6 @@ if test "$build_pt_chown" = yes; then
 
 fi
 
-# Check whether --enable-tunables was given.
-if test "${enable_tunables+set}" = set; then :
-  enableval=$enable_tunables; have_tunables=$enableval
-else
-  have_tunables=yes
-fi
-
-
-if test "$have_tunables" = yes; then
-  $as_echo "#define HAVE_TUNABLES 1" >>confdefs.h
-
-fi
-
 # The abi-tags file uses a fairly simplistic model for name recognition that
 # can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a
 # $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell.
diff --git a/configure.ac b/configure.ac
index 011844a3d4..6b316bfd44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -441,16 +441,6 @@ if test "$build_pt_chown" = yes; then
   AC_DEFINE(HAVE_PT_CHOWN)
 fi
 
-AC_ARG_ENABLE([tunables],
-	      [AS_HELP_STRING([--enable-tunables],
-	       [Enable tunables support. Known values are 'yes', 'no' and 'valstring'])],
-	      [have_tunables=$enableval],
-	      [have_tunables=yes])
-AC_SUBST(have_tunables)
-if test "$have_tunables" = yes; then
-  AC_DEFINE(HAVE_TUNABLES)
-fi
-
 # The abi-tags file uses a fairly simplistic model for name recognition that
 # can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a
 # $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell.
diff --git a/elf/Makefile b/elf/Makefile
index 4d0e04b2a2..75bfd82c34 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -90,10 +90,9 @@ ifeq (yes,$(use-ldconfig))
 dl-routines += dl-cache
 endif
 
-ifneq (no,$(have-tunables))
 dl-routines += dl-tunables
-tunables-type = $(addprefix TUNABLES_FRONTEND_,$(have-tunables))
-CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=$(tunables-type)
+tunables-type = $(addprefix TUNABLES_FRONTEND_,yes)
+CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=1
 
 ifeq (yesyes,$(build-shared)$(run-built-tests))
 tests-special += $(objpfx)list-tunables.out
@@ -104,7 +103,6 @@ endif
 ifeq (yes,$(have-loop-to-function))
 CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns
 endif
-endif
 
 all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
 # But they are absent from the shared libc, because that code is in ld.so.
@@ -1187,7 +1185,6 @@ postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
 		       $(objpfx)/dso-sort-tests-2.generated-makefile
 
 # Generate from each testcase description file
-ifeq (yes,$(have-tunables))
 $(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
 $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
 
@@ -1195,7 +1192,6 @@ $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
 LDFLAGS-tst-bz15311-b.so += -Wl,-z,lazy
 LDFLAGS-tst-bz15311-c.so += -Wl,-z,lazy
 LDFLAGS-tst-bz15311-d.so += -Wl,-z,lazy
-endif
 
 check-abi: $(objpfx)check-abi-ld.out \
 	   $(objpfx)check-abi-version-libc.out
diff --git a/elf/dl-cache.c b/elf/dl-cache.c
index 07c054b11a..631286832d 100644
--- a/elf/dl-cache.c
+++ b/elf/dl-cache.c
@@ -205,7 +205,7 @@ search_cache (const char *string_table, uint32_t string_table_size,
   uint64_t platform = _dl_string_platform (GLRO (dl_platform));
   if (platform != (uint64_t) -1)
     platform = 1ULL << platform;
-  uint64_t hwcap_mask = GET_HWCAP_MASK ();
+  uint64_t hwcap_mask = TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t, NULL);
 #define _DL_HWCAP_TLS_MASK (1LL << 63)
   uint64_t hwcap_exclude = ~((GLRO (dl_hwcap) & hwcap_mask)
 			     | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
diff --git a/elf/dl-hwcaps.h b/elf/dl-hwcaps.h
index abe6aaf7c5..3012ebf2b4 100644
--- a/elf/dl-hwcaps.h
+++ b/elf/dl-hwcaps.h
@@ -24,17 +24,6 @@
 
 #include <elf/dl-tunables.h>
 
-#if HAVE_TUNABLES
-# define GET_HWCAP_MASK() TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t, NULL)
-#else
-# ifdef SHARED
-#   define GET_HWCAP_MASK() GLRO(dl_hwcap_mask)
-# else
-/* HWCAP_MASK is ignored in static binaries when built without tunables.  */
-#  define GET_HWCAP_MASK() (0)
-# endif
-#endif
-
 #define GLIBC_HWCAPS_SUBDIRECTORY "glibc-hwcaps"
 #define GLIBC_HWCAPS_PREFIX GLIBC_HWCAPS_SUBDIRECTORY "/"
 
diff --git a/elf/dl-support.c b/elf/dl-support.c
index d2519ce1a9..322599916f 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -168,16 +168,6 @@ enum dso_sort_algorithm _dl_dso_sort_algo;
 /* The value of the FPU control word the kernel will preset in hardware.  */
 fpu_control_t _dl_fpu_control = _FPU_DEFAULT;
 
-#if !HAVE_TUNABLES
-/* This is not initialized to HWCAP_IMPORTANT, matching the definition
-   of _dl_important_hwcaps, below, where no hwcap strings are ever
-   used.  This mask is still used to mediate the lookups in the cache
-   file.  Since there is no way to set this nonzero (we don't grok the
-   LD_HWCAP_MASK environment variable here), there is no real point in
-   setting _dl_hwcap nonzero below, but we do anyway.  */
-uint64_t _dl_hwcap_mask;
-#endif
-
 /* Prevailing state of the stack.  Generally this includes PF_X, indicating it's
  * executable but this isn't true for all platforms.  */
 ElfW(Word) _dl_stack_flags = DEFAULT_STACK_PERMS;
@@ -328,11 +318,6 @@ _dl_non_dynamic_init (void)
 	  __unsetenv (cp);
 	  cp = strchr (cp, '\0') + 1;
 	}
-
-#if !HAVE_TUNABLES
-      if (__access ("/etc/suid-debug", F_OK) != 0)
-	__unsetenv ("MALLOC_CHECK_");
-#endif
     }
 
 #ifdef DL_PLATFORM_INIT
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 8943a3b4ae..4ef7bc3f1e 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -97,14 +97,8 @@ _dl_tls_static_surplus_init (size_t naudit)
 {
   size_t nns, opt_tls;
 
-#if HAVE_TUNABLES
   nns = TUNABLE_GET (nns, size_t, NULL);
   opt_tls = TUNABLE_GET (optional_static_tls, size_t, NULL);
-#else
-  /* Default values of the tunables.  */
-  nns = DEFAULT_NNS;
-  opt_tls = OPTIONAL_TLS;
-#endif
   if (nns > DL_NNS)
     nns = DL_NNS;
   if (DL_NNS - nns < naudit)
diff --git a/elf/dl-tunables.h b/elf/dl-tunables.h
index ae6e014b95..7c7de704e9 100644
--- a/elf/dl-tunables.h
+++ b/elf/dl-tunables.h
@@ -21,17 +21,9 @@
 #ifndef _TUNABLES_H_
 #define _TUNABLES_H_
 
-#if !HAVE_TUNABLES
-static inline void
-__always_inline
-__tunables_init (char **unused __attribute__ ((unused)))
-{
-  /* This is optimized out if tunables are not enabled.  */
-}
-#else
-# include <stdbool.h>
-# include <stddef.h>
-# include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
 
 typedef intmax_t tunable_num_t;
 
@@ -44,12 +36,12 @@ typedef union
 typedef void (*tunable_callback_t) (tunable_val_t *);
 
 /* Full name for a tunable is top_ns.tunable_ns.id.  */
-# define TUNABLE_NAME_S(top,ns,id) #top "." #ns "." #id
+#define TUNABLE_NAME_S(top,ns,id) #top "." #ns "." #id
 
-# define TUNABLE_ENUM_NAME(__top,__ns,__id) TUNABLE_ENUM_NAME1 (__top,__ns,__id)
-# define TUNABLE_ENUM_NAME1(__top,__ns,__id) __top ## _ ## __ns ## _ ## __id
+#define TUNABLE_ENUM_NAME(__top,__ns,__id) TUNABLE_ENUM_NAME1 (__top,__ns,__id)
+#define TUNABLE_ENUM_NAME1(__top,__ns,__id) __top ## _ ## __ns ## _ ## __id
 
-# include "dl-tunable-list.h"
+#include "dl-tunable-list.h"
 
 extern void __tunables_init (char **);
 extern void __tunables_print (void);
@@ -83,7 +75,7 @@ rtld_hidden_proto (__tunable_set_val)
 
 /* Get and return a tunable value.  If the tunable was set externally and __CB
    is defined then call __CB before returning the value.  */
-# define TUNABLE_GET_FULL(__top, __ns, __id, __type, __cb) \
+#define TUNABLE_GET_FULL(__top, __ns, __id, __type, __cb) \
 ({									      \
   tunable_id_t id = TUNABLE_ENUM_NAME (__top, __ns, __id);		      \
   __type ret;								      \
@@ -92,14 +84,14 @@ rtld_hidden_proto (__tunable_set_val)
 })
 
 /* Set a tunable value.  */
-# define TUNABLE_SET_FULL(__top, __ns, __id, __val) \
+#define TUNABLE_SET_FULL(__top, __ns, __id, __val) \
 ({									      \
   __tunable_set_val (TUNABLE_ENUM_NAME (__top, __ns, __id),		      \
 		     & (tunable_val_t) {.numval = __val}, NULL, NULL);	      \
 })
 
 /* Set a tunable value together with min/max values.  */
-# define TUNABLE_SET_WITH_BOUNDS_FULL(__top, __ns, __id,__val, __min, __max)  \
+#define TUNABLE_SET_WITH_BOUNDS_FULL(__top, __ns, __id,__val, __min, __max)  \
 ({									      \
   __tunable_set_val (TUNABLE_ENUM_NAME (__top, __ns, __id),		      \
 		     & (tunable_val_t) {.numval = __val},		      \
@@ -109,11 +101,11 @@ rtld_hidden_proto (__tunable_set_val)
 
 /* Namespace sanity for callback functions.  Use this macro to keep the
    namespace of the modules clean.  */
-# define TUNABLE_CALLBACK(__name) _dl_tunable_ ## __name
+#define TUNABLE_CALLBACK(__name) _dl_tunable_ ## __name
 
-# define TUNABLES_FRONTEND_valstring 1
+#define TUNABLES_FRONTEND_valstring 1
 /* The default value for TUNABLES_FRONTEND.  */
-# define TUNABLES_FRONTEND_yes TUNABLES_FRONTEND_valstring
+#define TUNABLES_FRONTEND_yes TUNABLES_FRONTEND_valstring
 
 static __always_inline bool
 tunable_val_lt (tunable_num_t lhs, tunable_num_t rhs, bool unsigned_cmp)
@@ -149,4 +141,3 @@ tunable_is_name (const char *orig, const char *envname)
 }
 
 #endif
-#endif
diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index 53535c1583..98f0b0d027 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -195,12 +195,8 @@ setting environment variables (which would be inherited by subprocesses).\n\
                         in LIST\n\
   --audit LIST          use objects named in LIST as auditors\n\
   --preload LIST        preload objects named in LIST\n\
-  --argv0 STRING        set argv[0] to STRING before running\n"
-#if HAVE_TUNABLES
-"\
-  --list-tunables       list all tunables with minimum and maximum values\n"
-#endif
-"\
+  --argv0 STRING        set argv[0] to STRING before running\n\
+  --list-tunables       list all tunables with minimum and maximum values\n\
   --list-diagnostics    list diagnostics information\n\
   --help                display this help and exit\n\
   --version             output version information and exit\n\
diff --git a/elf/rtld.c b/elf/rtld.c
index f82fbeb132..c1e383b055 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -357,9 +357,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
     ._dl_sysinfo = DL_SYSINFO_DEFAULT,
 #endif
     ._dl_debug_fd = STDERR_FILENO,
-#if !HAVE_TUNABLES
-    ._dl_hwcap_mask = HWCAP_IMPORTANT,
-#endif
     ._dl_lazy = 1,
     ._dl_fpu_control = _FPU_DEFAULT,
     ._dl_pagesize = EXEC_PAGESIZE,
@@ -1483,7 +1480,6 @@ dl_main (const ElfW(Phdr) *phdr,
 	    _dl_argc -= 2;
 	    _dl_argv += 2;
 	  }
-#if HAVE_TUNABLES
 	else if (! strcmp (_dl_argv[1], "--list-tunables"))
 	  {
 	    state.mode = rtld_mode_list_tunables;
@@ -1491,7 +1487,6 @@ dl_main (const ElfW(Phdr) *phdr,
 	    --_dl_argc;
 	    ++_dl_argv;
 	  }
-#endif
 	else if (! strcmp (_dl_argv[1], "--list-diagnostics"))
 	  {
 	    state.mode = rtld_mode_list_diagnostics;
@@ -1519,13 +1514,11 @@ dl_main (const ElfW(Phdr) *phdr,
 	else
 	  break;
 
-#if HAVE_TUNABLES
       if (__glibc_unlikely (state.mode == rtld_mode_list_tunables))
 	{
 	  __tunables_print ();
 	  _exit (0);
 	}
-#endif
 
       if (state.mode == rtld_mode_list_diagnostics)
 	_dl_print_diagnostics (_environ);
@@ -2624,15 +2617,6 @@ process_envvars (struct dl_main_state *state)
 	    _dl_show_auxv ();
 	  break;
 
-#if !HAVE_TUNABLES
-	case 10:
-	  /* Mask for the important hardware capabilities.  */
-	  if (!__libc_enable_secure
-	      && memcmp (envline, "HWCAP_MASK", 10) == 0)
-	    GLRO(dl_hwcap_mask) = _dl_strtoul (&envline[11], NULL);
-	  break;
-#endif
-
 	case 11:
 	  /* Path where the binary is found.  */
 	  if (!__libc_enable_secure
@@ -2695,12 +2679,7 @@ process_envvars (struct dl_main_state *state)
       while (*nextp != '\0');
 
       if (__access ("/etc/suid-debug", F_OK) != 0)
-	{
-#if !HAVE_TUNABLES
-	  unsetenv ("MALLOC_CHECK_");
-#endif
-	  GLRO(dl_debug_mask) = 0;
-	}
+	GLRO(dl_debug_mask) = 0;
 
       if (state->mode != rtld_mode_normal)
 	_exit (5);
diff --git a/elf/tst-env-setuid-tunables.c b/elf/tst-env-setuid-tunables.c
index 807b426012..7dfb0e073a 100644
--- a/elf/tst-env-setuid-tunables.c
+++ b/elf/tst-env-setuid-tunables.c
@@ -19,8 +19,6 @@
    glibc.malloc.check and glibc.malloc.mmap_threshold but also retain
    glibc.malloc.mmap_threshold in an unprivileged child.  */
 
-/* This is compiled as part of the testsuite but needs to see
-   HAVE_TUNABLES. */
 #define _LIBC 1
 #include "config.h"
 #undef _LIBC
@@ -83,7 +81,6 @@ test_child (int off)
 {
   const char *val = getenv ("GLIBC_TUNABLES");
 
-#if HAVE_TUNABLES
   if (val != NULL && strcmp (val, resultstrings[off]) == 0)
     return 0;
 
@@ -91,14 +88,6 @@ test_child (int off)
     printf ("[%d] Unexpected GLIBC_TUNABLES VALUE %s\n", off, val);
 
   return 1;
-#else
-  if (val != NULL)
-    {
-      printf ("[%d] GLIBC_TUNABLES not cleared\n", off);
-      return 1;
-    }
-  return 0;
-#endif
 }
 
 static int
diff --git a/gmon/gmon.c b/gmon/gmon.c
index 5e99a7351d..bc0e29438a 100644
--- a/gmon/gmon.c
+++ b/gmon/gmon.c
@@ -46,10 +46,8 @@
 #include <libc-internal.h>
 #include <not-cancel.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE gmon
-# include <elf/dl-tunables.h>
-#endif
+#define TUNABLE_NAMESPACE gmon
+#include <elf/dl-tunables.h>
 
 #ifdef PIC
 # include <link.h>
@@ -130,7 +128,6 @@ __monstartup (u_long lowpc, u_long highpc)
   struct gmonparam *p = &_gmonparam;
   long int minarcs, maxarcs;
 
-#if HAVE_TUNABLES
   /* Read minarcs/maxarcs tunables. */
   minarcs = TUNABLE_GET (minarcs, int32_t, NULL);
   maxarcs = TUNABLE_GET (maxarcs, int32_t, NULL);
@@ -139,11 +136,6 @@ __monstartup (u_long lowpc, u_long highpc)
       ERR("monstartup: maxarcs < minarcs, setting maxarcs = minarcs\n");
       maxarcs = minarcs;
     }
-#else
-  /* No tunables, we use hardcoded defaults */
-  minarcs = MINARCS;
-  maxarcs = MAXARCS;
-#endif
 
   /*
    * If we are incorrectly called twice in a row (without an
diff --git a/malloc/Makefile b/malloc/Makefile
index dfb51d344c..2b7bd10d49 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -61,9 +61,7 @@ tests-internal += \
 	 tst-dynarray-fail \
 	 tst-dynarray-at-fail \
 
-ifneq (no,$(have-tunables))
 tests += tst-malloc-usable-tunables tst-mxfast
-endif
 
 tests += $(tests-static)
 test-srcs = tst-mtrace
diff --git a/malloc/arena.c b/malloc/arena.c
index ccd193953b..e98b779dbb 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -18,9 +18,7 @@
 
 #include <stdbool.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE malloc
-#endif
+#define TUNABLE_NAMESPACE malloc
 #include <elf/dl-tunables.h>
 
 /* Compile-time constants.  */
@@ -47,21 +45,13 @@
 static inline size_t
 heap_min_size (void)
 {
-#if HAVE_TUNABLES
   return mp_.hp_pagesize == 0 ? HEAP_MIN_SIZE : mp_.hp_pagesize;
-#else
-  return HEAP_MIN_SIZE;
-#endif
 }
 
 static inline size_t
 heap_max_size (void)
 {
-#if HAVE_TUNABLES
   return mp_.hp_pagesize == 0 ? HEAP_MAX_SIZE : mp_.hp_pagesize * 4;
-#else
-  return HEAP_MAX_SIZE;
-#endif
 }
 
 /***************************************************************************/
@@ -239,8 +229,7 @@ __malloc_fork_unlock_child (void)
   __libc_lock_init (list_lock);
 }
 
-#if HAVE_TUNABLES
-# define TUNABLE_CALLBACK_FNDECL(__name, __type) \
+#define TUNABLE_CALLBACK_FNDECL(__name, __type) \
 static inline int do_ ## __name (__type value);				      \
 static void									      \
 TUNABLE_CALLBACK (__name) (tunable_val_t *valp)				      \
@@ -263,42 +252,6 @@ TUNABLE_CALLBACK_FNDECL (set_tcache_unsorted_limit, size_t)
 #endif
 TUNABLE_CALLBACK_FNDECL (set_mxfast, size_t)
 TUNABLE_CALLBACK_FNDECL (set_hugetlb, size_t)
-#else
-/* Initialization routine. */
-#include <string.h>
-extern char **_environ;
-
-static char *
-next_env_entry (char ***position)
-{
-  char **current = *position;
-  char *result = NULL;
-
-  while (*current != NULL)
-    {
-      if (__builtin_expect ((*current)[0] == 'M', 0)
-          && (*current)[1] == 'A'
-          && (*current)[2] == 'L'
-          && (*current)[3] == 'L'
-          && (*current)[4] == 'O'
-          && (*current)[5] == 'C'
-          && (*current)[6] == '_')
-        {
-          result = &(*current)[7];
-
-          /* Save current position for next visit.  */
-          *position = ++current;
-
-          break;
-        }
-
-      ++current;
-    }
-
-  return result;
-}
-#endif
-
 
 #if USE_TCACHE
 static void tcache_key_initialize (void);
@@ -343,7 +296,6 @@ ptmalloc_init (void)
 
   malloc_init_state (&main_arena);
 
-#if HAVE_TUNABLES
   TUNABLE_GET (top_pad, size_t, TUNABLE_CALLBACK (set_top_pad));
   TUNABLE_GET (perturb, int32_t, TUNABLE_CALLBACK (set_perturb_byte));
   TUNABLE_GET (mmap_threshold, size_t, TUNABLE_CALLBACK (set_mmap_threshold));
@@ -363,70 +315,6 @@ ptmalloc_init (void)
     /* Force mmap for main arena instead of sbrk, so hugepages are explicitly
        used.  */
     __always_fail_morecore = true;
-#else
-  if (__glibc_likely (_environ != NULL))
-    {
-      char **runp = _environ;
-      char *envline;
-
-      while (__builtin_expect ((envline = next_env_entry (&runp)) != NULL,
-                               0))
-        {
-          size_t len = strcspn (envline, "=");
-
-          if (envline[len] != '=')
-            /* This is a "MALLOC_" variable at the end of the string
-               without a '=' character.  Ignore it since otherwise we
-               will access invalid memory below.  */
-            continue;
-
-          switch (len)
-            {
-            case 8:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "TOP_PAD_", 8) == 0)
-                    __libc_mallopt (M_TOP_PAD, strtol (&envline[9], NULL, 10));
-                  else if (memcmp (envline, "PERTURB_", 8) == 0)
-                    __libc_mallopt (M_PERTURB, strtol (&envline[9], NULL, 10));
-                }
-              break;
-            case 9:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "MMAP_MAX_", 9) == 0)
-                    __libc_mallopt (M_MMAP_MAX, strtol (&envline[10],
-							NULL, 10));
-                  else if (memcmp (envline, "ARENA_MAX", 9) == 0)
-                    __libc_mallopt (M_ARENA_MAX, strtol (&envline[10],
-							 NULL, 10));
-                }
-              break;
-            case 10:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "ARENA_TEST", 10) == 0)
-                    __libc_mallopt (M_ARENA_TEST, strtol (&envline[11],
-							  NULL, 10));
-                }
-              break;
-            case 15:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "TRIM_THRESHOLD_", 15) == 0)
-                    __libc_mallopt (M_TRIM_THRESHOLD, strtol (&envline[16],
-							      NULL, 10));
-                  else if (memcmp (envline, "MMAP_THRESHOLD_", 15) == 0)
-                    __libc_mallopt (M_MMAP_THRESHOLD, strtol (&envline[16],
-							      NULL, 10));
-                }
-              break;
-            default:
-              break;
-            }
-        }
-    }
-#endif
 }
 
 /* Managing heaps and arenas (for concurrent threads) */
@@ -561,7 +449,6 @@ alloc_new_heap  (size_t size, size_t top_pad, size_t pagesize,
 static heap_info *
 new_heap (size_t size, size_t top_pad)
 {
-#if HAVE_TUNABLES
   if (__glibc_unlikely (mp_.hp_pagesize != 0))
     {
       heap_info *h = alloc_new_heap (size, top_pad, mp_.hp_pagesize,
@@ -569,7 +456,6 @@ new_heap (size_t size, size_t top_pad)
       if (h != NULL)
 	return h;
     }
-#endif
   return alloc_new_heap (size, top_pad, GLRO (dl_pagesize), 0);
 }
 
diff --git a/malloc/malloc-check.c b/malloc/malloc-check.c
index af27fd2c52..5732d81bf1 100644
--- a/malloc/malloc-check.c
+++ b/malloc/malloc-check.c
@@ -376,7 +376,6 @@ memalign_check (size_t alignment, size_t bytes)
   return mem2mem_check (tag_new_usable (mem), bytes);
 }
 
-#if HAVE_TUNABLES
 static void
 TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
 {
@@ -384,7 +383,6 @@ TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
   if (value != 0)
     __malloc_debug_enable (MALLOC_CHECK_HOOK);
 }
-#endif
 
 static bool
 initialize_malloc_check (void)
@@ -392,12 +390,6 @@ initialize_malloc_check (void)
   /* This is the copy of the malloc initializer that we pulled in along with
      malloc-check.  This does not affect any of the libc malloc structures.  */
   ptmalloc_init ();
-#if HAVE_TUNABLES
   TUNABLE_GET (check, int32_t, TUNABLE_CALLBACK (set_mallopt_check));
-#else
-  const char *s = secure_getenv ("MALLOC_CHECK_");
-  if (s && s[0] != '\0' && s[0] != '0')
-    __malloc_debug_enable (MALLOC_CHECK_HOOK);
-#endif
   return __is_malloc_debug_enabled (MALLOC_CHECK_HOOK);
 }
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 76c50e3f58..05e65a2d54 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1856,14 +1856,12 @@ struct malloc_par
   INTERNAL_SIZE_T arena_test;
   INTERNAL_SIZE_T arena_max;
 
-#if HAVE_TUNABLES
   /* Transparent Large Page support.  */
   INTERNAL_SIZE_T thp_pagesize;
   /* A value different than 0 means to align mmap allocation to hp_pagesize
      add hp_flags on flags.  */
   INTERNAL_SIZE_T hp_pagesize;
   int hp_flags;
-#endif
 
   /* Memory map support */
   int n_mmaps;
@@ -1998,7 +1996,7 @@ free_perturb (char *p, size_t n)
 static inline void
 madvise_thp (void *p, INTERNAL_SIZE_T size)
 {
-#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
+#ifdef MADV_HUGEPAGE
   /* Do not consider areas smaller than a huge page or if the tunable is
      not active.  */
   if (mp_.thp_pagesize == 0 || size < mp_.thp_pagesize)
@@ -2557,7 +2555,6 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
 	  && (mp_.n_mmaps < mp_.n_mmaps_max)))
     {
       char *mm;
-#if HAVE_TUNABLES
       if (mp_.hp_pagesize > 0 && nb >= mp_.hp_pagesize)
 	{
 	  /* There is no need to isse the THP madvise call if Huge Pages are
@@ -2566,7 +2563,6 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
 	  if (mm != MAP_FAILED)
 	    return mm;
 	}
-#endif
       mm = sysmalloc_mmap (nb, pagesize, 0, av);
       if (mm != MAP_FAILED)
 	return mm;
@@ -2679,7 +2675,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
          previous calls. Otherwise, we correct to page-align below.
        */
 
-#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
+#ifdef MADV_HUGEPAGE
       /* Defined in brk.c.  */
       extern void *__curbrk;
       if (__glibc_unlikely (mp_.thp_pagesize != 0))
@@ -2718,12 +2714,10 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
            */
 
 	  char *mbrk = MAP_FAILED;
-#if HAVE_TUNABLES
 	  if (mp_.hp_pagesize > 0)
 	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size,
 					    mp_.hp_pagesize, mp_.hp_pagesize,
 					    mp_.hp_flags, av);
-#endif
 	  if (mbrk == MAP_FAILED)
 	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, MMAP_AS_MORECORE_SIZE,
 					    pagesize, 0, av);
@@ -2966,7 +2960,7 @@ systrim (size_t pad, mstate av)
     return 0;
 
   /* Release in pagesize units and round down to the nearest page.  */
-#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
+#ifdef MADV_HUGEPAGE
   if (__glibc_unlikely (mp_.thp_pagesize != 0))
     extra = ALIGN_DOWN (top_area - pad, mp_.thp_pagesize);
   else
@@ -5410,7 +5404,6 @@ do_set_mxfast (size_t value)
   return 0;
 }
 
-#if HAVE_TUNABLES
 static __always_inline int
 do_set_hugetlb (size_t value)
 {
@@ -5429,7 +5422,6 @@ do_set_hugetlb (size_t value)
 			      &mp_.hp_flags);
   return 0;
 }
-#endif
 
 int
 __libc_mallopt (int param_number, int value)
diff --git a/manual/install.texi b/manual/install.texi
index 260f8a5c82..37edf26195 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -262,25 +262,6 @@ configure with @option{--disable-werror}.
 By default for x86_64, @theglibc{} is built with the vector math library.
 Use this option to disable the vector math library.
 
-@item --enable-tunables
-Tunables support allows additional library parameters to be customized at
-runtime.  This feature is enabled by default.  This option can take the
-following values:
-
-@table @code
-@item yes
-This is the default if no option is passed to configure. This enables tunables
-and selects the default frontend (currently @samp{valstring}).
-
-@item no
-This option disables tunables.
-
-@item valstring
-This enables tunables and selects the @samp{valstring} frontend for tunables.
-This frontend allows users to specify tunables as a colon-separated list in a
-single environment variable @env{GLIBC_TUNABLES}.
-@end table
-
 @item --disable-crypt
 Do not install the passphrase-hashing library @file{libcrypt} or the
 header file @file{crypt.h}.  @file{unistd.h} will still declare the
diff --git a/nptl/pthread_mutex_conf.c b/nptl/pthread_mutex_conf.c
index 329c4cbb8f..9133384d47 100644
--- a/nptl/pthread_mutex_conf.c
+++ b/nptl/pthread_mutex_conf.c
@@ -16,8 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE pthread
+#define TUNABLE_NAMESPACE pthread
 #include <pthread_mutex_conf.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -53,4 +52,3 @@ __pthread_tunables_init (void)
   TUNABLE_GET (stack_cache_size, size_t,
                TUNABLE_CALLBACK (set_stack_cache_size));
 }
-#endif
diff --git a/nptl/tst-mutex8.c b/nptl/tst-mutex8.c
index 4ac5f5059f..e16284d29e 100644
--- a/nptl/tst-mutex8.c
+++ b/nptl/tst-mutex8.c
@@ -98,7 +98,6 @@ check_type (const char *mas, pthread_mutexattr_t *ma)
   /* Check if a mutex will be elided.  Lock elision can only be activated via
      the tunables framework.  By default, lock elision is disabled.  */
   bool assume_elided_mutex = false;
-#if HAVE_TUNABLES
   int ma_type = PTHREAD_MUTEX_TIMED_NP;
   if (ma != NULL)
     {
@@ -117,7 +116,6 @@ check_type (const char *mas, pthread_mutexattr_t *ma)
       if (TUNABLE_GET_FULL (glibc, elision, enable, int32_t, NULL) == 1)
 	assume_elided_mutex = true;
     }
-#endif
 
   e = pthread_mutex_init (m, ma);
   if (e != 0)
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 29c10c2916..7d7a10bffa 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -445,7 +445,6 @@ class Context(object):
                                                '--disable-profile',
                                                '--disable-timezone-tools',
                                                '--disable-mathvec',
-                                               '--disable-tunables',
                                                '--disable-crypt',
                                                '--disable-experimental-malloc',
                                                '--disable-build-nscd',
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index c99dad77cc..bf16b66c9c 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -586,11 +586,6 @@ struct rtld_global_ro
   /* Mask for hardware capabilities that are available.  */
   EXTERN uint64_t _dl_hwcap;
 
-#if !HAVE_TUNABLES
-  /* Mask for important hardware capabilities we honour. */
-  EXTERN uint64_t _dl_hwcap_mask;
-#endif
-
 #ifdef HAVE_AUX_VECTOR
   /* Pointer to the auxv list supplied to the program at startup.  */
   EXTERN ElfW(auxv_t) *_dl_auxv;
@@ -1192,18 +1187,6 @@ extern struct link_map * _dl_get_dl_main_map (void)
    brk.  */
 void *_dl_early_allocate (size_t size) attribute_hidden;
 
-/* Initialize the DSO sort algorithm to use.  */
-#if !HAVE_TUNABLES
-static inline void
-__always_inline
-_dl_sort_maps_init (void)
-{
-  /* This is optimized out if tunables are not enabled.  */
-}
-#else
-extern void _dl_sort_maps_init (void) attribute_hidden;
-#endif
-
 /* Initialization of libpthread for statically linked applications.
    If libpthread is not linked in, this is an empty function.  */
 void __pthread_initialize_minimal (void) weak_function;
diff --git a/sysdeps/generic/unsecvars.h b/sysdeps/generic/unsecvars.h
index b50331b50f..81397fb90b 100644
--- a/sysdeps/generic/unsecvars.h
+++ b/sysdeps/generic/unsecvars.h
@@ -1,16 +1,10 @@
-#if !HAVE_TUNABLES
-# define GLIBC_TUNABLES_ENVVAR "GLIBC_TUNABLES\0"
-#else
-# define GLIBC_TUNABLES_ENVVAR
-#endif
-
 /* Environment variable to be removed for SUID programs.  The names are
    all stuffed in a single string which means they have to be terminated
    with a '\0' explicitly.  */
 #define UNSECURE_ENVVARS \
   "GCONV_PATH\0"							      \
   "GETCONF_DIR\0"							      \
-  GLIBC_TUNABLES_ENVVAR							      \
+  "GLIBC_TUNABLES\0"							      \
   "HOSTALIASES\0"							      \
   "LD_AUDIT\0"								      \
   "LD_DEBUG\0"								      \
diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c
index 0db0349c4b..50dc778852 100644
--- a/sysdeps/nptl/dl-tls_init_tp.c
+++ b/sysdeps/nptl/dl-tls_init_tp.c
@@ -102,9 +102,7 @@ __tls_init_tp (void)
 
   {
     bool do_rseq = true;
-#if HAVE_TUNABLES
     do_rseq = TUNABLE_GET (rseq, int, NULL);
-#endif
     if (rseq_register_current_thread (pd, do_rseq))
       {
         /* We need a writable view of the variables.  They are in
diff --git a/sysdeps/nptl/pthreadP.h b/sysdeps/nptl/pthreadP.h
index 536b75b582..54f9198681 100644
--- a/sysdeps/nptl/pthreadP.h
+++ b/sysdeps/nptl/pthreadP.h
@@ -45,11 +45,7 @@
 
 static inline short max_adaptive_count (void)
 {
-#if HAVE_TUNABLES
   return __mutex_aconf.spin_count;
-#else
-  return DEFAULT_ADAPTIVE_COUNT;
-#endif
 }
 
 
diff --git a/sysdeps/nptl/pthread_early_init.h b/sysdeps/nptl/pthread_early_init.h
index 39255d928c..f1a3b65d1a 100644
--- a/sysdeps/nptl/pthread_early_init.h
+++ b/sysdeps/nptl/pthread_early_init.h
@@ -53,9 +53,7 @@ __pthread_early_init (void)
   __default_pthread_attr.internal.stacksize = limit.rlim_cur;
   __default_pthread_attr.internal.guardsize = GLRO (dl_pagesize);
 
-#if HAVE_TUNABLES
   __pthread_tunables_init ();
-#endif
 }
 
 #endif  /* _PTHREAD_EARLY_INIT_H */
diff --git a/sysdeps/nptl/pthread_mutex_conf.h b/sysdeps/nptl/pthread_mutex_conf.h
index 6d4b6ad880..8151bafce7 100644
--- a/sysdeps/nptl/pthread_mutex_conf.h
+++ b/sysdeps/nptl/pthread_mutex_conf.h
@@ -20,7 +20,6 @@
 
 #include <adaptive_spin_count.h>
 
-#if HAVE_TUNABLES
 struct mutex_config
 {
   int spin_count;
@@ -30,12 +29,5 @@ extern struct mutex_config __mutex_aconf;
 libc_hidden_proto (__mutex_aconf)
 
 extern void __pthread_tunables_init (void) attribute_hidden;
-#else
-static inline void
-__pthread_tunables_init (void)
-{
-  /* No tunables to initialize.  */
-}
-#endif
 
 #endif
diff --git a/sysdeps/powerpc/cpu-features.c b/sysdeps/powerpc/cpu-features.c
index 9ed0e5e8c1..0ef3cf89d2 100644
--- a/sysdeps/powerpc/cpu-features.c
+++ b/sysdeps/powerpc/cpu-features.c
@@ -18,10 +18,7 @@
 
 #include <stdint.h>
 #include <cpu-features.h>
-
-#if HAVE_TUNABLES
-# include <elf/dl-tunables.h>
-#endif
+#include <elf/dl-tunables.h>
 
 static inline void
 init_cpu_features (struct cpu_features *cpu_features)
@@ -29,11 +26,7 @@ init_cpu_features (struct cpu_features *cpu_features)
   /* Default is to use aligned memory access on optimized function unless
      tunables is enable, since for this case user can explicit disable
      unaligned optimizations.  */
-#if HAVE_TUNABLES
   int32_t cached_memfunc = TUNABLE_GET (glibc, cpu, cached_memopt, int32_t,
 					NULL);
   cpu_features->use_cached_memopt = (cached_memfunc > 0);
-#else
-  cpu_features->use_cached_memopt = false;
-#endif
 }
diff --git a/sysdeps/s390/cpu-features.c b/sysdeps/s390/cpu-features.c
index afeb9b5638..39f8c23a60 100644
--- a/sysdeps/s390/cpu-features.c
+++ b/sysdeps/s390/cpu-features.c
@@ -18,15 +18,12 @@
 
 #include <cpu-features.h>
 
-#if HAVE_TUNABLES
-# include <elf/dl-tunables.h>
-# include <ifunc-memcmp.h>
-# include <string.h>
+#include <elf/dl-tunables.h>
+#include <ifunc-memcmp.h>
+#include <string.h>
 extern __typeof (memcmp) MEMCMP_DEFAULT;
-#endif
 
-#if HAVE_TUNABLES
-# define S390_COPY_CPU_FEATURES(SRC_PTR, DEST_PTR)	\
+#define S390_COPY_CPU_FEATURES(SRC_PTR, DEST_PTR)	\
   (DEST_PTR)->hwcap = (SRC_PTR)->hwcap;			\
   (DEST_PTR)->stfle_bits[0] = (SRC_PTR)->stfle_bits[0];
 
@@ -205,7 +202,6 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
   cpu_features->stfle_bits[0] = cpu_features_curr.stfle_bits[0]
     & cpu_features_orig.stfle_bits[0];
 }
-#endif
 
 static inline void
 init_cpu_features (struct cpu_features *cpu_features)
@@ -233,7 +229,5 @@ init_cpu_features (struct cpu_features *cpu_features)
       cpu_features->stfle_bits[0] = 0ULL;
     }
 
-#if HAVE_TUNABLES
   TUNABLE_GET (glibc, cpu, hwcaps, tunable_val_t *, TUNABLE_CALLBACK (set_hwcaps));
-#endif
 }
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index 835e68925b..9b57ae1a93 100644
--- a/sysdeps/sparc/sparc32/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -39,8 +39,9 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
     return 1;
   else if (ehdr->e_machine == EM_SPARC32PLUS)
     {
-#if HAVE_TUNABLES || defined SHARED
-      uint64_t hwcap_mask = GET_HWCAP_MASK();
+#if defined SHARED
+      uint64_t hwcap_mask = TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t,
+					 NULL);
       return GLRO(dl_hwcap) & hwcap_mask & HWCAP_SPARC_V9;
 #else
       return GLRO(dl_hwcap) & HWCAP_SPARC_V9;
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index f8bd12d991..b4323b2604 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -245,11 +245,9 @@ tests-internal += \
   tst-sigcontext-get_pc \
   # tests-internal
 
-ifneq (no,$(have-tunables))
 tests-internal += \
   tst-rseq-disable \
-  # tests-internal $(have-tunables)
-endif
+  # tests-internal
 
 tests-time64 += \
   tst-adjtimex-time64 \
diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
index 0380f116de..dc09c1c827 100644
--- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
@@ -30,7 +30,6 @@
    to see when pointer have been correctly tagged.  */
 #define MTE_ALLOWED_TAGS (0xfffe << PR_MTE_TAG_SHIFT)
 
-#if HAVE_TUNABLES
 struct cpu_list
 {
   const char *name;
@@ -59,19 +58,16 @@ get_midr_from_mcpu (const char *mcpu)
 
   return UINT64_MAX;
 }
-#endif
 
 static inline void
 init_cpu_features (struct cpu_features *cpu_features)
 {
   register uint64_t midr = UINT64_MAX;
 
-#if HAVE_TUNABLES
   /* Get the tunable override.  */
   const char *mcpu = TUNABLE_GET (glibc, cpu, name, const char *, NULL);
   if (mcpu != NULL)
     midr = get_midr_from_mcpu (mcpu);
-#endif
 
   /* If there was no useful tunable override, query the MIDR if the kernel
      allows it.  */
@@ -100,13 +96,11 @@ init_cpu_features (struct cpu_features *cpu_features)
   cpu_features->mte_state = 0;
 
 #ifdef USE_MTAG
-# if HAVE_TUNABLES
   int mte_state = TUNABLE_GET (glibc, mem, tagging, unsigned, 0);
   cpu_features->mte_state = (GLRO (dl_hwcap2) & HWCAP2_MTE) ? mte_state : 0;
   /* If we lack the MTE feature, disable the tunable, since it will
      otherwise cause instructions that won't run on this CPU to be used.  */
   TUNABLE_SET (glibc, mem, tagging, cpu_features->mte_state);
-# endif
 
   if (cpu_features->mte_state & 4)
     /* Enable choosing system-preferred faulting mode.  */
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-conf.c b/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
index 8cd945a6c5..7c98dbd0d0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <dl-procinfo.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE elision
-#endif
+#define TUNABLE_NAMESPACE elision
 #include <elf/dl-tunables.h>
 
 /* Reasonable initial tuning values, may be revised in the future.
@@ -51,7 +49,6 @@ struct elision_config __elision_aconf =
     .skip_trylock_internal_abort = 3,
   };
 
-#if HAVE_TUNABLES
 static inline void
 __always_inline
 do_set_elision_enable (int32_t elision_enable)
@@ -94,14 +91,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
 TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
-#endif
 
 /* Initialize elision.  */
 
 void
 __lll_elision_init (void)
 {
-#if HAVE_TUNABLES
   /* Elision depends on tunables and must be explicitly turned on by setting
      the appropriate tunable on a supported platform.  */
 
@@ -117,7 +112,6 @@ __lll_elision_init (void)
 	       TUNABLE_CALLBACK (set_elision_try_tbegin));
   TUNABLE_GET (skip_trylock_internal_abort, int32_t,
 	       TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
-#endif
 
   /* Linux from 3.9 through 4.2 do not abort HTM transaction on syscalls,
      instead it suspends the transaction and resumes it when returning to
diff --git a/sysdeps/unix/sysv/linux/s390/elision-conf.c b/sysdeps/unix/sysv/linux/s390/elision-conf.c
index 5911e51097..6a6d6814ee 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/s390/elision-conf.c
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <dl-procinfo.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE elision
-#endif
+#define TUNABLE_NAMESPACE elision
 #include <elf/dl-tunables.h>
 
 /* Reasonable initial tuning values, may be revised in the future.
@@ -51,7 +49,6 @@ struct elision_config __elision_aconf =
     .skip_trylock_internal_abort = 3,
   };
 
-#if HAVE_TUNABLES
 static inline void
 __always_inline
 do_set_elision_enable (int32_t elision_enable)
@@ -93,14 +90,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
 TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
-#endif
 
 /* Initialize elison.  */
 
 void
 __lll_elision_init (void)
 {
-#if HAVE_TUNABLES
   /* Elision depends on tunables and must be explicitly turned on by setting
      the appropriate tunable on a supported platform.  */
 
@@ -116,7 +111,6 @@ __lll_elision_init (void)
 	       TUNABLE_CALLBACK (set_elision_try_tbegin));
   TUNABLE_GET (skip_trylock_internal_abort, int32_t,
 	       TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
-#endif
 
   if (!__pthread_force_elision)
     __elision_aconf.try_tbegin = 0; /* Disable elision on rwlocks.  */
diff --git a/sysdeps/unix/sysv/linux/x86/elision-conf.c b/sysdeps/unix/sysv/linux/x86/elision-conf.c
index 6447bda96b..cfd9a71e31 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-conf.c
@@ -22,9 +22,7 @@
 #include <elision-conf.h>
 #include <unistd.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE elision
-#endif
+#define TUNABLE_NAMESPACE elision
 #include <elf/dl-tunables.h>
 
 /* Reasonable initial tuning values, may be revised in the future.
@@ -48,7 +46,6 @@ struct elision_config __elision_aconf =
     .skip_trylock_internal_abort = 3,
   };
 
-#if HAVE_TUNABLES
 static __always_inline void
 do_set_elision_enable (int32_t elision_enable)
 {
@@ -87,14 +84,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_busy, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
 TUNABLE_CALLBACK_FNDECL (retry_try_xbegin, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
-#endif
 
 /* Initialize elision.  */
 
 void
 __lll_elision_init (void)
 {
-#if HAVE_TUNABLES
   /* Elision depends on tunables and must be explicitly turned on by setting
      the appropriate tunable on a supported platform.  */
 
@@ -108,7 +103,6 @@ __lll_elision_init (void)
 	       TUNABLE_CALLBACK (set_elision_retry_try_xbegin));
   TUNABLE_GET (skip_trylock_internal_abort, int32_t,
 	       TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
-#endif
 
   if (!__pthread_force_elision)
     __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks.  */
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/Makefile b/sysdeps/unix/sysv/linux/x86_64/64/Makefile
index 8ff4f27786..1bf7d528b2 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/Makefile
+++ b/sysdeps/unix/sysv/linux/x86_64/64/Makefile
@@ -2,7 +2,6 @@
 default-abi := 64
 
 ifeq ($(subdir),elf)
-ifneq ($(have-tunables),no)
 
 tests-map-32bit = \
   tst-map-32bit-1a \
@@ -24,4 +23,3 @@ tst-map-32bit-1b-ENV = GLIBC_TUNABLES=glibc.cpu.prefer_map_32bit_exec=1
 $(objpfx)tst-map-32bit-1b: $(objpfx)tst-map-32bit-mod.so
 
 endif
-endif
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 56fd5fc805..917c26f116 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -25,7 +25,6 @@ tests-static += \
   tst-ifunc-isa-1-static
 test-xfail-tst-ifunc-isa-1 = $(with-lld)
 test-xfail-tst-ifunc-isa-1-static = $(with-lld)
-ifneq ($(have-tunables),no)
 tests += \
   tst-ifunc-isa-2 \
   tst-ifunc-isa-2-static
@@ -35,7 +34,6 @@ test-xfail-tst-ifunc-isa-2 = $(with-lld)
 test-xfail-tst-ifunc-isa-2-static = $(with-lld)
 endif
 endif
-endif
 ifeq (yes,$(enable-x86-isa-level))
 tests += tst-isa-level-1
 modules-names += tst-isa-level-mod-1-baseline \
@@ -65,11 +63,9 @@ $(objpfx)tst-isa-level-1.out: $(objpfx)tst-isa-level-mod-1-baseline.so \
 			      $(objpfx)tst-isa-level-mod-1-v3.so \
 			      $(objpfx)tst-isa-level-mod-1-v4.so
 endif
-ifneq ($(have-tunables),no)
 tst-ifunc-isa-2-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SSE4_2,-AVX,-AVX2,-AVX512F
 tst-ifunc-isa-2-static-ENV = $(tst-ifunc-isa-2-ENV)
 endif
-endif
 
 ifeq ($(subdir),math)
 tests += tst-ldbl-nonnormal-printf
@@ -79,12 +75,10 @@ ifeq ($(subdir),setjmp)
 gen-as-const-headers += jmp_buf-ssp.sym
 sysdep_routines += __longjmp_cancel
 ifneq ($(enable-cet),no)
-ifneq ($(have-tunables),no)
 tests += tst-setjmp-cet
 tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
 endif
 endif
-endif
 
 ifeq ($(subdir),string)
 sysdep_routines += cacheinfo
@@ -135,10 +129,8 @@ tests += tst-cet-legacy-1 tst-cet-legacy-1a tst-cet-legacy-2 \
 	 tst-cet-legacy-10 tst-cet-legacy-10-static
 tests-static += tst-cet-legacy-9-static tst-cet-legacy-10-static
 tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
-ifneq (no,$(have-tunables))
 tests += tst-cet-legacy-4a tst-cet-legacy-4b tst-cet-legacy-4c \
 	 tst-cet-legacy-5b tst-cet-legacy-6b
-endif
 modules-names += tst-cet-legacy-mod-1 tst-cet-legacy-mod-2 \
 		 tst-cet-legacy-mod-4 tst-cet-legacy-mod-5a \
 		 tst-cet-legacy-mod-5b tst-cet-legacy-mod-5c \
@@ -195,7 +187,6 @@ $(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
 $(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
 $(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
 LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
-ifneq (no,$(have-tunables))
 $(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
 tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
 $(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
@@ -211,7 +202,6 @@ tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 endif
-endif
 
 # Add -fcf-protection to CFLAGS when CET is enabled.
 CFLAGS-.o += -fcf-protection
diff --git a/sysdeps/x86/cacheinfo.h b/sysdeps/x86/cacheinfo.h
index 7a99e04b73..ec1bc142c4 100644
--- a/sysdeps/x86/cacheinfo.h
+++ b/sysdeps/x86/cacheinfo.h
@@ -21,11 +21,9 @@
 #include <cpuid.h>
 #include <cpu-features.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE cpu
-# include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
-# include <elf/dl-tunables.h>
-#endif
+#define TUNABLE_NAMESPACE cpu
+#include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
+#include <elf/dl-tunables.h>
 
 #if IS_IN (libc)
 /* Data cache size for use in memory and string routines, typically
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 822688e21f..978eb29f72 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -23,11 +23,10 @@
 #include <dl-cacheinfo.h>
 #include <dl-minsigstacksize.h>
 
-#if HAVE_TUNABLES
 extern void TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *)
   attribute_hidden;
 
-# ifdef __LP64__
+#ifdef __LP64__
 static void
 TUNABLE_CALLBACK (set_prefer_map_32bit_exec) (tunable_val_t *valp)
 {
@@ -35,17 +34,14 @@ TUNABLE_CALLBACK (set_prefer_map_32bit_exec) (tunable_val_t *valp)
     GLRO(dl_x86_cpu_features).preferred[index_arch_Prefer_MAP_32BIT_EXEC]
       |= bit_arch_Prefer_MAP_32BIT_EXEC;
 }
-# endif
+#endif
 
-# if CET_ENABLED
+#if CET_ENABLED
 extern void TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *)
   attribute_hidden;
 extern void TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *)
   attribute_hidden;
-# endif
-#endif
 
-#if CET_ENABLED
 # include <dl-cet.h>
 #endif
 
@@ -712,13 +708,12 @@ no_cpuid:
 
   dl_init_cacheinfo (cpu_features);
 
-#if HAVE_TUNABLES
   TUNABLE_GET (hwcaps, tunable_val_t *, TUNABLE_CALLBACK (set_hwcaps));
 
-# ifdef __LP64__
+#ifdef __LP64__
   TUNABLE_GET (prefer_map_32bit_exec, tunable_val_t *,
 	       TUNABLE_CALLBACK (set_prefer_map_32bit_exec));
-# endif
+#endif
 
   bool disable_xsave_features = false;
 
@@ -774,13 +769,6 @@ no_cpuid:
       CPU_FEATURE_UNSET (cpu_features, FMA4);
     }
 
-#elif defined SHARED
-  /* Reuse dl_platform, dl_hwcap and dl_hwcap_mask for x86.  The
-     glibc.cpu.hwcap_mask tunable is initialized already, so no
-     need to do this.  */
-  GLRO(dl_hwcap_mask) = HWCAP_IMPORTANT;
-#endif
-
 #ifdef __x86_64__
   GLRO(dl_hwcap) = HWCAP_X86_64;
   if (cpu_features->basic.kind == arch_kind_intel)
@@ -828,12 +816,10 @@ no_cpuid:
 #endif
 
 #if CET_ENABLED
-# if HAVE_TUNABLES
   TUNABLE_GET (x86_ibt, tunable_val_t *,
 	       TUNABLE_CALLBACK (set_x86_ibt));
   TUNABLE_GET (x86_shstk, tunable_val_t *,
 	       TUNABLE_CALLBACK (set_x86_shstk));
-# endif
 
   /* Check CET status.  */
   unsigned int cet_status = get_cet_status ();
diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c
index 772fb0c4c2..0d4f328585 100644
--- a/sysdeps/x86/cpu-tunables.c
+++ b/sysdeps/x86/cpu-tunables.c
@@ -16,31 +16,30 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE cpu
-# include <stdbool.h>
-# include <stdint.h>
-# include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
-# include <elf/dl-tunables.h>
-# include <string.h>
-# include <cpu-features.h>
-# include <ldsodefs.h>
+#define TUNABLE_NAMESPACE cpu
+#include <stdbool.h>
+#include <stdint.h>
+#include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
+#include <elf/dl-tunables.h>
+#include <string.h>
+#include <cpu-features.h>
+#include <ldsodefs.h>
 
 /* We can't use IFUNC memcmp nor strlen in init_cpu_features from libc.a
    since IFUNC must be set up by init_cpu_features.  */
-# if defined USE_MULTIARCH && !defined SHARED
-#  ifdef __x86_64__
+#if defined USE_MULTIARCH && !defined SHARED
+# ifdef __x86_64__
 /* DEFAULT_MEMCMP by sysdeps/x86_64/memcmp-isa-default-impl.h.  */
-#   include <sysdeps/x86_64/memcmp-isa-default-impl.h>
-#  else
-#   define DEFAULT_MEMCMP	__memcmp_ia32
-#  endif
-extern __typeof (memcmp) DEFAULT_MEMCMP;
+#  include <sysdeps/x86_64/memcmp-isa-default-impl.h>
 # else
-#  define DEFAULT_MEMCMP	memcmp
+#  define DEFAULT_MEMCMP	__memcmp_ia32
 # endif
+extern __typeof (memcmp) DEFAULT_MEMCMP;
+#else
+# define DEFAULT_MEMCMP	memcmp
+#endif
 
-# define CHECK_GLIBC_IFUNC_CPU_OFF(f, cpu_features, name, len)		\
+#define CHECK_GLIBC_IFUNC_CPU_OFF(f, cpu_features, name, len)		\
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
   if (!DEFAULT_MEMCMP (f, #name, len))					\
     {									\
@@ -50,7 +49,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
 
 /* Disable a preferred feature NAME.  We don't enable a preferred feature
    which isn't available.  */
-# define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len)	\
+#define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len)	\
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
   if (!DEFAULT_MEMCMP (f, #name, len))					\
     {									\
@@ -60,7 +59,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
     }
 
 /* Enable/disable a preferred feature NAME.  */
-# define CHECK_GLIBC_IFUNC_PREFERRED_BOTH(f, cpu_features, name,	\
+#define CHECK_GLIBC_IFUNC_PREFERRED_BOTH(f, cpu_features, name,	\
 					  disable, len)			\
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
   if (!DEFAULT_MEMCMP (f, #name, len))					\
@@ -74,7 +73,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
 
 /* Enable/disable a preferred feature NAME.  Enable a preferred feature
    only if the feature NEED is usable.  */
-# define CHECK_GLIBC_IFUNC_PREFERRED_NEED_BOTH(f, cpu_features, name,	\
+#define CHECK_GLIBC_IFUNC_PREFERRED_NEED_BOTH(f, cpu_features, name,	\
 					       need, disable, len)	\
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
   if (!DEFAULT_MEMCMP (f, #name, len))					\
@@ -286,8 +285,7 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
   while (*c != '\0');
 }
 
-# if CET_ENABLED
-
+#if CET_ENABLED
 attribute_hidden
 void
 TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *valp)
@@ -313,5 +311,4 @@ TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *valp)
 			   sizeof ("permissive")) == 0)
     GL(dl_x86_feature_control).shstk = cet_permissive;
 }
-# endif
 #endif
diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
index a0474af8d1..ab671487da 100644
--- a/sysdeps/x86/dl-cacheinfo.h
+++ b/sysdeps/x86/dl-cacheinfo.h
@@ -760,10 +760,8 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
   else if (non_temporal_threshold > maximum_non_temporal_threshold)
     non_temporal_threshold = maximum_non_temporal_threshold;
 
-#if HAVE_TUNABLES
   /* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8.  */
   unsigned int minimum_rep_movsb_threshold;
-#endif
   /* NB: The default REP MOVSB threshold is 4096 * (VEC_SIZE / 16) for
      VEC_SIZE == 64 or 32.  For VEC_SIZE == 16, the default REP MOVSB
      threshold is 2048 * (VEC_SIZE / 16).  */
@@ -772,24 +770,18 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
       && !CPU_FEATURE_PREFERRED_P (cpu_features, Prefer_No_AVX512))
     {
       rep_movsb_threshold = 4096 * (64 / 16);
-#if HAVE_TUNABLES
       minimum_rep_movsb_threshold = 64 * 8;
-#endif
     }
   else if (CPU_FEATURE_PREFERRED_P (cpu_features,
 				    AVX_Fast_Unaligned_Load))
     {
       rep_movsb_threshold = 4096 * (32 / 16);
-#if HAVE_TUNABLES
       minimum_rep_movsb_threshold = 32 * 8;
-#endif
     }
   else
     {
       rep_movsb_threshold = 2048 * (16 / 16);
-#if HAVE_TUNABLES
       minimum_rep_movsb_threshold = 16 * 8;
-#endif
     }
   /* NB: The default REP MOVSB threshold is 2112 on processors with fast
      short REP MOVSB (FSRM).  */
@@ -799,7 +791,6 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
   /* The default threshold to use Enhanced REP STOSB.  */
   unsigned long int rep_stosb_threshold = 2048;
 
-#if HAVE_TUNABLES
   long int tunable_size;
 
   tunable_size = TUNABLE_GET (x86_data_cache_size, long int, NULL);
@@ -836,7 +827,6 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
 			   minimum_rep_movsb_threshold, SIZE_MAX);
   TUNABLE_SET_WITH_BOUNDS (x86_rep_stosb_threshold, rep_stosb_threshold, 1,
 			   SIZE_MAX);
-#endif
 
   unsigned long int rep_movsb_stop_threshold;
   /* ERMS feature is implemented from AMD Zen3 architecture and it is
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 688eb2d7c4..54396c3c3f 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -57,7 +57,6 @@ $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
 CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
 CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
 
-ifneq (no,$(have-tunables))
 tests += tst-platform-1
 modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
 extra-test-objs += tst-platformmod-2.o
@@ -71,7 +70,6 @@ $(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
 # always set to x86_64.
 tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
 	GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX512F,-AVX2
-endif
 
 tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
 	 tst-audit10 tst-sse tst-avx tst-avx512
-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-13 19:06 [PATCH 0/2] Make tunable a default feature Adhemerval Zanella
  2023-03-13 19:06 ` [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable Adhemerval Zanella
  2023-03-13 19:06 ` [PATCH 2/2] Remove --enable-tunables configure option Adhemerval Zanella
@ 2023-03-14 18:02 ` Siddhesh Poyarekar
  2023-03-15 20:05   ` Adhemerval Zanella Netto
  2 siblings, 1 reply; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-14 18:02 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha, Florian Weimer

On 2023-03-13 15:06, Adhemerval Zanella wrote:
> It is enabled as default since 2.26, some features option require it
> (such as hwcap mask, huge pages support, and lock elisition tuning),
> and assuming its support also simplifies the build permutation.

from a historical perspective, there was not just the question of 
enabling tunables but also providing multiple ways to read tunables, 
each having its own parser.  That is why there's a 'valstring' as an 
option for --enable-tunables.

Over the years there haven't really been any other ideas to read 
tunables.  There's the idea of systemwide tunables through, e.g. 
ld.so.conf that we'd like to have at some point, but that is more 
effective alongside valstring than as an either-or feature.

There's also conceivably a use case for having only systemwide tunables 
without any valstring override but maybe that should get supported when 
it's actually needed by someone.  So in summary, I'm not aware of 
anybody using --disable-tunables, so I'm not opposed to removing the 
configure flag altogether and simplifying the code.  Hopefully if 
someone is using it they'll come forward before this patchset gets accepted.

Thanks,
Sid

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-14 18:02 ` [PATCH 0/2] Make tunable a default feature Siddhesh Poyarekar
@ 2023-03-15 20:05   ` Adhemerval Zanella Netto
  2023-03-17 11:15     ` Siddhesh Poyarekar
  0 siblings, 1 reply; 18+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-15 20:05 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 14/03/23 15:02, Siddhesh Poyarekar wrote:
> On 2023-03-13 15:06, Adhemerval Zanella wrote:
>> It is enabled as default since 2.26, some features option require it
>> (such as hwcap mask, huge pages support, and lock elisition tuning),
>> and assuming its support also simplifies the build permutation.
> 
> from a historical perspective, there was not just the question of enabling tunables but also providing multiple ways to read tunables, each having its own parser.  That is why there's a 'valstring' as an option for --enable-tunables.

Does it really make sense to provide such option, where multiple distributions
would support different tunables? I don't this much as way forward, it would require
additional effort to document, along with some prudence to make it concise. And
its has the inherent problem of fragmentation.

> 
> Over the years there haven't really been any other ideas to read tunables.  There's the idea of systemwide tunables through, e.g. ld.so.conf that we'd like to have at some point, but that is more effective alongside valstring than as an either-or feature.

For ld.so cache, the program can use DF_1_NODEFLIB to either avoid its costs or
not use system cache (if its uses RUNPATH).  I think a system-wide tunable would
require a similar scheme, where the program can opt-out if required.

> 
> There's also conceivably a use case for having only systemwide tunables without any valstring override but maybe that should get supported when it's actually needed by someone.  So in summary, I'm not aware of anybody using --disable-tunables, so I'm not opposed to removing the configure flag altogether and simplifying the code.  Hopefully if someone is using it they'll come forward before this patchset gets accepted.

Alright, so I think it should be good to setup this for next release then.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-15 20:05   ` Adhemerval Zanella Netto
@ 2023-03-17 11:15     ` Siddhesh Poyarekar
  2023-03-20 16:59       ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-17 11:15 UTC (permalink / raw)
  To: Adhemerval Zanella Netto, libc-alpha, Florian Weimer

On 2023-03-15 16:05, Adhemerval Zanella Netto wrote:
> On 14/03/23 15:02, Siddhesh Poyarekar wrote:
>> On 2023-03-13 15:06, Adhemerval Zanella wrote:
>>> It is enabled as default since 2.26, some features option require it
>>> (such as hwcap mask, huge pages support, and lock elisition tuning),
>>> and assuming its support also simplifies the build permutation.
>>
>> from a historical perspective, there was not just the question of enabling tunables but also providing multiple ways to read tunables, each having its own parser.  That is why there's a 'valstring' as an option for --enable-tunables.
> 
> Does it really make sense to provide such option, where multiple distributions
> would support different tunables? I don't this much as way forward, it would require
> additional effort to document, along with some prudence to make it concise. And
> its has the inherent problem of fragmentation.

Yeah I agree it doesn't make a lot of sense anymore; I think we made it 
like that to bake in some flexibility for use cases we weren't aware of 
yet.  I mentioned it here in the hope that folks who were part of the 
conversation then and have better memory than I would be able to pitch 
in with additional context :)

>> Over the years there haven't really been any other ideas to read tunables.  There's the idea of systemwide tunables through, e.g. ld.so.conf that we'd like to have at some point, but that is more effective alongside valstring than as an either-or feature.
> 
> For ld.so cache, the program can use DF_1_NODEFLIB to either avoid its costs or
> not use system cache (if its uses RUNPATH).  I think a system-wide tunable would
> require a similar scheme, where the program can opt-out if required.

Actually I was thinking of systemwide tunables as the canonical way to 
apply default rules that *won't* get overridden by users.  That could 
allow users to, e.g. lock down memory tagging on a systemwide basis if 
needed, or put a hard upper or lower limit on some of the malloc 
tunables.  The scheme would work similar to rlimit, but it shouldn't be 
misunderstood to be a security feature in that sense; applications can 
always work around a malloc tunable limit by rolling their own allocator.

>> There's also conceivably a use case for having only systemwide tunables without any valstring override but maybe that should get supported when it's actually needed by someone.  So in summary, I'm not aware of anybody using --disable-tunables, so I'm not opposed to removing the configure flag altogether and simplifying the code.  Hopefully if someone is using it they'll come forward before this patchset gets accepted.
> 
> Alright, so I think it should be good to setup this for next release then.

Yep.  I don't know how we can make this more widely visible before we 
drop the option.  Maybe @gnutools could tweet about it.  If there are no 
major objections in the next week or so I'll do a proper review of the 
patchset.

Thanks,
Sid

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-17 11:15     ` Siddhesh Poyarekar
@ 2023-03-20 16:59       ` Adhemerval Zanella Netto
  2023-03-20 23:15         ` Siddhesh Poyarekar
  0 siblings, 1 reply; 18+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-20 16:59 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 17/03/23 08:15, Siddhesh Poyarekar wrote:
> On 2023-03-15 16:05, Adhemerval Zanella Netto wrote:
>> On 14/03/23 15:02, Siddhesh Poyarekar wrote:
>>> On 2023-03-13 15:06, Adhemerval Zanella wrote:
>>>> It is enabled as default since 2.26, some features option require it
>>>> (such as hwcap mask, huge pages support, and lock elisition tuning),
>>>> and assuming its support also simplifies the build permutation.
>>>
>>> from a historical perspective, there was not just the question of enabling tunables but also providing multiple ways to read tunables, each having its own parser.  That is why there's a 'valstring' as an option for --enable-tunables.
>>
>> Does it really make sense to provide such option, where multiple distributions
>> would support different tunables? I don't this much as way forward, it would require
>> additional effort to document, along with some prudence to make it concise. And
>> its has the inherent problem of fragmentation.
> 
> Yeah I agree it doesn't make a lot of sense anymore; I think we made it like that to bake in some flexibility for use cases we weren't aware of yet.  I mentioned it here in the hope that folks who were part of the conversation then and have better memory than I would be able to pitch in with additional context :)
> 
>>> Over the years there haven't really been any other ideas to read tunables.  There's the idea of systemwide tunables through, e.g. ld.so.conf that we'd like to have at some point, but that is more effective alongside valstring than as an either-or feature.
>>
>> For ld.so cache, the program can use DF_1_NODEFLIB to either avoid its costs or
>> not use system cache (if its uses RUNPATH).  I think a system-wide tunable would
>> require a similar scheme, where the program can opt-out if required.
> 
> Actually I was thinking of systemwide tunables as the canonical way to apply default rules that *won't* get overridden by users.  That could allow users to, e.g. lock down memory tagging on a systemwide basis if needed, or put a hard upper or lower limit on some of the malloc tunables.  The scheme would work similar to rlimit, but it shouldn't be misunderstood to be a security feature in that sense; applications can always work around a malloc tunable limit by rolling their own allocator.

I think it might make sense for tunables that change the program semantic, such
as security hardening; although I don't think it really fits for performance
oriented ones (such malloc or pthread tuning).  So maybe we can define a global
file format where the administrator can set where setuid binaries can use it,
and if uses can overwrite it.  My initial idea would be something quite simple,
similar to sysctl.conf:

$ cat /etc/glibc-tunables.conf
# tunable                       setuid   override
glibc.cpu.hwcaps=-AVX512F,-AVX2      1          0
glibc.malloc.trim_threshold=128      1          1
glibc.malloc.tcache_count=2          0          1

And I was thinking about an DF_1_NODEFLIB analogous so the program can opt-out
any performance or behavior difference any tunable might incur.  Although with
your idea of enforceable tunable, I think it does not make much sense.

> 
>>> There's also conceivably a use case for having only systemwide tunables without any valstring override but maybe that should get supported when it's actually needed by someone.  So in summary, I'm not aware of anybody using --disable-tunables, so I'm not opposed to removing the configure flag altogether and simplifying the code.  Hopefully if someone is using it they'll come forward before this patchset gets accepted.
>>
>> Alright, so I think it should be good to setup this for next release then.
> 
> Yep.  I don't know how we can make this more widely visible before we drop the option.  Maybe @gnutools could tweet about it.  If there are no major objections in the next week or so I'll do a proper review of the patchset.
> 
> Thanks,
> Sid

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-20 16:59       ` Adhemerval Zanella Netto
@ 2023-03-20 23:15         ` Siddhesh Poyarekar
  2023-03-22 14:40           ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-20 23:15 UTC (permalink / raw)
  To: Adhemerval Zanella Netto, libc-alpha, Florian Weimer

On 2023-03-20 12:59, Adhemerval Zanella Netto wrote:
> I think it might make sense for tunables that change the program semantic, such
> as security hardening; although I don't think it really fits for performance
> oriented ones (such malloc or pthread tuning).  So maybe we can define a global

Administrative level performance tuning defaults for setuid binaries?

> file format where the administrator can set where setuid binaries can use it,
> and if uses can overwrite it.  My initial idea would be something quite simple,
> similar to sysctl.conf:

Yes, I think Florian suggested reusing ld.so.conf instead.  I don't have 
a strong preference either way so y'all can fight that one out - potato 
potato ;)

> And I was thinking about an DF_1_NODEFLIB analogous so the program can opt-out
> any performance or behavior difference any tunable might incur.  Although with
> your idea of enforceable tunable, I think it does not make much sense.

Yeah an ELF flag to override all tunables seems counter to the whole 
idea, but ELF flags to override specific tunables may make sense.  E.g. 
memory tagging enabled by default in the system and a program built with 
DF_NO_MEMTAG overrides that systemwide setting.

Sid

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-20 23:15         ` Siddhesh Poyarekar
@ 2023-03-22 14:40           ` Adhemerval Zanella Netto
  2023-03-22 15:21             ` Siddhesh Poyarekar
  0 siblings, 1 reply; 18+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-22 14:40 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 20/03/23 20:15, Siddhesh Poyarekar wrote:
> On 2023-03-20 12:59, Adhemerval Zanella Netto wrote:
>> I think it might make sense for tunables that change the program semantic, such
>> as security hardening; although I don't think it really fits for performance
>> oriented ones (such malloc or pthread tuning).  So maybe we can define a global
> 
> Administrative level performance tuning defaults for setuid binaries?

I was thinking more of opt-in security features (such as mte_state on aarch64),
although it might fit better on some ABI extension (such as done by cet).

> 
>> file format where the administrator can set where setuid binaries can use it,
>> and if uses can overwrite it.  My initial idea would be something quite simple,
>> similar to sysctl.conf:
> 
> Yes, I think Florian suggested reusing ld.so.conf instead.  I don't have a strong preference either way so y'all can fight that one out - potato potato ;)

Did he mean add the tunable information on ld.so.conf or using a similar scheme
where the file is preprocessed by a tool so loader can just mmap a file without
the need any parsing?

For later, I don't have a strong opinion.  I assume that a global tunable won't
be a default configuration, like loader cache; and parsing should really easy
(it a ini like file).

> 
>> And I was thinking about an DF_1_NODEFLIB analogous so the program can opt-out
>> any performance or behavior difference any tunable might incur.  Although with
>> your idea of enforceable tunable, I think it does not make much sense.
> 
> Yeah an ELF flag to override all tunables seems counter to the whole idea, but ELF flags to override specific tunables may make sense.  E.g. memory tagging enabled by default in the system and a program built with DF_NO_MEMTAG overrides that systemwide setting.

The issue of a per-tunable flag is it will require to settle a minimum ABI for
tunable, or adding a ELF extension with a string blob that is only understable
by an specific glibc version.  I am not sure, maybe we can it only if required.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-22 14:40           ` Adhemerval Zanella Netto
@ 2023-03-22 15:21             ` Siddhesh Poyarekar
  2023-03-22 17:58               ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-22 15:21 UTC (permalink / raw)
  To: Adhemerval Zanella Netto, libc-alpha, Florian Weimer

On 2023-03-22 10:40, Adhemerval Zanella Netto wrote:
> 
> 
> On 20/03/23 20:15, Siddhesh Poyarekar wrote:
>> On 2023-03-20 12:59, Adhemerval Zanella Netto wrote:
>>> I think it might make sense for tunables that change the program semantic, such
>>> as security hardening; although I don't think it really fits for performance
>>> oriented ones (such malloc or pthread tuning).  So maybe we can define a global
>>
>> Administrative level performance tuning defaults for setuid binaries?
> 
> I was thinking more of opt-in security features (such as mte_state on aarch64),
> although it might fit better on some ABI extension (such as done by cet).

Yeah, that too.

>>> file format where the administrator can set where setuid binaries can use it,
>>> and if uses can overwrite it.  My initial idea would be something quite simple,
>>> similar to sysctl.conf:
>>
>> Yes, I think Florian suggested reusing ld.so.conf instead.  I don't have a strong preference either way so y'all can fight that one out - potato potato ;)
> 
> Did he mean add the tunable information on ld.so.conf or using a similar scheme
> where the file is preprocessed by a tool so loader can just mmap a file without
> the need any parsing?
> 
> For later, I don't have a strong opinion.  I assume that a global tunable won't
> be a default configuration, like loader cache; and parsing should really easy
> (it a ini like file).

Just the former IIRC, i.e. extending ld.so.conf to add a section for 
systemwide tunables.

>>
>>> And I was thinking about an DF_1_NODEFLIB analogous so the program can opt-out
>>> any performance or behavior difference any tunable might incur.  Although with
>>> your idea of enforceable tunable, I think it does not make much sense.
>>
>> Yeah an ELF flag to override all tunables seems counter to the whole idea, but ELF flags to override specific tunables may make sense.  E.g. memory tagging enabled by default in the system and a program built with DF_NO_MEMTAG overrides that systemwide setting.
> 
> The issue of a per-tunable flag is it will require to settle a minimum ABI for
> tunable, or adding a ELF extension with a string blob that is only understable
> by an specific glibc version.  I am not sure, maybe we can it only if required.

We shouldn't need a flag for *every* tunable, only those that would have 
practical benefit from having ELF overrides, e.g. those that control 
architecture-specific features.

That is, the ELF flag should not be tied to a tunable, but a tunable 
could change behaviour based on an ELF flag.

Sid

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] Remove --enable-tunables configure option
  2023-03-13 19:06 ` [PATCH 2/2] Remove --enable-tunables configure option Adhemerval Zanella
@ 2023-03-22 16:25   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-22 16:25 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha, Florian Weimer

On 2023-03-13 15:06, Adhemerval Zanella wrote:
> And make always supported.  The configure option was added on glibc 2.25
> and some option require it (such as hwcap mask, huge pages support, and
> lock elisition tuning).  It also simplifies the build permutations.
> ---
>   INSTALL                                       |  19 ---
>   Makeconfig                                    |   4 -
>   NEWS                                          |   3 +
>   config.h.in                                   |   3 -
>   config.make.in                                |   1 -
>   configure                                     |  17 ---
>   configure.ac                                  |  10 --
>   elf/Makefile                                  |   8 +-
>   elf/dl-cache.c                                |   2 +-
>   elf/dl-hwcaps.h                               |  11 --
>   elf/dl-support.c                              |  15 ---
>   elf/dl-tls.c                                  |   6 -
>   elf/dl-tunables.h                             |  35 ++----
>   elf/dl-usage.c                                |   8 +-
>   elf/rtld.c                                    |  23 +---
>   elf/tst-env-setuid-tunables.c                 |  11 --
>   gmon/gmon.c                                   |  12 +-
>   malloc/Makefile                               |   2 -
>   malloc/arena.c                                | 118 +-----------------
>   malloc/malloc-check.c                         |   8 --
>   malloc/malloc.c                               |  14 +--
>   manual/install.texi                           |  19 ---
>   nptl/pthread_mutex_conf.c                     |   4 +-
>   nptl/tst-mutex8.c                             |   2 -
>   scripts/build-many-glibcs.py                  |   1 -
>   sysdeps/generic/ldsodefs.h                    |  17 ---
>   sysdeps/generic/unsecvars.h                   |   8 +-
>   sysdeps/nptl/dl-tls_init_tp.c                 |   2 -
>   sysdeps/nptl/pthreadP.h                       |   4 -
>   sysdeps/nptl/pthread_early_init.h             |   2 -
>   sysdeps/nptl/pthread_mutex_conf.h             |   8 --
>   sysdeps/powerpc/cpu-features.c                |   9 +-
>   sysdeps/s390/cpu-features.c                   |  14 +--
>   sysdeps/sparc/sparc32/dl-machine.h            |   5 +-
>   sysdeps/unix/sysv/linux/Makefile              |   4 +-
>   .../unix/sysv/linux/aarch64/cpu-features.c    |   6 -
>   .../unix/sysv/linux/powerpc/elision-conf.c    |   8 +-
>   sysdeps/unix/sysv/linux/s390/elision-conf.c   |   8 +-
>   sysdeps/unix/sysv/linux/x86/elision-conf.c    |   8 +-
>   sysdeps/unix/sysv/linux/x86_64/64/Makefile    |   2 -
>   sysdeps/x86/Makefile                          |  10 --
>   sysdeps/x86/cacheinfo.h                       |   8 +-
>   sysdeps/x86/cpu-features.c                    |  24 +---
>   sysdeps/x86/cpu-tunables.c                    |  45 ++++---
>   sysdeps/x86/dl-cacheinfo.h                    |  10 --
>   sysdeps/x86_64/Makefile                       |   2 -
>   46 files changed, 72 insertions(+), 488 deletions(-)
> 
> diff --git a/INSTALL b/INSTALL
> index 970d6627e2..021943d83f 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -234,25 +234,6 @@ if 'CFLAGS' is specified it must enable optimization.  For example:
>        By default for x86_64, the GNU C Library is built with the vector
>        math library.  Use this option to disable the vector math library.
>   
> -'--enable-tunables'
> -     Tunables support allows additional library parameters to be
> -     customized at runtime.  This feature is enabled by default.  This
> -     option can take the following values:
> -
> -     'yes'
> -          This is the default if no option is passed to configure.  This
> -          enables tunables and selects the default frontend (currently
> -          'valstring').
> -
> -     'no'
> -          This option disables tunables.
> -
> -     'valstring'
> -          This enables tunables and selects the 'valstring' frontend for
> -          tunables.  This frontend allows users to specify tunables as a
> -          colon-separated list in a single environment variable
> -          'GLIBC_TUNABLES'.
> -
>   '--disable-crypt'
>        Do not install the passphrase-hashing library 'libcrypt' or the
>        header file 'crypt.h'.  'unistd.h' will still declare the function
> diff --git a/Makeconfig b/Makeconfig
> index 2fda4af5f7..3dd69d83b6 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1019,9 +1019,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
>   			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
>   	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
>   
> -ifneq (no,$(have-tunables))
>   CPPFLAGS += -DTOP_NAMESPACE=glibc
> -endif

Maybe just merge this into the CPPFLAGS initialization above?

>   
>   override CFLAGS	= -std=gnu11 -fgnu89-inline $(config-extra-cflags) \
>   		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
> @@ -1203,7 +1201,6 @@ endif
>   
>   # Build the tunables list header early since it could be used by any module in
>   # glibc.
> -ifneq (no,$(have-tunables))
>   before-compile += $(common-objpfx)dl-tunable-list.h
>   common-generated += dl-tunable-list.h dl-tunable-list.stmp
>   
> @@ -1216,7 +1213,6 @@ $(common-objpfx)dl-tunable-list.stmp: \
>   	$(AWK) -f $^ > ${@:stmp=T}
>   	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
>   	touch $@
> -endif
>   
>   # Dump the GCC macros used by the default compiler flags to a header
>   # file, so that they can be inspected when using different compiler
> diff --git a/NEWS b/NEWS
> index 0f76e7a416..3958e133a1 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -28,6 +28,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>     alternatively stable kernels from versions 6.1.6, 5.15.87, 5.10.163,
>     5.4.228, 4.19.270 or 4.14.303.
>   
> +* The configure option --enable-tunables has been removed.  The tunable
> +  features is now always supported.
> +

Suggest:  The tunables feature is now always enabled.

>   Changes to build and runtime requirements:
>   
>     [Add changes to build and runtime requirements here]
> diff --git a/config.h.in b/config.h.in
> index 09730d9d52..c87008b6a9 100644
> --- a/config.h.in
> +++ b/config.h.in
> @@ -271,9 +271,6 @@
>   /* PowerPC32 uses fctidz for floating point to long long conversions.  */
>   #define HAVE_PPC_FCTIDZ 0
>   
> -/* Build glibc with tunables support.  */
> -#define HAVE_TUNABLES 0
> -
>   /* Define if PIE is unsupported.  */
>   #undef PIE_UNSUPPORTED
>   
> diff --git a/config.make.in b/config.make.in
> index d7c416cbea..9186a8aac9 100644
> --- a/config.make.in
> +++ b/config.make.in
> @@ -96,7 +96,6 @@ build-nscd = @build_nscd@
>   use-nscd = @use_nscd@
>   build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
>   build-pt-chown = @build_pt_chown@
> -have-tunables = @have_tunables@
>   pthread-in-libc = @pthread_in_libc@
>   
>   # Build tools.
> diff --git a/configure b/configure
> index efb891456a..f357aa0b9c 100755
> --- a/configure
> +++ b/configure
> @@ -664,7 +664,6 @@ INSTALL_DATA
>   INSTALL_SCRIPT
>   INSTALL_PROGRAM
>   base_machine
> -have_tunables
>   build_pt_chown
>   build_nscd
>   libc_cv_static_nss_crypt
> @@ -784,7 +783,6 @@ enable_systemtap
>   enable_build_nscd
>   enable_nscd
>   enable_pt_chown
> -enable_tunables
>   enable_mathvec
>   enable_cet
>   enable_scv
> @@ -1454,8 +1452,6 @@ Optional Features:
>     --disable-build-nscd    disable building and installing the nscd daemon
>     --disable-nscd          library functions will not contact the nscd daemon
>     --enable-pt_chown       Enable building and installing pt_chown
> -  --enable-tunables       Enable tunables support. Known values are 'yes',
> -                          'no' and 'valstring'
>     --enable-mathvec        Enable building and installing mathvec [default
>                             depends on architecture]
>     --enable-cet            enable Intel Control-flow Enforcement Technology
> @@ -3684,19 +3680,6 @@ if test "$build_pt_chown" = yes; then
>   
>   fi
>   
> -# Check whether --enable-tunables was given.
> -if test "${enable_tunables+set}" = set; then :
> -  enableval=$enable_tunables; have_tunables=$enableval
> -else
> -  have_tunables=yes
> -fi
> -
> -
> -if test "$have_tunables" = yes; then
> -  $as_echo "#define HAVE_TUNABLES 1" >>confdefs.h
> -
> -fi
> -
>   # The abi-tags file uses a fairly simplistic model for name recognition that
>   # can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a
>   # $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell.
> diff --git a/configure.ac b/configure.ac
> index 011844a3d4..6b316bfd44 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -441,16 +441,6 @@ if test "$build_pt_chown" = yes; then
>     AC_DEFINE(HAVE_PT_CHOWN)
>   fi
>   
> -AC_ARG_ENABLE([tunables],
> -	      [AS_HELP_STRING([--enable-tunables],
> -	       [Enable tunables support. Known values are 'yes', 'no' and 'valstring'])],
> -	      [have_tunables=$enableval],
> -	      [have_tunables=yes])
> -AC_SUBST(have_tunables)
> -if test "$have_tunables" = yes; then
> -  AC_DEFINE(HAVE_TUNABLES)
> -fi
> -
>   # The abi-tags file uses a fairly simplistic model for name recognition that
>   # can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a
>   # $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell.
> diff --git a/elf/Makefile b/elf/Makefile
> index 4d0e04b2a2..75bfd82c34 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -90,10 +90,9 @@ ifeq (yes,$(use-ldconfig))
>   dl-routines += dl-cache
>   endif
>   
> -ifneq (no,$(have-tunables))
>   dl-routines += dl-tunables
> -tunables-type = $(addprefix TUNABLES_FRONTEND_,$(have-tunables))
> -CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=$(tunables-type)
> +tunables-type = $(addprefix TUNABLES_FRONTEND_,yes)
> +CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=1

Couldn't we get rid of TUNABLES_FRONTEND too?

>   
>   ifeq (yesyes,$(build-shared)$(run-built-tests))
>   tests-special += $(objpfx)list-tunables.out
> @@ -104,7 +103,6 @@ endif
>   ifeq (yes,$(have-loop-to-function))
>   CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns
>   endif
> -endif
>   
>   all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
>   # But they are absent from the shared libc, because that code is in ld.so.
> @@ -1187,7 +1185,6 @@ postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
>   		       $(objpfx)/dso-sort-tests-2.generated-makefile
>   
>   # Generate from each testcase description file
> -ifeq (yes,$(have-tunables))
>   $(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
>   $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
>   
> @@ -1195,7 +1192,6 @@ $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
>   LDFLAGS-tst-bz15311-b.so += -Wl,-z,lazy
>   LDFLAGS-tst-bz15311-c.so += -Wl,-z,lazy
>   LDFLAGS-tst-bz15311-d.so += -Wl,-z,lazy
> -endif
>   
>   check-abi: $(objpfx)check-abi-ld.out \
>   	   $(objpfx)check-abi-version-libc.out
> diff --git a/elf/dl-cache.c b/elf/dl-cache.c
> index 07c054b11a..631286832d 100644
> --- a/elf/dl-cache.c
> +++ b/elf/dl-cache.c
> @@ -205,7 +205,7 @@ search_cache (const char *string_table, uint32_t string_table_size,
>     uint64_t platform = _dl_string_platform (GLRO (dl_platform));
>     if (platform != (uint64_t) -1)
>       platform = 1ULL << platform;
> -  uint64_t hwcap_mask = GET_HWCAP_MASK ();
> +  uint64_t hwcap_mask = TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t, NULL);
>   #define _DL_HWCAP_TLS_MASK (1LL << 63)
>     uint64_t hwcap_exclude = ~((GLRO (dl_hwcap) & hwcap_mask)
>   			     | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
> diff --git a/elf/dl-hwcaps.h b/elf/dl-hwcaps.h
> index abe6aaf7c5..3012ebf2b4 100644
> --- a/elf/dl-hwcaps.h
> +++ b/elf/dl-hwcaps.h
> @@ -24,17 +24,6 @@
>   
>   #include <elf/dl-tunables.h>
>   
> -#if HAVE_TUNABLES
> -# define GET_HWCAP_MASK() TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t, NULL)
> -#else
> -# ifdef SHARED
> -#   define GET_HWCAP_MASK() GLRO(dl_hwcap_mask)
> -# else
> -/* HWCAP_MASK is ignored in static binaries when built without tunables.  */
> -#  define GET_HWCAP_MASK() (0)
> -# endif
> -#endif
> -
>   #define GLIBC_HWCAPS_SUBDIRECTORY "glibc-hwcaps"
>   #define GLIBC_HWCAPS_PREFIX GLIBC_HWCAPS_SUBDIRECTORY "/"
>   
> diff --git a/elf/dl-support.c b/elf/dl-support.c
> index d2519ce1a9..322599916f 100644
> --- a/elf/dl-support.c
> +++ b/elf/dl-support.c
> @@ -168,16 +168,6 @@ enum dso_sort_algorithm _dl_dso_sort_algo;
>   /* The value of the FPU control word the kernel will preset in hardware.  */
>   fpu_control_t _dl_fpu_control = _FPU_DEFAULT;
>   
> -#if !HAVE_TUNABLES
> -/* This is not initialized to HWCAP_IMPORTANT, matching the definition
> -   of _dl_important_hwcaps, below, where no hwcap strings are ever
> -   used.  This mask is still used to mediate the lookups in the cache
> -   file.  Since there is no way to set this nonzero (we don't grok the
> -   LD_HWCAP_MASK environment variable here), there is no real point in
> -   setting _dl_hwcap nonzero below, but we do anyway.  */
> -uint64_t _dl_hwcap_mask;
> -#endif
> -
>   /* Prevailing state of the stack.  Generally this includes PF_X, indicating it's
>    * executable but this isn't true for all platforms.  */
>   ElfW(Word) _dl_stack_flags = DEFAULT_STACK_PERMS;
> @@ -328,11 +318,6 @@ _dl_non_dynamic_init (void)
>   	  __unsetenv (cp);
>   	  cp = strchr (cp, '\0') + 1;
>   	}
> -
> -#if !HAVE_TUNABLES
> -      if (__access ("/etc/suid-debug", F_OK) != 0)
> -	__unsetenv ("MALLOC_CHECK_");
> -#endif
>       }
>   
>   #ifdef DL_PLATFORM_INIT
> diff --git a/elf/dl-tls.c b/elf/dl-tls.c
> index 8943a3b4ae..4ef7bc3f1e 100644
> --- a/elf/dl-tls.c
> +++ b/elf/dl-tls.c
> @@ -97,14 +97,8 @@ _dl_tls_static_surplus_init (size_t naudit)
>   {
>     size_t nns, opt_tls;
>   
> -#if HAVE_TUNABLES
>     nns = TUNABLE_GET (nns, size_t, NULL);
>     opt_tls = TUNABLE_GET (optional_static_tls, size_t, NULL);
> -#else
> -  /* Default values of the tunables.  */
> -  nns = DEFAULT_NNS;
> -  opt_tls = OPTIONAL_TLS;
> -#endif
>     if (nns > DL_NNS)
>       nns = DL_NNS;
>     if (DL_NNS - nns < naudit)
> diff --git a/elf/dl-tunables.h b/elf/dl-tunables.h
> index ae6e014b95..7c7de704e9 100644
> --- a/elf/dl-tunables.h
> +++ b/elf/dl-tunables.h
> @@ -21,17 +21,9 @@
>   #ifndef _TUNABLES_H_
>   #define _TUNABLES_H_
>   
> -#if !HAVE_TUNABLES
> -static inline void
> -__always_inline
> -__tunables_init (char **unused __attribute__ ((unused)))
> -{
> -  /* This is optimized out if tunables are not enabled.  */
> -}
> -#else
> -# include <stdbool.h>
> -# include <stddef.h>
> -# include <stdint.h>
> +#include <stdbool.h>
> +#include <stddef.h>
> +#include <stdint.h>
>   
>   typedef intmax_t tunable_num_t;
>   
> @@ -44,12 +36,12 @@ typedef union
>   typedef void (*tunable_callback_t) (tunable_val_t *);
>   
>   /* Full name for a tunable is top_ns.tunable_ns.id.  */
> -# define TUNABLE_NAME_S(top,ns,id) #top "." #ns "." #id
> +#define TUNABLE_NAME_S(top,ns,id) #top "." #ns "." #id
>   
> -# define TUNABLE_ENUM_NAME(__top,__ns,__id) TUNABLE_ENUM_NAME1 (__top,__ns,__id)
> -# define TUNABLE_ENUM_NAME1(__top,__ns,__id) __top ## _ ## __ns ## _ ## __id
> +#define TUNABLE_ENUM_NAME(__top,__ns,__id) TUNABLE_ENUM_NAME1 (__top,__ns,__id)
> +#define TUNABLE_ENUM_NAME1(__top,__ns,__id) __top ## _ ## __ns ## _ ## __id
>   
> -# include "dl-tunable-list.h"
> +#include "dl-tunable-list.h"
>   
>   extern void __tunables_init (char **);
>   extern void __tunables_print (void);
> @@ -83,7 +75,7 @@ rtld_hidden_proto (__tunable_set_val)
>   
>   /* Get and return a tunable value.  If the tunable was set externally and __CB
>      is defined then call __CB before returning the value.  */
> -# define TUNABLE_GET_FULL(__top, __ns, __id, __type, __cb) \
> +#define TUNABLE_GET_FULL(__top, __ns, __id, __type, __cb) \
>   ({									      \
>     tunable_id_t id = TUNABLE_ENUM_NAME (__top, __ns, __id);		      \
>     __type ret;								      \
> @@ -92,14 +84,14 @@ rtld_hidden_proto (__tunable_set_val)
>   })
>   
>   /* Set a tunable value.  */
> -# define TUNABLE_SET_FULL(__top, __ns, __id, __val) \
> +#define TUNABLE_SET_FULL(__top, __ns, __id, __val) \
>   ({									      \
>     __tunable_set_val (TUNABLE_ENUM_NAME (__top, __ns, __id),		      \
>   		     & (tunable_val_t) {.numval = __val}, NULL, NULL);	      \
>   })
>   
>   /* Set a tunable value together with min/max values.  */
> -# define TUNABLE_SET_WITH_BOUNDS_FULL(__top, __ns, __id,__val, __min, __max)  \
> +#define TUNABLE_SET_WITH_BOUNDS_FULL(__top, __ns, __id,__val, __min, __max)  \
>   ({									      \
>     __tunable_set_val (TUNABLE_ENUM_NAME (__top, __ns, __id),		      \
>   		     & (tunable_val_t) {.numval = __val},		      \
> @@ -109,11 +101,11 @@ rtld_hidden_proto (__tunable_set_val)
>   
>   /* Namespace sanity for callback functions.  Use this macro to keep the
>      namespace of the modules clean.  */
> -# define TUNABLE_CALLBACK(__name) _dl_tunable_ ## __name
> +#define TUNABLE_CALLBACK(__name) _dl_tunable_ ## __name
>   
> -# define TUNABLES_FRONTEND_valstring 1
> +#define TUNABLES_FRONTEND_valstring 1
>   /* The default value for TUNABLES_FRONTEND.  */
> -# define TUNABLES_FRONTEND_yes TUNABLES_FRONTEND_valstring
> +#define TUNABLES_FRONTEND_yes TUNABLES_FRONTEND_valstring
>   
>   static __always_inline bool
>   tunable_val_lt (tunable_num_t lhs, tunable_num_t rhs, bool unsigned_cmp)
> @@ -149,4 +141,3 @@ tunable_is_name (const char *orig, const char *envname)
>   }
>   
>   #endif
> -#endif
> diff --git a/elf/dl-usage.c b/elf/dl-usage.c
> index 53535c1583..98f0b0d027 100644
> --- a/elf/dl-usage.c
> +++ b/elf/dl-usage.c
> @@ -195,12 +195,8 @@ setting environment variables (which would be inherited by subprocesses).\n\
>                           in LIST\n\
>     --audit LIST          use objects named in LIST as auditors\n\
>     --preload LIST        preload objects named in LIST\n\
> -  --argv0 STRING        set argv[0] to STRING before running\n"
> -#if HAVE_TUNABLES
> -"\
> -  --list-tunables       list all tunables with minimum and maximum values\n"
> -#endif
> -"\
> +  --argv0 STRING        set argv[0] to STRING before running\n\
> +  --list-tunables       list all tunables with minimum and maximum values\n\

The indentation seems a bit off, but maybe that's just my email client.

>     --list-diagnostics    list diagnostics information\n\
>     --help                display this help and exit\n\
>     --version             output version information and exit\n\
> diff --git a/elf/rtld.c b/elf/rtld.c
> index f82fbeb132..c1e383b055 100644
> --- a/elf/rtld.c
> +++ b/elf/rtld.c
> @@ -357,9 +357,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
>       ._dl_sysinfo = DL_SYSINFO_DEFAULT,
>   #endif
>       ._dl_debug_fd = STDERR_FILENO,
> -#if !HAVE_TUNABLES
> -    ._dl_hwcap_mask = HWCAP_IMPORTANT,
> -#endif
>       ._dl_lazy = 1,
>       ._dl_fpu_control = _FPU_DEFAULT,
>       ._dl_pagesize = EXEC_PAGESIZE,
> @@ -1483,7 +1480,6 @@ dl_main (const ElfW(Phdr) *phdr,
>   	    _dl_argc -= 2;
>   	    _dl_argv += 2;
>   	  }
> -#if HAVE_TUNABLES
>   	else if (! strcmp (_dl_argv[1], "--list-tunables"))
>   	  {
>   	    state.mode = rtld_mode_list_tunables;
> @@ -1491,7 +1487,6 @@ dl_main (const ElfW(Phdr) *phdr,
>   	    --_dl_argc;
>   	    ++_dl_argv;
>   	  }
> -#endif
>   	else if (! strcmp (_dl_argv[1], "--list-diagnostics"))
>   	  {
>   	    state.mode = rtld_mode_list_diagnostics;
> @@ -1519,13 +1514,11 @@ dl_main (const ElfW(Phdr) *phdr,
>   	else
>   	  break;
>   
> -#if HAVE_TUNABLES
>         if (__glibc_unlikely (state.mode == rtld_mode_list_tunables))
>   	{
>   	  __tunables_print ();
>   	  _exit (0);
>   	}
> -#endif
>   
>         if (state.mode == rtld_mode_list_diagnostics)
>   	_dl_print_diagnostics (_environ);
> @@ -2624,15 +2617,6 @@ process_envvars (struct dl_main_state *state)
>   	    _dl_show_auxv ();
>   	  break;
>   
> -#if !HAVE_TUNABLES
> -	case 10:
> -	  /* Mask for the important hardware capabilities.  */
> -	  if (!__libc_enable_secure
> -	      && memcmp (envline, "HWCAP_MASK", 10) == 0)
> -	    GLRO(dl_hwcap_mask) = _dl_strtoul (&envline[11], NULL);
> -	  break;
> -#endif
> -
>   	case 11:
>   	  /* Path where the binary is found.  */
>   	  if (!__libc_enable_secure
> @@ -2695,12 +2679,7 @@ process_envvars (struct dl_main_state *state)
>         while (*nextp != '\0');
>   
>         if (__access ("/etc/suid-debug", F_OK) != 0)
> -	{
> -#if !HAVE_TUNABLES
> -	  unsetenv ("MALLOC_CHECK_");
> -#endif
> -	  GLRO(dl_debug_mask) = 0;
> -	}
> +	GLRO(dl_debug_mask) = 0;
>   
>         if (state->mode != rtld_mode_normal)
>   	_exit (5);
> diff --git a/elf/tst-env-setuid-tunables.c b/elf/tst-env-setuid-tunables.c
> index 807b426012..7dfb0e073a 100644
> --- a/elf/tst-env-setuid-tunables.c
> +++ b/elf/tst-env-setuid-tunables.c
> @@ -19,8 +19,6 @@
>      glibc.malloc.check and glibc.malloc.mmap_threshold but also retain
>      glibc.malloc.mmap_threshold in an unprivileged child.  */
>   
> -/* This is compiled as part of the testsuite but needs to see
> -   HAVE_TUNABLES. */
>   #define _LIBC 1
>   #include "config.h"
>   #undef _LIBC
> @@ -83,7 +81,6 @@ test_child (int off)
>   {
>     const char *val = getenv ("GLIBC_TUNABLES");
>   
> -#if HAVE_TUNABLES
>     if (val != NULL && strcmp (val, resultstrings[off]) == 0)
>       return 0;
>   
> @@ -91,14 +88,6 @@ test_child (int off)
>       printf ("[%d] Unexpected GLIBC_TUNABLES VALUE %s\n", off, val);
>   
>     return 1;
> -#else
> -  if (val != NULL)
> -    {
> -      printf ("[%d] GLIBC_TUNABLES not cleared\n", off);
> -      return 1;
> -    }
> -  return 0;
> -#endif
>   }
>   
>   static int
> diff --git a/gmon/gmon.c b/gmon/gmon.c
> index 5e99a7351d..bc0e29438a 100644
> --- a/gmon/gmon.c
> +++ b/gmon/gmon.c
> @@ -46,10 +46,8 @@
>   #include <libc-internal.h>
>   #include <not-cancel.h>
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE gmon
> -# include <elf/dl-tunables.h>
> -#endif
> +#define TUNABLE_NAMESPACE gmon
> +#include <elf/dl-tunables.h>
>   
>   #ifdef PIC
>   # include <link.h>
> @@ -130,7 +128,6 @@ __monstartup (u_long lowpc, u_long highpc)
>     struct gmonparam *p = &_gmonparam;
>     long int minarcs, maxarcs;
>   
> -#if HAVE_TUNABLES
>     /* Read minarcs/maxarcs tunables. */
>     minarcs = TUNABLE_GET (minarcs, int32_t, NULL);
>     maxarcs = TUNABLE_GET (maxarcs, int32_t, NULL);
> @@ -139,11 +136,6 @@ __monstartup (u_long lowpc, u_long highpc)
>         ERR("monstartup: maxarcs < minarcs, setting maxarcs = minarcs\n");
>         maxarcs = minarcs;
>       }
> -#else
> -  /* No tunables, we use hardcoded defaults */
> -  minarcs = MINARCS;
> -  maxarcs = MAXARCS;
> -#endif
>   
>     /*
>      * If we are incorrectly called twice in a row (without an
> diff --git a/malloc/Makefile b/malloc/Makefile
> index dfb51d344c..2b7bd10d49 100644
> --- a/malloc/Makefile
> +++ b/malloc/Makefile
> @@ -61,9 +61,7 @@ tests-internal += \
>   	 tst-dynarray-fail \
>   	 tst-dynarray-at-fail \
>   
> -ifneq (no,$(have-tunables))
>   tests += tst-malloc-usable-tunables tst-mxfast
> -endif
>   
>   tests += $(tests-static)
>   test-srcs = tst-mtrace
> diff --git a/malloc/arena.c b/malloc/arena.c
> index ccd193953b..e98b779dbb 100644
> --- a/malloc/arena.c
> +++ b/malloc/arena.c
> @@ -18,9 +18,7 @@
>   
>   #include <stdbool.h>
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE malloc
> -#endif
> +#define TUNABLE_NAMESPACE malloc
>   #include <elf/dl-tunables.h>
>   
>   /* Compile-time constants.  */
> @@ -47,21 +45,13 @@
>   static inline size_t
>   heap_min_size (void)
>   {
> -#if HAVE_TUNABLES
>     return mp_.hp_pagesize == 0 ? HEAP_MIN_SIZE : mp_.hp_pagesize;
> -#else
> -  return HEAP_MIN_SIZE;
> -#endif
>   }
>   
>   static inline size_t
>   heap_max_size (void)
>   {
> -#if HAVE_TUNABLES
>     return mp_.hp_pagesize == 0 ? HEAP_MAX_SIZE : mp_.hp_pagesize * 4;
> -#else
> -  return HEAP_MAX_SIZE;
> -#endif
>   }
>   
>   /***************************************************************************/
> @@ -239,8 +229,7 @@ __malloc_fork_unlock_child (void)
>     __libc_lock_init (list_lock);
>   }
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_CALLBACK_FNDECL(__name, __type) \
> +#define TUNABLE_CALLBACK_FNDECL(__name, __type) \
>   static inline int do_ ## __name (__type value);				      \
>   static void									      \
>   TUNABLE_CALLBACK (__name) (tunable_val_t *valp)				      \
> @@ -263,42 +252,6 @@ TUNABLE_CALLBACK_FNDECL (set_tcache_unsorted_limit, size_t)
>   #endif
>   TUNABLE_CALLBACK_FNDECL (set_mxfast, size_t)
>   TUNABLE_CALLBACK_FNDECL (set_hugetlb, size_t)
> -#else
> -/* Initialization routine. */
> -#include <string.h>
> -extern char **_environ;
> -
> -static char *
> -next_env_entry (char ***position)
> -{
> -  char **current = *position;
> -  char *result = NULL;
> -
> -  while (*current != NULL)
> -    {
> -      if (__builtin_expect ((*current)[0] == 'M', 0)
> -          && (*current)[1] == 'A'
> -          && (*current)[2] == 'L'
> -          && (*current)[3] == 'L'
> -          && (*current)[4] == 'O'
> -          && (*current)[5] == 'C'
> -          && (*current)[6] == '_')
> -        {
> -          result = &(*current)[7];
> -
> -          /* Save current position for next visit.  */
> -          *position = ++current;
> -
> -          break;
> -        }
> -
> -      ++current;
> -    }
> -
> -  return result;
> -}
> -#endif
> -
>   
>   #if USE_TCACHE
>   static void tcache_key_initialize (void);
> @@ -343,7 +296,6 @@ ptmalloc_init (void)
>   
>     malloc_init_state (&main_arena);
>   
> -#if HAVE_TUNABLES
>     TUNABLE_GET (top_pad, size_t, TUNABLE_CALLBACK (set_top_pad));
>     TUNABLE_GET (perturb, int32_t, TUNABLE_CALLBACK (set_perturb_byte));
>     TUNABLE_GET (mmap_threshold, size_t, TUNABLE_CALLBACK (set_mmap_threshold));
> @@ -363,70 +315,6 @@ ptmalloc_init (void)
>       /* Force mmap for main arena instead of sbrk, so hugepages are explicitly
>          used.  */
>       __always_fail_morecore = true;
> -#else
> -  if (__glibc_likely (_environ != NULL))
> -    {
> -      char **runp = _environ;
> -      char *envline;
> -
> -      while (__builtin_expect ((envline = next_env_entry (&runp)) != NULL,
> -                               0))
> -        {
> -          size_t len = strcspn (envline, "=");
> -
> -          if (envline[len] != '=')
> -            /* This is a "MALLOC_" variable at the end of the string
> -               without a '=' character.  Ignore it since otherwise we
> -               will access invalid memory below.  */
> -            continue;
> -
> -          switch (len)
> -            {
> -            case 8:
> -              if (!__builtin_expect (__libc_enable_secure, 0))
> -                {
> -                  if (memcmp (envline, "TOP_PAD_", 8) == 0)
> -                    __libc_mallopt (M_TOP_PAD, strtol (&envline[9], NULL, 10));
> -                  else if (memcmp (envline, "PERTURB_", 8) == 0)
> -                    __libc_mallopt (M_PERTURB, strtol (&envline[9], NULL, 10));
> -                }
> -              break;
> -            case 9:
> -              if (!__builtin_expect (__libc_enable_secure, 0))
> -                {
> -                  if (memcmp (envline, "MMAP_MAX_", 9) == 0)
> -                    __libc_mallopt (M_MMAP_MAX, strtol (&envline[10],
> -							NULL, 10));
> -                  else if (memcmp (envline, "ARENA_MAX", 9) == 0)
> -                    __libc_mallopt (M_ARENA_MAX, strtol (&envline[10],
> -							 NULL, 10));
> -                }
> -              break;
> -            case 10:
> -              if (!__builtin_expect (__libc_enable_secure, 0))
> -                {
> -                  if (memcmp (envline, "ARENA_TEST", 10) == 0)
> -                    __libc_mallopt (M_ARENA_TEST, strtol (&envline[11],
> -							  NULL, 10));
> -                }
> -              break;
> -            case 15:
> -              if (!__builtin_expect (__libc_enable_secure, 0))
> -                {
> -                  if (memcmp (envline, "TRIM_THRESHOLD_", 15) == 0)
> -                    __libc_mallopt (M_TRIM_THRESHOLD, strtol (&envline[16],
> -							      NULL, 10));
> -                  else if (memcmp (envline, "MMAP_THRESHOLD_", 15) == 0)
> -                    __libc_mallopt (M_MMAP_THRESHOLD, strtol (&envline[16],
> -							      NULL, 10));
> -                }
> -              break;
> -            default:
> -              break;
> -            }
> -        }
> -    }
> -#endif
>   }
>   
>   /* Managing heaps and arenas (for concurrent threads) */
> @@ -561,7 +449,6 @@ alloc_new_heap  (size_t size, size_t top_pad, size_t pagesize,
>   static heap_info *
>   new_heap (size_t size, size_t top_pad)
>   {
> -#if HAVE_TUNABLES
>     if (__glibc_unlikely (mp_.hp_pagesize != 0))
>       {
>         heap_info *h = alloc_new_heap (size, top_pad, mp_.hp_pagesize,
> @@ -569,7 +456,6 @@ new_heap (size_t size, size_t top_pad)
>         if (h != NULL)
>   	return h;
>       }
> -#endif
>     return alloc_new_heap (size, top_pad, GLRO (dl_pagesize), 0);
>   }
>   
> diff --git a/malloc/malloc-check.c b/malloc/malloc-check.c
> index af27fd2c52..5732d81bf1 100644
> --- a/malloc/malloc-check.c
> +++ b/malloc/malloc-check.c
> @@ -376,7 +376,6 @@ memalign_check (size_t alignment, size_t bytes)
>     return mem2mem_check (tag_new_usable (mem), bytes);
>   }
>   
> -#if HAVE_TUNABLES
>   static void
>   TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
>   {
> @@ -384,7 +383,6 @@ TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
>     if (value != 0)
>       __malloc_debug_enable (MALLOC_CHECK_HOOK);
>   }
> -#endif
>   
>   static bool
>   initialize_malloc_check (void)
> @@ -392,12 +390,6 @@ initialize_malloc_check (void)
>     /* This is the copy of the malloc initializer that we pulled in along with
>        malloc-check.  This does not affect any of the libc malloc structures.  */
>     ptmalloc_init ();
> -#if HAVE_TUNABLES
>     TUNABLE_GET (check, int32_t, TUNABLE_CALLBACK (set_mallopt_check));
> -#else
> -  const char *s = secure_getenv ("MALLOC_CHECK_");
> -  if (s && s[0] != '\0' && s[0] != '0')
> -    __malloc_debug_enable (MALLOC_CHECK_HOOK);
> -#endif
>     return __is_malloc_debug_enabled (MALLOC_CHECK_HOOK);
>   }
> diff --git a/malloc/malloc.c b/malloc/malloc.c
> index 76c50e3f58..05e65a2d54 100644
> --- a/malloc/malloc.c
> +++ b/malloc/malloc.c
> @@ -1856,14 +1856,12 @@ struct malloc_par
>     INTERNAL_SIZE_T arena_test;
>     INTERNAL_SIZE_T arena_max;
>   
> -#if HAVE_TUNABLES
>     /* Transparent Large Page support.  */
>     INTERNAL_SIZE_T thp_pagesize;
>     /* A value different than 0 means to align mmap allocation to hp_pagesize
>        add hp_flags on flags.  */
>     INTERNAL_SIZE_T hp_pagesize;
>     int hp_flags;
> -#endif
>   
>     /* Memory map support */
>     int n_mmaps;
> @@ -1998,7 +1996,7 @@ free_perturb (char *p, size_t n)
>   static inline void
>   madvise_thp (void *p, INTERNAL_SIZE_T size)
>   {
> -#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
> +#ifdef MADV_HUGEPAGE
>     /* Do not consider areas smaller than a huge page or if the tunable is
>        not active.  */
>     if (mp_.thp_pagesize == 0 || size < mp_.thp_pagesize)
> @@ -2557,7 +2555,6 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
>   	  && (mp_.n_mmaps < mp_.n_mmaps_max)))
>       {
>         char *mm;
> -#if HAVE_TUNABLES
>         if (mp_.hp_pagesize > 0 && nb >= mp_.hp_pagesize)
>   	{
>   	  /* There is no need to isse the THP madvise call if Huge Pages are
> @@ -2566,7 +2563,6 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
>   	  if (mm != MAP_FAILED)
>   	    return mm;
>   	}
> -#endif
>         mm = sysmalloc_mmap (nb, pagesize, 0, av);
>         if (mm != MAP_FAILED)
>   	return mm;
> @@ -2679,7 +2675,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
>            previous calls. Otherwise, we correct to page-align below.
>          */
>   
> -#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
> +#ifdef MADV_HUGEPAGE
>         /* Defined in brk.c.  */
>         extern void *__curbrk;
>         if (__glibc_unlikely (mp_.thp_pagesize != 0))
> @@ -2718,12 +2714,10 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
>              */
>   
>   	  char *mbrk = MAP_FAILED;
> -#if HAVE_TUNABLES
>   	  if (mp_.hp_pagesize > 0)
>   	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size,
>   					    mp_.hp_pagesize, mp_.hp_pagesize,
>   					    mp_.hp_flags, av);
> -#endif
>   	  if (mbrk == MAP_FAILED)
>   	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, MMAP_AS_MORECORE_SIZE,
>   					    pagesize, 0, av);
> @@ -2966,7 +2960,7 @@ systrim (size_t pad, mstate av)
>       return 0;
>   
>     /* Release in pagesize units and round down to the nearest page.  */
> -#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
> +#ifdef MADV_HUGEPAGE
>     if (__glibc_unlikely (mp_.thp_pagesize != 0))
>       extra = ALIGN_DOWN (top_area - pad, mp_.thp_pagesize);
>     else
> @@ -5410,7 +5404,6 @@ do_set_mxfast (size_t value)
>     return 0;
>   }
>   
> -#if HAVE_TUNABLES
>   static __always_inline int
>   do_set_hugetlb (size_t value)
>   {
> @@ -5429,7 +5422,6 @@ do_set_hugetlb (size_t value)
>   			      &mp_.hp_flags);
>     return 0;
>   }
> -#endif
>   
>   int
>   __libc_mallopt (int param_number, int value)
> diff --git a/manual/install.texi b/manual/install.texi
> index 260f8a5c82..37edf26195 100644
> --- a/manual/install.texi
> +++ b/manual/install.texi
> @@ -262,25 +262,6 @@ configure with @option{--disable-werror}.
>   By default for x86_64, @theglibc{} is built with the vector math library.
>   Use this option to disable the vector math library.
>   
> -@item --enable-tunables
> -Tunables support allows additional library parameters to be customized at
> -runtime.  This feature is enabled by default.  This option can take the
> -following values:
> -
> -@table @code
> -@item yes
> -This is the default if no option is passed to configure. This enables tunables
> -and selects the default frontend (currently @samp{valstring}).
> -
> -@item no
> -This option disables tunables.
> -
> -@item valstring
> -This enables tunables and selects the @samp{valstring} frontend for tunables.
> -This frontend allows users to specify tunables as a colon-separated list in a
> -single environment variable @env{GLIBC_TUNABLES}.
> -@end table
> -
>   @item --disable-crypt
>   Do not install the passphrase-hashing library @file{libcrypt} or the
>   header file @file{crypt.h}.  @file{unistd.h} will still declare the
> diff --git a/nptl/pthread_mutex_conf.c b/nptl/pthread_mutex_conf.c
> index 329c4cbb8f..9133384d47 100644
> --- a/nptl/pthread_mutex_conf.c
> +++ b/nptl/pthread_mutex_conf.c
> @@ -16,8 +16,7 @@
>      License along with the GNU C Library; if not, see
>      <https://www.gnu.org/licenses/>.  */
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE pthread
> +#define TUNABLE_NAMESPACE pthread
>   #include <pthread_mutex_conf.h>
>   #include <stdint.h>
>   #include <stdbool.h>
> @@ -53,4 +52,3 @@ __pthread_tunables_init (void)
>     TUNABLE_GET (stack_cache_size, size_t,
>                  TUNABLE_CALLBACK (set_stack_cache_size));
>   }
> -#endif
> diff --git a/nptl/tst-mutex8.c b/nptl/tst-mutex8.c
> index 4ac5f5059f..e16284d29e 100644
> --- a/nptl/tst-mutex8.c
> +++ b/nptl/tst-mutex8.c
> @@ -98,7 +98,6 @@ check_type (const char *mas, pthread_mutexattr_t *ma)
>     /* Check if a mutex will be elided.  Lock elision can only be activated via
>        the tunables framework.  By default, lock elision is disabled.  */
>     bool assume_elided_mutex = false;
> -#if HAVE_TUNABLES
>     int ma_type = PTHREAD_MUTEX_TIMED_NP;
>     if (ma != NULL)
>       {
> @@ -117,7 +116,6 @@ check_type (const char *mas, pthread_mutexattr_t *ma)
>         if (TUNABLE_GET_FULL (glibc, elision, enable, int32_t, NULL) == 1)
>   	assume_elided_mutex = true;
>       }
> -#endif
>   
>     e = pthread_mutex_init (m, ma);
>     if (e != 0)
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index 29c10c2916..7d7a10bffa 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -445,7 +445,6 @@ class Context(object):
>                                                  '--disable-profile',
>                                                  '--disable-timezone-tools',
>                                                  '--disable-mathvec',
> -                                               '--disable-tunables',
>                                                  '--disable-crypt',
>                                                  '--disable-experimental-malloc',
>                                                  '--disable-build-nscd',
> diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
> index c99dad77cc..bf16b66c9c 100644
> --- a/sysdeps/generic/ldsodefs.h
> +++ b/sysdeps/generic/ldsodefs.h
> @@ -586,11 +586,6 @@ struct rtld_global_ro
>     /* Mask for hardware capabilities that are available.  */
>     EXTERN uint64_t _dl_hwcap;
>   
> -#if !HAVE_TUNABLES
> -  /* Mask for important hardware capabilities we honour. */
> -  EXTERN uint64_t _dl_hwcap_mask;
> -#endif
> -
>   #ifdef HAVE_AUX_VECTOR
>     /* Pointer to the auxv list supplied to the program at startup.  */
>     EXTERN ElfW(auxv_t) *_dl_auxv;
> @@ -1192,18 +1187,6 @@ extern struct link_map * _dl_get_dl_main_map (void)
>      brk.  */
>   void *_dl_early_allocate (size_t size) attribute_hidden;
>   
> -/* Initialize the DSO sort algorithm to use.  */
> -#if !HAVE_TUNABLES
> -static inline void
> -__always_inline
> -_dl_sort_maps_init (void)
> -{
> -  /* This is optimized out if tunables are not enabled.  */
> -}
> -#else
> -extern void _dl_sort_maps_init (void) attribute_hidden;
> -#endif
> -
>   /* Initialization of libpthread for statically linked applications.
>      If libpthread is not linked in, this is an empty function.  */
>   void __pthread_initialize_minimal (void) weak_function;
> diff --git a/sysdeps/generic/unsecvars.h b/sysdeps/generic/unsecvars.h
> index b50331b50f..81397fb90b 100644
> --- a/sysdeps/generic/unsecvars.h
> +++ b/sysdeps/generic/unsecvars.h
> @@ -1,16 +1,10 @@
> -#if !HAVE_TUNABLES
> -# define GLIBC_TUNABLES_ENVVAR "GLIBC_TUNABLES\0"
> -#else
> -# define GLIBC_TUNABLES_ENVVAR
> -#endif
> -
>   /* Environment variable to be removed for SUID programs.  The names are
>      all stuffed in a single string which means they have to be terminated
>      with a '\0' explicitly.  */
>   #define UNSECURE_ENVVARS \
>     "GCONV_PATH\0"							      \
>     "GETCONF_DIR\0"							      \
> -  GLIBC_TUNABLES_ENVVAR							      \
> +  "GLIBC_TUNABLES\0"							      \
>     "HOSTALIASES\0"							      \
>     "LD_AUDIT\0"								      \
>     "LD_DEBUG\0"								      \
> diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c
> index 0db0349c4b..50dc778852 100644
> --- a/sysdeps/nptl/dl-tls_init_tp.c
> +++ b/sysdeps/nptl/dl-tls_init_tp.c
> @@ -102,9 +102,7 @@ __tls_init_tp (void)
>   
>     {
>       bool do_rseq = true;
> -#if HAVE_TUNABLES
>       do_rseq = TUNABLE_GET (rseq, int, NULL);
> -#endif
>       if (rseq_register_current_thread (pd, do_rseq))
>         {
>           /* We need a writable view of the variables.  They are in
> diff --git a/sysdeps/nptl/pthreadP.h b/sysdeps/nptl/pthreadP.h
> index 536b75b582..54f9198681 100644
> --- a/sysdeps/nptl/pthreadP.h
> +++ b/sysdeps/nptl/pthreadP.h
> @@ -45,11 +45,7 @@
>   
>   static inline short max_adaptive_count (void)
>   {
> -#if HAVE_TUNABLES
>     return __mutex_aconf.spin_count;
> -#else
> -  return DEFAULT_ADAPTIVE_COUNT;
> -#endif
>   }
>   
>   
> diff --git a/sysdeps/nptl/pthread_early_init.h b/sysdeps/nptl/pthread_early_init.h
> index 39255d928c..f1a3b65d1a 100644
> --- a/sysdeps/nptl/pthread_early_init.h
> +++ b/sysdeps/nptl/pthread_early_init.h
> @@ -53,9 +53,7 @@ __pthread_early_init (void)
>     __default_pthread_attr.internal.stacksize = limit.rlim_cur;
>     __default_pthread_attr.internal.guardsize = GLRO (dl_pagesize);
>   
> -#if HAVE_TUNABLES
>     __pthread_tunables_init ();
> -#endif
>   }
>   
>   #endif  /* _PTHREAD_EARLY_INIT_H */
> diff --git a/sysdeps/nptl/pthread_mutex_conf.h b/sysdeps/nptl/pthread_mutex_conf.h
> index 6d4b6ad880..8151bafce7 100644
> --- a/sysdeps/nptl/pthread_mutex_conf.h
> +++ b/sysdeps/nptl/pthread_mutex_conf.h
> @@ -20,7 +20,6 @@
>   
>   #include <adaptive_spin_count.h>
>   
> -#if HAVE_TUNABLES
>   struct mutex_config
>   {
>     int spin_count;
> @@ -30,12 +29,5 @@ extern struct mutex_config __mutex_aconf;
>   libc_hidden_proto (__mutex_aconf)
>   
>   extern void __pthread_tunables_init (void) attribute_hidden;
> -#else
> -static inline void
> -__pthread_tunables_init (void)
> -{
> -  /* No tunables to initialize.  */
> -}
> -#endif
>   
>   #endif
> diff --git a/sysdeps/powerpc/cpu-features.c b/sysdeps/powerpc/cpu-features.c
> index 9ed0e5e8c1..0ef3cf89d2 100644
> --- a/sysdeps/powerpc/cpu-features.c
> +++ b/sysdeps/powerpc/cpu-features.c
> @@ -18,10 +18,7 @@
>   
>   #include <stdint.h>
>   #include <cpu-features.h>
> -
> -#if HAVE_TUNABLES
> -# include <elf/dl-tunables.h>
> -#endif
> +#include <elf/dl-tunables.h>
>   
>   static inline void
>   init_cpu_features (struct cpu_features *cpu_features)
> @@ -29,11 +26,7 @@ init_cpu_features (struct cpu_features *cpu_features)
>     /* Default is to use aligned memory access on optimized function unless
>        tunables is enable, since for this case user can explicit disable
>        unaligned optimizations.  */
> -#if HAVE_TUNABLES
>     int32_t cached_memfunc = TUNABLE_GET (glibc, cpu, cached_memopt, int32_t,
>   					NULL);
>     cpu_features->use_cached_memopt = (cached_memfunc > 0);
> -#else
> -  cpu_features->use_cached_memopt = false;
> -#endif
>   }
> diff --git a/sysdeps/s390/cpu-features.c b/sysdeps/s390/cpu-features.c
> index afeb9b5638..39f8c23a60 100644
> --- a/sysdeps/s390/cpu-features.c
> +++ b/sysdeps/s390/cpu-features.c
> @@ -18,15 +18,12 @@
>   
>   #include <cpu-features.h>
>   
> -#if HAVE_TUNABLES
> -# include <elf/dl-tunables.h>
> -# include <ifunc-memcmp.h>
> -# include <string.h>
> +#include <elf/dl-tunables.h>
> +#include <ifunc-memcmp.h>
> +#include <string.h>
>   extern __typeof (memcmp) MEMCMP_DEFAULT;
> -#endif
>   
> -#if HAVE_TUNABLES
> -# define S390_COPY_CPU_FEATURES(SRC_PTR, DEST_PTR)	\
> +#define S390_COPY_CPU_FEATURES(SRC_PTR, DEST_PTR)	\
>     (DEST_PTR)->hwcap = (SRC_PTR)->hwcap;			\
>     (DEST_PTR)->stfle_bits[0] = (SRC_PTR)->stfle_bits[0];
>   
> @@ -205,7 +202,6 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
>     cpu_features->stfle_bits[0] = cpu_features_curr.stfle_bits[0]
>       & cpu_features_orig.stfle_bits[0];
>   }
> -#endif
>   
>   static inline void
>   init_cpu_features (struct cpu_features *cpu_features)
> @@ -233,7 +229,5 @@ init_cpu_features (struct cpu_features *cpu_features)
>         cpu_features->stfle_bits[0] = 0ULL;
>       }
>   
> -#if HAVE_TUNABLES
>     TUNABLE_GET (glibc, cpu, hwcaps, tunable_val_t *, TUNABLE_CALLBACK (set_hwcaps));
> -#endif
>   }
> diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
> index 835e68925b..9b57ae1a93 100644
> --- a/sysdeps/sparc/sparc32/dl-machine.h
> +++ b/sysdeps/sparc/sparc32/dl-machine.h
> @@ -39,8 +39,9 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
>       return 1;
>     else if (ehdr->e_machine == EM_SPARC32PLUS)
>       {
> -#if HAVE_TUNABLES || defined SHARED
> -      uint64_t hwcap_mask = GET_HWCAP_MASK();
> +#if defined SHARED
> +      uint64_t hwcap_mask = TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t,
> +					 NULL);
>         return GLRO(dl_hwcap) & hwcap_mask & HWCAP_SPARC_V9;
>   #else
>         return GLRO(dl_hwcap) & HWCAP_SPARC_V9;
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index f8bd12d991..b4323b2604 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -245,11 +245,9 @@ tests-internal += \
>     tst-sigcontext-get_pc \
>     # tests-internal
>   
> -ifneq (no,$(have-tunables))
>   tests-internal += \
>     tst-rseq-disable \
> -  # tests-internal $(have-tunables)
> -endif
> +  # tests-internal
>   
>   tests-time64 += \
>     tst-adjtimex-time64 \
> diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
> index 0380f116de..dc09c1c827 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
> +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
> @@ -30,7 +30,6 @@
>      to see when pointer have been correctly tagged.  */
>   #define MTE_ALLOWED_TAGS (0xfffe << PR_MTE_TAG_SHIFT)
>   
> -#if HAVE_TUNABLES
>   struct cpu_list
>   {
>     const char *name;
> @@ -59,19 +58,16 @@ get_midr_from_mcpu (const char *mcpu)
>   
>     return UINT64_MAX;
>   }
> -#endif
>   
>   static inline void
>   init_cpu_features (struct cpu_features *cpu_features)
>   {
>     register uint64_t midr = UINT64_MAX;
>   
> -#if HAVE_TUNABLES
>     /* Get the tunable override.  */
>     const char *mcpu = TUNABLE_GET (glibc, cpu, name, const char *, NULL);
>     if (mcpu != NULL)
>       midr = get_midr_from_mcpu (mcpu);
> -#endif
>   
>     /* If there was no useful tunable override, query the MIDR if the kernel
>        allows it.  */
> @@ -100,13 +96,11 @@ init_cpu_features (struct cpu_features *cpu_features)
>     cpu_features->mte_state = 0;
>   
>   #ifdef USE_MTAG
> -# if HAVE_TUNABLES
>     int mte_state = TUNABLE_GET (glibc, mem, tagging, unsigned, 0);
>     cpu_features->mte_state = (GLRO (dl_hwcap2) & HWCAP2_MTE) ? mte_state : 0;
>     /* If we lack the MTE feature, disable the tunable, since it will
>        otherwise cause instructions that won't run on this CPU to be used.  */
>     TUNABLE_SET (glibc, mem, tagging, cpu_features->mte_state);
> -# endif
>   
>     if (cpu_features->mte_state & 4)
>       /* Enable choosing system-preferred faulting mode.  */
> diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-conf.c b/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
> index 8cd945a6c5..7c98dbd0d0 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
> +++ b/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
> @@ -22,9 +22,7 @@
>   #include <unistd.h>
>   #include <dl-procinfo.h>
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE elision
> -#endif
> +#define TUNABLE_NAMESPACE elision
>   #include <elf/dl-tunables.h>
>   
>   /* Reasonable initial tuning values, may be revised in the future.
> @@ -51,7 +49,6 @@ struct elision_config __elision_aconf =
>       .skip_trylock_internal_abort = 3,
>     };
>   
> -#if HAVE_TUNABLES
>   static inline void
>   __always_inline
>   do_set_elision_enable (int32_t elision_enable)
> @@ -94,14 +91,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
>   TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
>   TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
>   TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
> -#endif
>   
>   /* Initialize elision.  */
>   
>   void
>   __lll_elision_init (void)
>   {
> -#if HAVE_TUNABLES
>     /* Elision depends on tunables and must be explicitly turned on by setting
>        the appropriate tunable on a supported platform.  */
>   
> @@ -117,7 +112,6 @@ __lll_elision_init (void)
>   	       TUNABLE_CALLBACK (set_elision_try_tbegin));
>     TUNABLE_GET (skip_trylock_internal_abort, int32_t,
>   	       TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
> -#endif
>   
>     /* Linux from 3.9 through 4.2 do not abort HTM transaction on syscalls,
>        instead it suspends the transaction and resumes it when returning to
> diff --git a/sysdeps/unix/sysv/linux/s390/elision-conf.c b/sysdeps/unix/sysv/linux/s390/elision-conf.c
> index 5911e51097..6a6d6814ee 100644
> --- a/sysdeps/unix/sysv/linux/s390/elision-conf.c
> +++ b/sysdeps/unix/sysv/linux/s390/elision-conf.c
> @@ -22,9 +22,7 @@
>   #include <unistd.h>
>   #include <dl-procinfo.h>
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE elision
> -#endif
> +#define TUNABLE_NAMESPACE elision
>   #include <elf/dl-tunables.h>
>   
>   /* Reasonable initial tuning values, may be revised in the future.
> @@ -51,7 +49,6 @@ struct elision_config __elision_aconf =
>       .skip_trylock_internal_abort = 3,
>     };
>   
> -#if HAVE_TUNABLES
>   static inline void
>   __always_inline
>   do_set_elision_enable (int32_t elision_enable)
> @@ -93,14 +90,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
>   TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
>   TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
>   TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
> -#endif
>   
>   /* Initialize elison.  */
>   
>   void
>   __lll_elision_init (void)
>   {
> -#if HAVE_TUNABLES
>     /* Elision depends on tunables and must be explicitly turned on by setting
>        the appropriate tunable on a supported platform.  */
>   
> @@ -116,7 +111,6 @@ __lll_elision_init (void)
>   	       TUNABLE_CALLBACK (set_elision_try_tbegin));
>     TUNABLE_GET (skip_trylock_internal_abort, int32_t,
>   	       TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
> -#endif
>   
>     if (!__pthread_force_elision)
>       __elision_aconf.try_tbegin = 0; /* Disable elision on rwlocks.  */
> diff --git a/sysdeps/unix/sysv/linux/x86/elision-conf.c b/sysdeps/unix/sysv/linux/x86/elision-conf.c
> index 6447bda96b..cfd9a71e31 100644
> --- a/sysdeps/unix/sysv/linux/x86/elision-conf.c
> +++ b/sysdeps/unix/sysv/linux/x86/elision-conf.c
> @@ -22,9 +22,7 @@
>   #include <elision-conf.h>
>   #include <unistd.h>
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE elision
> -#endif
> +#define TUNABLE_NAMESPACE elision
>   #include <elf/dl-tunables.h>
>   
>   /* Reasonable initial tuning values, may be revised in the future.
> @@ -48,7 +46,6 @@ struct elision_config __elision_aconf =
>       .skip_trylock_internal_abort = 3,
>     };
>   
> -#if HAVE_TUNABLES
>   static __always_inline void
>   do_set_elision_enable (int32_t elision_enable)
>   {
> @@ -87,14 +84,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_busy, int32_t);
>   TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
>   TUNABLE_CALLBACK_FNDECL (retry_try_xbegin, int32_t);
>   TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
> -#endif
>   
>   /* Initialize elision.  */
>   
>   void
>   __lll_elision_init (void)
>   {
> -#if HAVE_TUNABLES
>     /* Elision depends on tunables and must be explicitly turned on by setting
>        the appropriate tunable on a supported platform.  */
>   
> @@ -108,7 +103,6 @@ __lll_elision_init (void)
>   	       TUNABLE_CALLBACK (set_elision_retry_try_xbegin));
>     TUNABLE_GET (skip_trylock_internal_abort, int32_t,
>   	       TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
> -#endif
>   
>     if (!__pthread_force_elision)
>       __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks.  */
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/Makefile b/sysdeps/unix/sysv/linux/x86_64/64/Makefile
> index 8ff4f27786..1bf7d528b2 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/Makefile
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/Makefile
> @@ -2,7 +2,6 @@
>   default-abi := 64
>   
>   ifeq ($(subdir),elf)
> -ifneq ($(have-tunables),no)
>   
>   tests-map-32bit = \
>     tst-map-32bit-1a \
> @@ -24,4 +23,3 @@ tst-map-32bit-1b-ENV = GLIBC_TUNABLES=glibc.cpu.prefer_map_32bit_exec=1
>   $(objpfx)tst-map-32bit-1b: $(objpfx)tst-map-32bit-mod.so
>   
>   endif
> -endif
> diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
> index 56fd5fc805..917c26f116 100644
> --- a/sysdeps/x86/Makefile
> +++ b/sysdeps/x86/Makefile
> @@ -25,7 +25,6 @@ tests-static += \
>     tst-ifunc-isa-1-static
>   test-xfail-tst-ifunc-isa-1 = $(with-lld)
>   test-xfail-tst-ifunc-isa-1-static = $(with-lld)
> -ifneq ($(have-tunables),no)
>   tests += \
>     tst-ifunc-isa-2 \
>     tst-ifunc-isa-2-static
> @@ -35,7 +34,6 @@ test-xfail-tst-ifunc-isa-2 = $(with-lld)
>   test-xfail-tst-ifunc-isa-2-static = $(with-lld)
>   endif
>   endif
> -endif
>   ifeq (yes,$(enable-x86-isa-level))
>   tests += tst-isa-level-1
>   modules-names += tst-isa-level-mod-1-baseline \
> @@ -65,11 +63,9 @@ $(objpfx)tst-isa-level-1.out: $(objpfx)tst-isa-level-mod-1-baseline.so \
>   			      $(objpfx)tst-isa-level-mod-1-v3.so \
>   			      $(objpfx)tst-isa-level-mod-1-v4.so
>   endif
> -ifneq ($(have-tunables),no)
>   tst-ifunc-isa-2-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SSE4_2,-AVX,-AVX2,-AVX512F
>   tst-ifunc-isa-2-static-ENV = $(tst-ifunc-isa-2-ENV)
>   endif
> -endif
>   
>   ifeq ($(subdir),math)
>   tests += tst-ldbl-nonnormal-printf
> @@ -79,12 +75,10 @@ ifeq ($(subdir),setjmp)
>   gen-as-const-headers += jmp_buf-ssp.sym
>   sysdep_routines += __longjmp_cancel
>   ifneq ($(enable-cet),no)
> -ifneq ($(have-tunables),no)
>   tests += tst-setjmp-cet
>   tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
>   endif
>   endif
> -endif
>   
>   ifeq ($(subdir),string)
>   sysdep_routines += cacheinfo
> @@ -135,10 +129,8 @@ tests += tst-cet-legacy-1 tst-cet-legacy-1a tst-cet-legacy-2 \
>   	 tst-cet-legacy-10 tst-cet-legacy-10-static
>   tests-static += tst-cet-legacy-9-static tst-cet-legacy-10-static
>   tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
> -ifneq (no,$(have-tunables))
>   tests += tst-cet-legacy-4a tst-cet-legacy-4b tst-cet-legacy-4c \
>   	 tst-cet-legacy-5b tst-cet-legacy-6b
> -endif
>   modules-names += tst-cet-legacy-mod-1 tst-cet-legacy-mod-2 \
>   		 tst-cet-legacy-mod-4 tst-cet-legacy-mod-5a \
>   		 tst-cet-legacy-mod-5b tst-cet-legacy-mod-5c \
> @@ -195,7 +187,6 @@ $(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
>   $(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
>   $(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
>   LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
> -ifneq (no,$(have-tunables))
>   $(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
>   tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
>   $(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
> @@ -211,7 +202,6 @@ tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
>   tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
>   tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
>   endif
> -endif
>   
>   # Add -fcf-protection to CFLAGS when CET is enabled.
>   CFLAGS-.o += -fcf-protection
> diff --git a/sysdeps/x86/cacheinfo.h b/sysdeps/x86/cacheinfo.h
> index 7a99e04b73..ec1bc142c4 100644
> --- a/sysdeps/x86/cacheinfo.h
> +++ b/sysdeps/x86/cacheinfo.h
> @@ -21,11 +21,9 @@
>   #include <cpuid.h>
>   #include <cpu-features.h>
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE cpu
> -# include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
> -# include <elf/dl-tunables.h>
> -#endif
> +#define TUNABLE_NAMESPACE cpu
> +#include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
> +#include <elf/dl-tunables.h>
>   
>   #if IS_IN (libc)
>   /* Data cache size for use in memory and string routines, typically
> diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
> index 822688e21f..978eb29f72 100644
> --- a/sysdeps/x86/cpu-features.c
> +++ b/sysdeps/x86/cpu-features.c
> @@ -23,11 +23,10 @@
>   #include <dl-cacheinfo.h>
>   #include <dl-minsigstacksize.h>
>   
> -#if HAVE_TUNABLES
>   extern void TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *)
>     attribute_hidden;
>   
> -# ifdef __LP64__
> +#ifdef __LP64__
>   static void
>   TUNABLE_CALLBACK (set_prefer_map_32bit_exec) (tunable_val_t *valp)
>   {
> @@ -35,17 +34,14 @@ TUNABLE_CALLBACK (set_prefer_map_32bit_exec) (tunable_val_t *valp)
>       GLRO(dl_x86_cpu_features).preferred[index_arch_Prefer_MAP_32BIT_EXEC]
>         |= bit_arch_Prefer_MAP_32BIT_EXEC;
>   }
> -# endif
> +#endif
>   
> -# if CET_ENABLED
> +#if CET_ENABLED
>   extern void TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *)
>     attribute_hidden;
>   extern void TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *)
>     attribute_hidden;
> -# endif
> -#endif
>   
> -#if CET_ENABLED
>   # include <dl-cet.h>
>   #endif
>   
> @@ -712,13 +708,12 @@ no_cpuid:
>   
>     dl_init_cacheinfo (cpu_features);
>   
> -#if HAVE_TUNABLES
>     TUNABLE_GET (hwcaps, tunable_val_t *, TUNABLE_CALLBACK (set_hwcaps));
>   
> -# ifdef __LP64__
> +#ifdef __LP64__
>     TUNABLE_GET (prefer_map_32bit_exec, tunable_val_t *,
>   	       TUNABLE_CALLBACK (set_prefer_map_32bit_exec));
> -# endif
> +#endif
>   
>     bool disable_xsave_features = false;
>   
> @@ -774,13 +769,6 @@ no_cpuid:
>         CPU_FEATURE_UNSET (cpu_features, FMA4);
>       }
>   
> -#elif defined SHARED
> -  /* Reuse dl_platform, dl_hwcap and dl_hwcap_mask for x86.  The
> -     glibc.cpu.hwcap_mask tunable is initialized already, so no
> -     need to do this.  */
> -  GLRO(dl_hwcap_mask) = HWCAP_IMPORTANT;
> -#endif
> -
>   #ifdef __x86_64__
>     GLRO(dl_hwcap) = HWCAP_X86_64;
>     if (cpu_features->basic.kind == arch_kind_intel)
> @@ -828,12 +816,10 @@ no_cpuid:
>   #endif
>   
>   #if CET_ENABLED
> -# if HAVE_TUNABLES
>     TUNABLE_GET (x86_ibt, tunable_val_t *,
>   	       TUNABLE_CALLBACK (set_x86_ibt));
>     TUNABLE_GET (x86_shstk, tunable_val_t *,
>   	       TUNABLE_CALLBACK (set_x86_shstk));
> -# endif
>   
>     /* Check CET status.  */
>     unsigned int cet_status = get_cet_status ();
> diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c
> index 772fb0c4c2..0d4f328585 100644
> --- a/sysdeps/x86/cpu-tunables.c
> +++ b/sysdeps/x86/cpu-tunables.c
> @@ -16,31 +16,30 @@
>      License along with the GNU C Library; if not, see
>      <https://www.gnu.org/licenses/>.  */
>   
> -#if HAVE_TUNABLES
> -# define TUNABLE_NAMESPACE cpu
> -# include <stdbool.h>
> -# include <stdint.h>
> -# include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
> -# include <elf/dl-tunables.h>
> -# include <string.h>
> -# include <cpu-features.h>
> -# include <ldsodefs.h>
> +#define TUNABLE_NAMESPACE cpu
> +#include <stdbool.h>
> +#include <stdint.h>
> +#include <unistd.h>		/* Get STDOUT_FILENO for _dl_printf.  */
> +#include <elf/dl-tunables.h>
> +#include <string.h>
> +#include <cpu-features.h>
> +#include <ldsodefs.h>
>   
>   /* We can't use IFUNC memcmp nor strlen in init_cpu_features from libc.a
>      since IFUNC must be set up by init_cpu_features.  */
> -# if defined USE_MULTIARCH && !defined SHARED
> -#  ifdef __x86_64__
> +#if defined USE_MULTIARCH && !defined SHARED
> +# ifdef __x86_64__
>   /* DEFAULT_MEMCMP by sysdeps/x86_64/memcmp-isa-default-impl.h.  */
> -#   include <sysdeps/x86_64/memcmp-isa-default-impl.h>
> -#  else
> -#   define DEFAULT_MEMCMP	__memcmp_ia32
> -#  endif
> -extern __typeof (memcmp) DEFAULT_MEMCMP;
> +#  include <sysdeps/x86_64/memcmp-isa-default-impl.h>
>   # else
> -#  define DEFAULT_MEMCMP	memcmp
> +#  define DEFAULT_MEMCMP	__memcmp_ia32
>   # endif
> +extern __typeof (memcmp) DEFAULT_MEMCMP;
> +#else
> +# define DEFAULT_MEMCMP	memcmp
> +#endif
>   
> -# define CHECK_GLIBC_IFUNC_CPU_OFF(f, cpu_features, name, len)		\
> +#define CHECK_GLIBC_IFUNC_CPU_OFF(f, cpu_features, name, len)		\
>     _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
>     if (!DEFAULT_MEMCMP (f, #name, len))					\
>       {									\
> @@ -50,7 +49,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
>   
>   /* Disable a preferred feature NAME.  We don't enable a preferred feature
>      which isn't available.  */
> -# define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len)	\
> +#define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len)	\
>     _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
>     if (!DEFAULT_MEMCMP (f, #name, len))					\
>       {									\
> @@ -60,7 +59,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
>       }
>   
>   /* Enable/disable a preferred feature NAME.  */
> -# define CHECK_GLIBC_IFUNC_PREFERRED_BOTH(f, cpu_features, name,	\
> +#define CHECK_GLIBC_IFUNC_PREFERRED_BOTH(f, cpu_features, name,	\
>   					  disable, len)			\
>     _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
>     if (!DEFAULT_MEMCMP (f, #name, len))					\
> @@ -74,7 +73,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
>   
>   /* Enable/disable a preferred feature NAME.  Enable a preferred feature
>      only if the feature NEED is usable.  */
> -# define CHECK_GLIBC_IFUNC_PREFERRED_NEED_BOTH(f, cpu_features, name,	\
> +#define CHECK_GLIBC_IFUNC_PREFERRED_NEED_BOTH(f, cpu_features, name,	\
>   					       need, disable, len)	\
>     _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);	\
>     if (!DEFAULT_MEMCMP (f, #name, len))					\
> @@ -286,8 +285,7 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
>     while (*c != '\0');
>   }
>   
> -# if CET_ENABLED
> -
> +#if CET_ENABLED
>   attribute_hidden
>   void
>   TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *valp)
> @@ -313,5 +311,4 @@ TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *valp)
>   			   sizeof ("permissive")) == 0)
>       GL(dl_x86_feature_control).shstk = cet_permissive;
>   }
> -# endif
>   #endif
> diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
> index a0474af8d1..ab671487da 100644
> --- a/sysdeps/x86/dl-cacheinfo.h
> +++ b/sysdeps/x86/dl-cacheinfo.h
> @@ -760,10 +760,8 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
>     else if (non_temporal_threshold > maximum_non_temporal_threshold)
>       non_temporal_threshold = maximum_non_temporal_threshold;
>   
> -#if HAVE_TUNABLES
>     /* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8.  */
>     unsigned int minimum_rep_movsb_threshold;
> -#endif
>     /* NB: The default REP MOVSB threshold is 4096 * (VEC_SIZE / 16) for
>        VEC_SIZE == 64 or 32.  For VEC_SIZE == 16, the default REP MOVSB
>        threshold is 2048 * (VEC_SIZE / 16).  */
> @@ -772,24 +770,18 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
>         && !CPU_FEATURE_PREFERRED_P (cpu_features, Prefer_No_AVX512))
>       {
>         rep_movsb_threshold = 4096 * (64 / 16);
> -#if HAVE_TUNABLES
>         minimum_rep_movsb_threshold = 64 * 8;
> -#endif
>       }
>     else if (CPU_FEATURE_PREFERRED_P (cpu_features,
>   				    AVX_Fast_Unaligned_Load))
>       {
>         rep_movsb_threshold = 4096 * (32 / 16);
> -#if HAVE_TUNABLES
>         minimum_rep_movsb_threshold = 32 * 8;
> -#endif
>       }
>     else
>       {
>         rep_movsb_threshold = 2048 * (16 / 16);
> -#if HAVE_TUNABLES
>         minimum_rep_movsb_threshold = 16 * 8;
> -#endif
>       }
>     /* NB: The default REP MOVSB threshold is 2112 on processors with fast
>        short REP MOVSB (FSRM).  */
> @@ -799,7 +791,6 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
>     /* The default threshold to use Enhanced REP STOSB.  */
>     unsigned long int rep_stosb_threshold = 2048;
>   
> -#if HAVE_TUNABLES
>     long int tunable_size;
>   
>     tunable_size = TUNABLE_GET (x86_data_cache_size, long int, NULL);
> @@ -836,7 +827,6 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
>   			   minimum_rep_movsb_threshold, SIZE_MAX);
>     TUNABLE_SET_WITH_BOUNDS (x86_rep_stosb_threshold, rep_stosb_threshold, 1,
>   			   SIZE_MAX);
> -#endif
>   
>     unsigned long int rep_movsb_stop_threshold;
>     /* ERMS feature is implemented from AMD Zen3 architecture and it is
> diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
> index 688eb2d7c4..54396c3c3f 100644
> --- a/sysdeps/x86_64/Makefile
> +++ b/sysdeps/x86_64/Makefile
> @@ -57,7 +57,6 @@ $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
>   CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
>   CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
>   
> -ifneq (no,$(have-tunables))
>   tests += tst-platform-1
>   modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
>   extra-test-objs += tst-platformmod-2.o
> @@ -71,7 +70,6 @@ $(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
>   # always set to x86_64.
>   tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
>   	GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX512F,-AVX2
> -endif
>   
>   tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
>   	 tst-audit10 tst-sse tst-avx tst-avx512

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable
  2023-03-13 19:06 ` [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable Adhemerval Zanella
@ 2023-03-22 17:08   ` Siddhesh Poyarekar
  2023-03-22 17:51     ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-22 17:08 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha, Florian Weimer

On 2023-03-13 15:06, Adhemerval Zanella wrote:
> And make the DFS algorithm (added on 2.35) the de-facto implementation.

Isn't this orthogonal to the proposal to remove --enable-tunables?

Thanks,
Sid

> ---
>   elf/dl-sort-maps.c                  | 139 +---------------------------
>   elf/dl-tunables.list                |   9 --
>   elf/dso-sort-tests-1.def            |  15 +--
>   elf/dso-sort-tests-2.def            |  10 +-
>   elf/tst-rtld-list-tunables.exp      |   1 -
>   manual/tunables.texi                |  13 ---
>   sysdeps/mach/hurd/dl-sysdep.c       |   3 -
>   sysdeps/unix/sysv/linux/dl-sysdep.c |   3 -
>   8 files changed, 8 insertions(+), 185 deletions(-)
> 
> diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
> index 325e96388e..72ca5cec33 100644
> --- a/elf/dl-sort-maps.c
> +++ b/elf/dl-sort-maps.c
> @@ -20,112 +20,6 @@
>   #include <ldsodefs.h>
>   #include <elf/dl-tunables.h>
>   
> -/* Note: this is the older, "original" sorting algorithm, being used as
> -   default up to 2.35.
> -
> -   Sort array MAPS according to dependencies of the contained objects.
> -   If FOR_FINI is true, this is called for finishing an object.  */
> -static void
> -_dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
> -			bool force_first, bool for_fini)
> -{
> -  /* Allows caller to do the common optimization of skipping the first map,
> -     usually the main binary.  */
> -  maps += force_first;
> -  nmaps -= force_first;
> -
> -  /* A list of one element need not be sorted.  */
> -  if (nmaps <= 1)
> -    return;
> -
> -  unsigned int i = 0;
> -  uint16_t seen[nmaps];
> -  memset (seen, 0, nmaps * sizeof (seen[0]));
> -  while (1)
> -    {
> -      /* Keep track of which object we looked at this round.  */
> -      ++seen[i];
> -      struct link_map *thisp = maps[i];
> -
> -      if (__glibc_unlikely (for_fini))
> -	{
> -	  /* Do not handle ld.so in secondary namespaces and objects which
> -	     are not removed.  */
> -	  if (thisp != thisp->l_real || thisp->l_idx == -1)
> -	    goto skip;
> -	}
> -
> -      /* Find the last object in the list for which the current one is
> -	 a dependency and move the current object behind the object
> -	 with the dependency.  */
> -      unsigned int k = nmaps - 1;
> -      while (k > i)
> -	{
> -	  struct link_map **runp = maps[k]->l_initfini;
> -	  if (runp != NULL)
> -	    /* Look through the dependencies of the object.  */
> -	    while (*runp != NULL)
> -	      if (__glibc_unlikely (*runp++ == thisp))
> -		{
> -		move:
> -		  /* Move the current object to the back past the last
> -		     object with it as the dependency.  */
> -		  memmove (&maps[i], &maps[i + 1],
> -			   (k - i) * sizeof (maps[0]));
> -		  maps[k] = thisp;
> -
> -		  if (seen[i + 1] > nmaps - i)
> -		    {
> -		      ++i;
> -		      goto next_clear;
> -		    }
> -
> -		  uint16_t this_seen = seen[i];
> -		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
> -		  seen[k] = this_seen;
> -
> -		  goto next;
> -		}
> -
> -	  if (__glibc_unlikely (for_fini && maps[k]->l_reldeps != NULL))
> -	    {
> -	      unsigned int m = maps[k]->l_reldeps->act;
> -	      struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
> -
> -	      /* Look through the relocation dependencies of the object.  */
> -	      while (m-- > 0)
> -		if (__glibc_unlikely (relmaps[m] == thisp))
> -		  {
> -		    /* If a cycle exists with a link time dependency,
> -		       preserve the latter.  */
> -		    struct link_map **runp = thisp->l_initfini;
> -		    if (runp != NULL)
> -		      while (*runp != NULL)
> -			if (__glibc_unlikely (*runp++ == maps[k]))
> -			  goto ignore;
> -		    goto move;
> -		  }
> -	    ignore:;
> -	    }
> -
> -	  --k;
> -	}
> -
> -    skip:
> -      if (++i == nmaps)
> -	break;
> -    next_clear:
> -      memset (&seen[i], 0, (nmaps - i) * sizeof (seen[0]));
> -
> -    next:;
> -    }
> -}
> -
> -#if !HAVE_TUNABLES
> -/* In this case, just default to the original algorithm.  */
> -strong_alias (_dl_sort_maps_original, _dl_sort_maps);
> -#else
> -
>   /* We use a recursive function due to its better clarity and ease of
>      implementation, as well as faster execution speed. We already use
>      alloca() for list allocation during the breadth-first search of
> @@ -180,9 +74,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
>   /* Topologically sort array MAPS according to dependencies of the contained
>      objects.  */
>   
> -static void
> -_dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
> -		   bool force_first, bool for_fini)
> +void
> +_dl_sort_maps (struct link_map **maps, unsigned int nmaps, bool force_first,
> +	       bool for_fini)
>   {
>     struct link_map *first_map = maps[0];
>     for (int i = nmaps - 1; i >= 0; i--)
> @@ -289,30 +183,3 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
>         maps[0] = first_map;
>       }
>   }
> -
> -void
> -_dl_sort_maps_init (void)
> -{
> -  int32_t algorithm = TUNABLE_GET (glibc, rtld, dynamic_sort, int32_t, NULL);
> -  GLRO(dl_dso_sort_algo) = algorithm == 1 ? dso_sort_algorithm_original
> -					  : dso_sort_algorithm_dfs;
> -}
> -
> -void
> -_dl_sort_maps (struct link_map **maps, unsigned int nmaps,
> -	       bool force_first, bool for_fini)
> -{
> -  /* It can be tempting to use a static function pointer to store and call
> -     the current selected sorting algorithm routine, but experimentation
> -     shows that current processors still do not handle indirect branches
> -     that efficiently, plus a static function pointer will involve
> -     PTR_MANGLE/DEMANGLE, further impairing performance of small, common
> -     input cases. A simple if-case with direct function calls appears to
> -     be the fastest.  */
> -  if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
> -    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
> -  else
> -    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
> -}
> -
> -#endif /* HAVE_TUNABLES.  */
> diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list
> index 695ba7192e..b9fa831000 100644
> --- a/elf/dl-tunables.list
> +++ b/elf/dl-tunables.list
> @@ -162,15 +162,6 @@ glibc {
>       }
>     }
>   
> -  rtld {
> -    dynamic_sort {
> -      type: INT_32
> -      minval: 1
> -      maxval: 2
> -      default: 2
> -    }
> -  }
> -
>     gmon {
>       minarcs {
>         type: INT_32
> diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
> index 4bf9052db1..f5afd003d8 100644
> --- a/elf/dso-sort-tests-1.def
> +++ b/elf/dso-sort-tests-1.def
> @@ -2,10 +2,6 @@
>   # This file is to be processed by ../scripts/dso-ordering-test.py, see usage
>   # in elf/Makefile for how it is executed.
>   
> -# We test both dynamic loader sorting algorithms
> -tunable_option: glibc.rtld.dynamic_sort=1
> -tunable_option: glibc.rtld.dynamic_sort=2
> -
>   # Sequence of single dependencies with no cycles.
>   tst-dso-ordering1: a->b->c
>   output: c>b>a>{}<a<b<c
> @@ -56,18 +52,15 @@ output: b>a>{}<a<b
>   # relocation(dynamic) dependencies. While this is technically unspecified, the
>   # presumed reasonable practical behavior is for the destructor order to respect
>   # the static DT_NEEDED links (here this means the a->b->c->d order).
> -# The older dynamic_sort=1 algorithm does not achieve this, while the DFS-based
> -# dynamic_sort=2 algorithm does, although it is still arguable whether going
> -# beyond spec to do this is the right thing to do.
> +# The DFS-based sorting algorithm does it, although it is still arguable whether
> +# going beyond spec to do this is the right thing to do.
>   # The below expected outputs are what the two algorithms currently produce
>   # respectively, for regression testing purposes.
>   tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
> -output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
> -output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
> +output: {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
>   
>   # Test that even in the presence of dependency loops involving dlopen'ed
>   # object, that object is initialized last (and not unloaded prematurely).
>   # Final destructor order is indeterminate due to the cycle.
>   tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
> -output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
> -output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
> +output: {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
> diff --git a/elf/dso-sort-tests-2.def b/elf/dso-sort-tests-2.def
> index b79e79ecb7..183d311fba 100644
> --- a/elf/dso-sort-tests-2.def
> +++ b/elf/dso-sort-tests-2.def
> @@ -1,11 +1,4 @@
>   # Large DSO sorting testcase adapted from Red Hat Bugzilla 1162810
> -#
> -# Note that below we specify different expected outputs between dynamic_sort=1
> -# and dynamic_sort=2 algorithms, due to circular dependencies in the testcase
> -# causing different sorting behavior.  These expected outputs are what the two
> -# algorithms currently produce, and are used for regression comparison tests.
> -# They are not "definitively" correct outputs, for circular dependencies
> -# inherently have unspecified behavior.
>   
>   xtest(tst-redhat-1162810):
>   {}->A101
> @@ -610,5 +603,4 @@ M30X22
>   M30X23
>   M30X24
>   M30X25
> -xfail_output(glibc.rtld.dynamic_sort=1): M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M27X14>M28X18>M27X15>M28X13>M27X11>M28X23>M27X25>M28X14>M28X25>M27X23>M27X22>M28X24>M27X21>M27X13>M27X19>M27X17>M26X11>M26X23>M26X21>M26X22>M26X20>M26X16>M25X21>M17X22>M15X15>M20X14>M20X16>M18X18>M28X12>M27X24>M25X17>M27X20>M26X18>M26X17>M27X16>M26X19>M25X18>M26X24>M25X20>M24X17>M23X18>M25X13>M26X13>M17X23>M16X16>M26X12>M25X12>M26X15>M24X19>M25X23>M25X24>M25X25>M24X20>M25X19>M24X21>M23X17>M22X21>M24X14>M23X22>M24X24>M22X20>M24X13>M25X11>M24X12>M25X15>M23X15>M25X16>M24X22>M23X13>M24X18>M23X14>M22X22>M21X20>M24X25>M23X16>M22X25>M21X19>M22X14>M23X11>M22X15>M21X18>M22X19>M21X17>M20X17>M19X17>M21X24>M21X12>M20X22>M19X16>M18X25>M19X21>M19X20>M18X24>M20X12>M19X11>M23X20>M22X24>M22X16>M21X21>M25X14>M23X19>M23X24>M20X24>M19X12>M18X15>M17X14>M16X18>M14X25>M16X22>M16X20>M17X17>M22X12>M21X11>M20X15>M18X22>M19X24>M19X18>M18X21>M17X16>M17X18>M16X21>M15X20>M19X22>M18X20>M18X11>M17X19>M16X17>M15X21>M16X14>M16X13>M15X22>M14X20>M17X25>M16X19>M14X21>M13X24>M12X12>M16X24>M15X23>M14X16>M16X15>M15X25>M15X11>M15X12>M14X15>M13X14>M14X22>M13X20>M12X13>M11X11>M22X23>M21X15>M21X16>M20X21>M20X20>M18X17>M19X25>M18X23>M21X13>M15X17>M15X18>M18X19>M17X24>M16X12>M17X13>M20X25>M19X23>M15X19>M14X13>M13X18>M15X13>M17X12>M16X11>M18X13>M18X12>M14X11>M14X24>M13X19>M15X14>M17X20>M20X11>M20X13>M21X14>M15X24>M14X12>M13X22>M14X23>M13X23>M14X19>M17X15>M16X25>M17X11>M18X14>M19X19>M21X25>M13X12>M13X11>M14X18>M13X13>M12X11>M15X16>M14X14>M27X12>M17X21>M20X23>M22X13>M21X22>M24X16>M24X15>M26X25>M23X25>M26X14>M23X12>M22X18>M24X11>M16X23>M19X14>M19X13>M21X23>M22X17>M23X23>M23X21>M25X22>M18X16>M19X15>M20X18>M20X19>M22X11>M24X23>C156>C118>C143>C137>C147>C106>C168>C113>C163>C155>C105>C146>C187>A150>C139>C180>C164>C193>C157>A191>C158>B188>A159>C184>C121>C154>B171>A105>C131>C104>B104>C161>C111>B145>C160>B155>A163>C112>C142>B148>C133>B198>A198>A115>C114>B157>A156>C175>B144>A120>C173>B184>A174>C126>B107>A139>C194>B194>A194>C116>B116>C166>B160>B110>A110>C128>B128>A128>C179>B162>A154>C186>B187>A179>C124>B181>A101>C153>B158>A136>C135>C176>A192>B133>A133>C177>B177>A177>C185>C103>B141>A141>C183>A162>C192>C129>B179>C144>B124>B183>C127>B127>A127>B108>A112>B153>A153>C167>B167>A186>A122>C162>A144>B149>C174>B131>A185>C141>B106>A126>A167>C140>B122>A170>C198>B143>C117>C123>B123>A147>A106>C200>B169>C191>B175>A123>B118>A182>C132>B151>A145>A104>A109>C159>C150>B119>A119>A178>B164>B114>A164>C181>A102>C122>B134>A157>A116>C195>B191>B111>C172>B172>A118>B129>A129>C149>A107>C170>B197>A197>A173>B168>A132>C107>B165>A160>A131>C188>A168>B109>C178>A189>A148>C119>C190>C120>B166>B176>C108>B135>B139>A103>B178>A169>B132>C125>C138>B163>A111>B170>C110>A165>C151>C169>C199>A138>C182>A135>B101>B142>C101>C148>B193>B152>A158>A199>C136>B137>A161>B120>A108>A149>A125>B113>A184>C171>A134>A175>A124>B150>B161>B102>A146>A187>C130>B192>B200>A200>A142>A183>C102>B105>B156>A176>C165>B147>A137>A196>B190>A190>B125>C134>C189>B126>B186>A166>B136>B195>A195>B154>B138>B112>B173>A117>B159>B182>A181>A140>C145>B117>A152>A193>C197>B130>A172>A113>A151>B115>A143>B140>B185>B103>A121>A180>A130>A171>B199>C196>B146>B180>C115>B174>B121>A188>B196>B189>C152>C109>A155>A114>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<A114<A155<C109<C152<B189<B196<A188<B121<B174<C115<B180<B146<C196<B199<A171<A130<A180<A121<B103<B185<B140<A143<B115<A151<A113<A172<B130<C197<A193<A152<B117<C145<A140<A181<B182<B159<A117<B173<B112<B138<B154<A195<B195<B136<A166<B186<B126<C189<C134<B125<A190<B190<A196<A137<B147<C165<A176<B156<B105<C102<A183<A142<A200<B200<B192<C130<A187<A146<B102<B161<B150<A124<A175<A134<C171<A184<B113<A125<A149<A108<B120<A161<B137<C136<A199<A158<B152<B193<C148<C101<B142<B101<A135<C182<A138<C199<C169<C151<A165<C110<B170<A111<B163<C138<C125<B132<A169<B178<A103<B139<B135<C108<B176<B166<C120<C190<C119<A148<A189<C178<B109<A168<C188<A131<A160<B165<C107<A132<B168<A173<A197<B197<C170<A107<C149<A129<B129<A118<B172<C172<B111<B191<C195<A116<A157<B134<C122<A102<C181<A164<B114<B164<A178<A119<B119<C150<C159<A109<A104<A145<B151<C132<A182<B118<A123<B175<C191<B169<C200<A106<A147<B123<C123<C117<B143<C198<A170<B122<C140<A167<A126<B106<C141<A185<B131<C174<B149<A144<C162<A122<A186<B167<C167<A153<B153<A112<B108<A127<B127<C127<B183<B124<C144<B179<C129<C192<A162<C183<A141<B141<C103<C185<A177<B177<C177<A133<B133<A192<C176<C135<A136<B158<C153<A101<B181<C124<A179<B187<C186<A154<B162<C179<A128<B128<C128<A110<B110<B160<C166<B116<C116<A194<B194<C194<A139<B107<C126<A174<B184<C173<A120<B144<C175<A156<B157<C114<A115<A198<B198<C133<B148<C142<C112<A163<B155<C160<B145<C111<C161<B104<C104<C131<A105<B171<C154<C121<C184<A159<B188<C158<A191<C157<C193<C164<C180<C139<A150<C187<C146<C105<C155<C163<C113<C168<C106<C147<C137<C143<C118<C156<M24X23<M22X11<M20X19<M20X18<M19X15<M18X16<M25X22<M23X21<M23X23<M22X17<M21X23<M19X13<M19X14<M16X23<M24X11<M22X18<M23X12<M26X14<M23X25<M26X25<M24X15<M24X16<M21X22<M22X13<M20X23<M17X21<M27X12<M14X14<M15X16<M12X11<M13X13<M14X18<M13X11<M13X12<M21X25<M19X19<M18X14<M17X11<M16X25<M17X15<M14X19<M13X23<M14X23<M13X22<M14X12<M15X24<M21X14<M20X13<M20X11<M17X20<M15X14<M13X19<M14X24<M14X11<M18X12<M18X13<M16X11<M17X12<M15X13<M13X18<M14X13<M15X19<M19X23<M20X25<M17X13<M16X12<M17X24<M18X19<M15X18<M15X17<M21X13<M18X23<M19X25<M18X17<M20X20<M20X21<M21X16<M21X15<M22X23<M11X11<M12X13<M13X20<M14X22<M13X14<M14X15<M15X12<M15X11<M15X25<M16X15<M14X16<M15X23<M16X24<M12X12<M13X24<M14X21<M16X19<M17X25<M14X20<M15X22<M16X13<M16X14<M15X21<M16X17<M17X19<M18X11<M18X20<M19X22<M15X20<M16X21<M17X18<M17X16<M18X21<M19X18<M19X24<M18X22<M20X15<M21X11<M22X12<M17X17<M16X20<M16X22<M14X25<M16X18<M17X14<M18X15<M19X12<M20X24<M23X24<M23X19<M25X14<M21X21<M22X16<M22X24<M23X20<M19X11<M20X12<M18X24<M19X20<M19X21<M18X25<M19X16<M20X22<M21X12<M21X24<M19X17<M20X17<M21X17<M22X19<M21X18<M22X15<M23X11<M22X14<M21X19<M22X25<M23X16<M24X25<M21X20<M22X22<M23X14<M24X18<M23X13<M24X22<M25X16<M23X15<M25X15<M24X12<M25X11<M24X13<M22X20<M24X24<M23X22<M24X14<M22X21<M23X17<M24X21<M25X19<M24X20<M25X25<M25X24<M25X23<M24X19<M26X15<M25X12<M26X12<M16X16<M17X23<M26X13<M25X13<M23X18<M24X17<M25X20<M26X24<M25X18<M26X19<M27X16<M26X17<M26X18<M27X20<M25X17<M27X24<M28X12<M18X18<M20X16<M20X14<M15X15<M17X22<M25X21<M26X16<M26X20<M26X22<M26X21<M26X23<M26X11<M27X17<M27X19<M27X13<M27X21<M28X24<M27X22<M27X23<M28X25<M28X14<M27X25<M28X23<M27X11<M28X13<M27X15<M28X18<M27X14<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
> -output(glibc.rtld.dynamic_sort=2): M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18>M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M26X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X17>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17>M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M18X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X16>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22>M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M17X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X12>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146>C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138>C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174>C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130>C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168>C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140>C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188>C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183>C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191>C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120>C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156>C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175>C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137>C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124>C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148>C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119>C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145>C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186>C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101>C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141>C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<B110<C110<A127<B127<C127<A133<B133<C133<A141<B141<C141<A185<B185<C185<A177<B177<C177<A192<B192<C192<A103<B103<C103<A101<B101<C101<A165<B165<C165<A117<B117<C117<A153<B153<C153<A160<B160<C160<A186<B186<C186<A195<B195<C195<A157<B157<C157<A173<B173<C173<A161<B161<C161<A145<B145<C145<A116<B116<C116<A135<B135<C135<A136<B136<C136<A154<B154<C154<A119<B119<C119<A189<B189<C189<A149<B149<C149<A129<B129<C129<A169<B169<C169<A148<B148<C148<A111<B111<C111<A104<B104<C104<A178<B178<C178<A151<B151<C151<A124<B124<C124<A179<B179<C179<A128<B128<C128<A110<B156<C156<A155<B155<C155<A137<B137<C137<A113<B113<C113<A181<B181<C181<A105<B105<C105<A196<B196<C196<A175<B175<C175<A197<B197<C197<A193<B193<C193<A121<B121<C121<A125<B125<C125<A156<B198<C198<A170<B170<C170<A107<B107<C107<A132<B132<C132<A123<B123<C123<A120<B120<C120<A166<B166<C166<A194<B194<C194<A139<B139<C139<A108<B108<C108<A191<B191<C191<A144<B144<C144<A198<B150<C150<A147<B147<C147<A152<B152<C152<A183<B183<C183<A200<B200<C200<A106<B106<C106<A114<B114<C114<A199<B199<C199<A188<B188<C188<A131<B131<C131<A164<B164<C164<A158<B158<C112<A163<B163<C163<A140<B140<C140<A167<B167<C146<A134<B134<C134<A159<B159<C159<A109<B109<C109<A168<B168<C182<A182<B182<C168<A171<B171<C171<A184<B184<C184<A118<B118<C118<A130<B130<C130<A187<B187<C187<A172<B172<C172<A143<B115<C115<A176<B176<C176<A174<B102<C102<A142<B142<C142<A162<B162<C162<A122<B122<C122<A102<B174<C174<A138<B138<C138<A190<B190<C190<A126<B126<C126<A115<B143<C143<A180<B180<C180<A146<B146<C167<A112<B112<C158<A150<M28X12<M18X18<M20X16<M22X24<M24X23<M25X12<M15X15<M17X13<M19X21<M21X19<M23X12<M13X13<M14X18<M15X21<M17X19<M19X12<M21X25<M23X18<M24X17<M25X22<M26X16<M27X12<M17X17<M19X20<M21X23<M23X11<M24X16<M26X12<M16X16<M18X24<M20X22<M21X14<M22X16<M23X23<M24X12<M14X14<M16X17<M18X20<M19X22<M21X15<M22X12<M12X12<M13X22<M13X23<M13X24<M14X19<M14X25<M16X18<M17X15<M18X11<M19X11<M20X11<M21X12<M11X11<M12X11<M13X11<M14X12<M13X12<M14X23<M15X24<M12X13<M13X18<M14X13<M13X19<M14X24<M15X19<M14X11<M13X20<M14X20<M15X20<M14X22<M15X13<M16X20<M15X14<M14X21<M15X16<M16X21<M15X18<M13X14<M14X15<M15X25<M16X15<M15X11<M16X11<M15X12<M16X22<M17X12<M14X16<M15X22<M16X12<M17X22<M16X13<M17X18<M16X14<M17X14<M18X14<M15X23<M16X23<M17X23<M18X25<M19X15<M16X25<M17X16<M18X23<M16X24<M17X21<M15X17<M16X19<M17X24<M18X19<M17X25<M18X15<M19X25<M18X17<M17X11<M18X13<M19X19<M17X20<M18X21<M19X16<M19X17<M20X17<M19X18<M18X22<M19X14<M20X15<M20X12<M22X25<M20X13<M20X14<M18X12<M19X24<M20X21<M21X18<M19X13<M20X18<M21X13<M20X19<M20X20<M21X22<M18X16<M19X23<M20X25<M21X16<M22X23<M21X17<M21X11<M22X13<M22X14<M20X24<M21X20<M21X21<M22X17<M23X20<M22X18<M23X16<M25X11<M22X22<M20X23<M21X24<M22X19<M23X25<M22X20<M23X21<M24X24<M22X21<M23X19<M24X11<M23X22<M24X15<M22X11<M23X14<M24X18<M23X15<M24X13<M23X24<M24X25<M23X17<M24X19<M25X14<M22X15<M23X13<M24X20<M25X24<M25X25<M24X21<M25X20<M25X21<M24X22<M25X15<M25X16<M26X25<M26X11<M25X23<M24X14<M25X19<M26X13<M26X15<M26X20<M25X17<M26X21<M25X18<M26X17<M27X22<M27X23<M26X18<M26X19<M27X16<M28X14<M25X13<M26X22<M27X17<M26X23<M27X13<M27X14<M27X15<M26X24<M27X24<M28X25<M27X11<M28X18<M27X25<M26X14<M27X19<M27X20<M28X13<M27X21<M28X23<M28X24<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
> +output: M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18>M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M26X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X17>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17>M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M18X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X16>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22>M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M17X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X12>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146>C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138>C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174>C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130>C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168>C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140>C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188>C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183>C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191>C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120>C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156>C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175>C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137>C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124>C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148>C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119>C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145>C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186>C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101>C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141>C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<B110<C110<A127<B127<C127<A133<B133<C133<A141<B141<C141<A185<B185<C185<A177<B177<C177<A192<B192<C192<A103<B103<C103<A101<B101<C101<A165<B165<C165<A117<B117<C117<A153<B153<C153<A160<B160<C160<A186<B186<C186<A195<B195<C195<A157<B157<C157<A173<B173<C173<A161<B161<C161<A145<B145<C145<A116<B116<C116<A135<B135<C135<A136<B136<C136<A154<B154<C154<A119<B119<C119<A189<B189<C189<A149<B149<C149<A129<B129<C129<A169<B169<C169<A148<B148<C148<A111<B111<C111<A104<B104<C104<A178<B178<C178<A151<B151<C151<A124<B124<C124<A179<B179<C179<A128<B128<C128<A110<B156<C156<A155<B155<C155<A137<B137<C137<A113<B113<C113<A181<B181<C181<A105<B105<C105<A196<B196<C196<A175<B175<C175<A197<B197<C197<A193<B193<C193<A121<B121<C121<A125<B125<C125<A156<B198<C198<A170<B170<C170<A107<B107<C107<A132<B132<C132<A123<B123<C123<A120<B120<C120<A166<B166<C166<A194<B194<C194<A139<B139<C139<A108<B108<C108<A191<B191<C191<A144<B144<C144<A198<B150<C150<A147<B147<C147<A152<B152<C152<A183<B183<C183<A200<B200<C200<A106<B106<C106<A114<B114<C114<A199<B199<C199<A188<B188<C188<A131<B131<C131<A164<B164<C164<A158<B158<C112<A163<B163<C163<A140<B140<C140<A167<B167<C146<A134<B134<C134<A159<B159<C159<A109<B109<C109<A168<B168<C182<A182<B182<C168<A171<B171<C171<A184<B184<C184<A118<B118<C118<A130<B130<C130<A187<B187<C187<A172<B172<C172<A143<B115<C115<A176<B176<C176<A174<B102<C102<A142<B142<C142<A162<B162<C162<A122<B122<C122<A102<B174<C174<A138<B138<C138<A190<B190<C190<A126<B126<C126<A115<B143<C143<A180<B180<C180<A146<B146<C167<A112<B112<C158<A150<M28X12<M18X18<M20X16<M22X24<M24X23<M25X12<M15X15<M17X13<M19X21<M21X19<M23X12<M13X13<M14X18<M15X21<M17X19<M19X12<M21X25<M23X18<M24X17<M25X22<M26X16<M27X12<M17X17<M19X20<M21X23<M23X11<M24X16<M26X12<M16X16<M18X24<M20X22<M21X14<M22X16<M23X23<M24X12<M14X14<M16X17<M18X20<M19X22<M21X15<M22X12<M12X12<M13X22<M13X23<M13X24<M14X19<M14X25<M16X18<M17X15<M18X11<M19X11<M20X11<M21X12<M11X11<M12X11<M13X11<M14X12<M13X12<M14X23<M15X24<M12X13<M13X18<M14X13<M13X19<M14X24<M15X19<M14X11<M13X20<M14X20<M15X20<M14X22<M15X13<M16X20<M15X14<M14X21<M15X16<M16X21<M15X18<M13X14<M14X15<M15X25<M16X15<M15X11<M16X11<M15X12<M16X22<M17X12<M14X16<M15X22<M16X12<M17X22<M16X13<M17X18<M16X14<M17X14<M18X14<M15X23<M16X23<M17X23<M18X25<M19X15<M16X25<M17X16<M18X23<M16X24<M17X21<M15X17<M16X19<M17X24<M18X19<M17X25<M18X15<M19X25<M18X17<M17X11<M18X13<M19X19<M17X20<M18X21<M19X16<M19X17<M20X17<M19X18<M18X22<M19X14<M20X15<M20X12<M22X25<M20X13<M20X14<M18X12<M19X24<M20X21<M21X18<M19X13<M20X18<M21X13<M20X19<M20X20<M21X22<M18X16<M19X23<M20X25<M21X16<M22X23<M21X17<M21X11<M22X13<M22X14<M20X24<M21X20<M21X21<M22X17<M23X20<M22X18<M23X16<M25X11<M22X22<M20X23<M21X24<M22X19<M23X25<M22X20<M23X21<M24X24<M22X21<M23X19<M24X11<M23X22<M24X15<M22X11<M23X14<M24X18<M23X15<M24X13<M23X24<M24X25<M23X17<M24X19<M25X14<M22X15<M23X13<M24X20<M25X24<M25X25<M24X21<M25X20<M25X21<M24X22<M25X15<M25X16<M26X25<M26X11<M25X23<M24X14<M25X19<M26X13<M26X15<M26X20<M25X17<M26X21<M25X18<M26X17<M27X22<M27X23<M26X18<M26X19<M27X16<M28X14<M25X13<M26X22<M27X17<M26X23<M27X13<M27X14<M27X15<M26X24<M27X24<M28X25<M27X11<M28X18<M27X25<M26X14<M27X19<M27X20<M28X13<M27X21<M28X23<M28X24<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
> diff --git a/elf/tst-rtld-list-tunables.exp b/elf/tst-rtld-list-tunables.exp
> index 2233ea9c7c..f70c16ecb8 100644
> --- a/elf/tst-rtld-list-tunables.exp
> +++ b/elf/tst-rtld-list-tunables.exp
> @@ -11,6 +11,5 @@ glibc.malloc.tcache_max: 0x0 (min: 0x0, max: 0x[f]+)
>   glibc.malloc.tcache_unsorted_limit: 0x0 (min: 0x0, max: 0x[f]+)
>   glibc.malloc.top_pad: 0x20000 (min: 0x0, max: 0x[f]+)
>   glibc.malloc.trim_threshold: 0x0 (min: 0x0, max: 0x[f]+)
> -glibc.rtld.dynamic_sort: 2 (min: 1, max: 2)
>   glibc.rtld.nns: 0x4 (min: 0x1, max: 0x10)
>   glibc.rtld.optional_static_tls: 0x200 (min: 0x0, max: 0x[f]+)
> diff --git a/manual/tunables.texi b/manual/tunables.texi
> index 70dd2264c5..ae6959379b 100644
> --- a/manual/tunables.texi
> +++ b/manual/tunables.texi
> @@ -47,7 +47,6 @@ glibc.elision.enable: 0 (min: 0, max: 1)
>   glibc.malloc.hugetlb: 0x0 (min: 0x0, max: 0xffffffffffffffff)
>   glibc.cpu.x86_rep_movsb_threshold: 0x2000 (min: 0x100, max: 0xffffffffffffffff)
>   glibc.malloc.mxfast: 0x0 (min: 0x0, max: 0xffffffffffffffff)
> -glibc.rtld.dynamic_sort: 2 (min: 1, max: 2)
>   glibc.elision.skip_lock_busy: 3 (min: 0, max: 2147483647)
>   glibc.malloc.top_pad: 0x20000 (min: 0x0, max: 0xffffffffffffffff)
>   glibc.cpu.x86_rep_stosb_threshold: 0x800 (min: 0x1, max: 0xffffffffffffffff)
> @@ -334,18 +333,6 @@ changed once allocated at process startup.  The default allocation of
>   optional static TLS is 512 bytes and is allocated in every thread.
>   @end deftp
>   
> -@deftp Tunable glibc.rtld.dynamic_sort
> -Sets the algorithm to use for DSO sorting, valid values are @samp{1} and
> -@samp{2}.  For value of @samp{1}, an older O(n^3) algorithm is used, which is
> -long time tested, but may have performance issues when dependencies between
> -shared objects contain cycles due to circular dependencies.  When set to the
> -value of @samp{2}, a different algorithm is used, which implements a
> -topological sort through depth-first search, and does not exhibit the
> -performance issues of @samp{1}.
> -
> -The default value of this tunable is @samp{2}.
> -@end deftp
> -
>   @node Elision Tunables
>   @section Elision Tunables
>   @cindex elision tunables
> diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
> index a2115f6edb..cc4e58043f 100644
> --- a/sysdeps/mach/hurd/dl-sysdep.c
> +++ b/sysdeps/mach/hurd/dl-sysdep.c
> @@ -102,9 +102,6 @@ _dl_sysdep_start (void **start_argptr,
>   
>         __tunables_init (_environ);
>   
> -      /* Initialize DSO sorting algorithm after tunables.  */
> -      _dl_sort_maps_init ();
> -
>   #ifdef DL_SYSDEP_INIT
>         DL_SYSDEP_INIT;
>   #endif
> diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
> index 1b3dd869b5..4eed762754 100644
> --- a/sysdeps/unix/sysv/linux/dl-sysdep.c
> +++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
> @@ -109,9 +109,6 @@ _dl_sysdep_start (void **start_argptr,
>   
>     __tunables_init (_environ);
>   
> -  /* Initialize DSO sorting algorithm after tunables.  */
> -  _dl_sort_maps_init ();
> -
>     __brk (0);			/* Initialize the break.  */
>   
>   #ifdef DL_PLATFORM_INIT

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable
  2023-03-22 17:08   ` Siddhesh Poyarekar
@ 2023-03-22 17:51     ` Adhemerval Zanella Netto
  2023-03-22 18:40       ` Siddhesh Poyarekar
  0 siblings, 1 reply; 18+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-22 17:51 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 22/03/23 14:08, Siddhesh Poyarekar wrote:
> On 2023-03-13 15:06, Adhemerval Zanella wrote:
>> And make the DFS algorithm (added on 2.35) the de-facto implementation.
> 
> Isn't this orthogonal to the proposal to remove --enable-tunables?

Yes, the DFS is already the default one.  I meant that now there is no way to
select the one algorithm.  Maybe use the commit messagE:

  And make the old sort algorithm no longer available.

> 
> Thanks,
> Sid
> 
>> ---
>>   elf/dl-sort-maps.c                  | 139 +---------------------------
>>   elf/dl-tunables.list                |   9 --
>>   elf/dso-sort-tests-1.def            |  15 +--
>>   elf/dso-sort-tests-2.def            |  10 +-
>>   elf/tst-rtld-list-tunables.exp      |   1 -
>>   manual/tunables.texi                |  13 ---
>>   sysdeps/mach/hurd/dl-sysdep.c       |   3 -
>>   sysdeps/unix/sysv/linux/dl-sysdep.c |   3 -
>>   8 files changed, 8 insertions(+), 185 deletions(-)
>>
>> diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c
>> index 325e96388e..72ca5cec33 100644
>> --- a/elf/dl-sort-maps.c
>> +++ b/elf/dl-sort-maps.c
>> @@ -20,112 +20,6 @@
>>   #include <ldsodefs.h>
>>   #include <elf/dl-tunables.h>
>>   -/* Note: this is the older, "original" sorting algorithm, being used as
>> -   default up to 2.35.
>> -
>> -   Sort array MAPS according to dependencies of the contained objects.
>> -   If FOR_FINI is true, this is called for finishing an object.  */
>> -static void
>> -_dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
>> -            bool force_first, bool for_fini)
>> -{
>> -  /* Allows caller to do the common optimization of skipping the first map,
>> -     usually the main binary.  */
>> -  maps += force_first;
>> -  nmaps -= force_first;
>> -
>> -  /* A list of one element need not be sorted.  */
>> -  if (nmaps <= 1)
>> -    return;
>> -
>> -  unsigned int i = 0;
>> -  uint16_t seen[nmaps];
>> -  memset (seen, 0, nmaps * sizeof (seen[0]));
>> -  while (1)
>> -    {
>> -      /* Keep track of which object we looked at this round.  */
>> -      ++seen[i];
>> -      struct link_map *thisp = maps[i];
>> -
>> -      if (__glibc_unlikely (for_fini))
>> -    {
>> -      /* Do not handle ld.so in secondary namespaces and objects which
>> -         are not removed.  */
>> -      if (thisp != thisp->l_real || thisp->l_idx == -1)
>> -        goto skip;
>> -    }
>> -
>> -      /* Find the last object in the list for which the current one is
>> -     a dependency and move the current object behind the object
>> -     with the dependency.  */
>> -      unsigned int k = nmaps - 1;
>> -      while (k > i)
>> -    {
>> -      struct link_map **runp = maps[k]->l_initfini;
>> -      if (runp != NULL)
>> -        /* Look through the dependencies of the object.  */
>> -        while (*runp != NULL)
>> -          if (__glibc_unlikely (*runp++ == thisp))
>> -        {
>> -        move:
>> -          /* Move the current object to the back past the last
>> -             object with it as the dependency.  */
>> -          memmove (&maps[i], &maps[i + 1],
>> -               (k - i) * sizeof (maps[0]));
>> -          maps[k] = thisp;
>> -
>> -          if (seen[i + 1] > nmaps - i)
>> -            {
>> -              ++i;
>> -              goto next_clear;
>> -            }
>> -
>> -          uint16_t this_seen = seen[i];
>> -          memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
>> -          seen[k] = this_seen;
>> -
>> -          goto next;
>> -        }
>> -
>> -      if (__glibc_unlikely (for_fini && maps[k]->l_reldeps != NULL))
>> -        {
>> -          unsigned int m = maps[k]->l_reldeps->act;
>> -          struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
>> -
>> -          /* Look through the relocation dependencies of the object.  */
>> -          while (m-- > 0)
>> -        if (__glibc_unlikely (relmaps[m] == thisp))
>> -          {
>> -            /* If a cycle exists with a link time dependency,
>> -               preserve the latter.  */
>> -            struct link_map **runp = thisp->l_initfini;
>> -            if (runp != NULL)
>> -              while (*runp != NULL)
>> -            if (__glibc_unlikely (*runp++ == maps[k]))
>> -              goto ignore;
>> -            goto move;
>> -          }
>> -        ignore:;
>> -        }
>> -
>> -      --k;
>> -    }
>> -
>> -    skip:
>> -      if (++i == nmaps)
>> -    break;
>> -    next_clear:
>> -      memset (&seen[i], 0, (nmaps - i) * sizeof (seen[0]));
>> -
>> -    next:;
>> -    }
>> -}
>> -
>> -#if !HAVE_TUNABLES
>> -/* In this case, just default to the original algorithm.  */
>> -strong_alias (_dl_sort_maps_original, _dl_sort_maps);
>> -#else
>> -
>>   /* We use a recursive function due to its better clarity and ease of
>>      implementation, as well as faster execution speed. We already use
>>      alloca() for list allocation during the breadth-first search of
>> @@ -180,9 +74,9 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
>>   /* Topologically sort array MAPS according to dependencies of the contained
>>      objects.  */
>>   -static void
>> -_dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
>> -           bool force_first, bool for_fini)
>> +void
>> +_dl_sort_maps (struct link_map **maps, unsigned int nmaps, bool force_first,
>> +           bool for_fini)
>>   {
>>     struct link_map *first_map = maps[0];
>>     for (int i = nmaps - 1; i >= 0; i--)
>> @@ -289,30 +183,3 @@ _dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
>>         maps[0] = first_map;
>>       }
>>   }
>> -
>> -void
>> -_dl_sort_maps_init (void)
>> -{
>> -  int32_t algorithm = TUNABLE_GET (glibc, rtld, dynamic_sort, int32_t, NULL);
>> -  GLRO(dl_dso_sort_algo) = algorithm == 1 ? dso_sort_algorithm_original
>> -                      : dso_sort_algorithm_dfs;
>> -}
>> -
>> -void
>> -_dl_sort_maps (struct link_map **maps, unsigned int nmaps,
>> -           bool force_first, bool for_fini)
>> -{
>> -  /* It can be tempting to use a static function pointer to store and call
>> -     the current selected sorting algorithm routine, but experimentation
>> -     shows that current processors still do not handle indirect branches
>> -     that efficiently, plus a static function pointer will involve
>> -     PTR_MANGLE/DEMANGLE, further impairing performance of small, common
>> -     input cases. A simple if-case with direct function calls appears to
>> -     be the fastest.  */
>> -  if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
>> -    _dl_sort_maps_original (maps, nmaps, force_first, for_fini);
>> -  else
>> -    _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
>> -}
>> -
>> -#endif /* HAVE_TUNABLES.  */
>> diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list
>> index 695ba7192e..b9fa831000 100644
>> --- a/elf/dl-tunables.list
>> +++ b/elf/dl-tunables.list
>> @@ -162,15 +162,6 @@ glibc {
>>       }
>>     }
>>   -  rtld {
>> -    dynamic_sort {
>> -      type: INT_32
>> -      minval: 1
>> -      maxval: 2
>> -      default: 2
>> -    }
>> -  }
>> -
>>     gmon {
>>       minarcs {
>>         type: INT_32
>> diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
>> index 4bf9052db1..f5afd003d8 100644
>> --- a/elf/dso-sort-tests-1.def
>> +++ b/elf/dso-sort-tests-1.def
>> @@ -2,10 +2,6 @@
>>   # This file is to be processed by ../scripts/dso-ordering-test.py, see usage
>>   # in elf/Makefile for how it is executed.
>>   -# We test both dynamic loader sorting algorithms
>> -tunable_option: glibc.rtld.dynamic_sort=1
>> -tunable_option: glibc.rtld.dynamic_sort=2
>> -
>>   # Sequence of single dependencies with no cycles.
>>   tst-dso-ordering1: a->b->c
>>   output: c>b>a>{}<a<b<c
>> @@ -56,18 +52,15 @@ output: b>a>{}<a<b
>>   # relocation(dynamic) dependencies. While this is technically unspecified, the
>>   # presumed reasonable practical behavior is for the destructor order to respect
>>   # the static DT_NEEDED links (here this means the a->b->c->d order).
>> -# The older dynamic_sort=1 algorithm does not achieve this, while the DFS-based
>> -# dynamic_sort=2 algorithm does, although it is still arguable whether going
>> -# beyond spec to do this is the right thing to do.
>> +# The DFS-based sorting algorithm does it, although it is still arguable whether
>> +# going beyond spec to do this is the right thing to do.
>>   # The below expected outputs are what the two algorithms currently produce
>>   # respectively, for regression testing purposes.
>>   tst-bz15311: {+a;+e;+f;+g;+d;%d;-d;-g;-f;-e;-a};a->b->c->d;d=>[ba];c=>a;b=>e=>a;c=>f=>b;d=>g=>c
>> -output(glibc.rtld.dynamic_sort=1): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<a<c<d<g<f<b<e];}
>> -output(glibc.rtld.dynamic_sort=2): {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
>> +output: {+a[d>c>b>a>];+e[e>];+f[f>];+g[g>];+d[];%d(b(e(a()))a()g(c(a()f(b(e(a()))))));-d[];-g[];-f[];-e[];-a[<g<f<a<b<c<d<e];}
>>     # Test that even in the presence of dependency loops involving dlopen'ed
>>   # object, that object is initialized last (and not unloaded prematurely).
>>   # Final destructor order is indeterminate due to the cycle.
>>   tst-bz28937: {+a;+b;-b;+c;%c};a->a1;a->a2;a2->a;b->b1;c->a1;c=>a1
>> -output(glibc.rtld.dynamic_sort=1): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a<a2<c<a1
>> -output(glibc.rtld.dynamic_sort=2): {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
>> +output: {+a[a2>a1>a>];+b[b1>b>];-b[<b<b1];+c[c>];%c(a1());}<a2<a<c<a1
>> diff --git a/elf/dso-sort-tests-2.def b/elf/dso-sort-tests-2.def
>> index b79e79ecb7..183d311fba 100644
>> --- a/elf/dso-sort-tests-2.def
>> +++ b/elf/dso-sort-tests-2.def
>> @@ -1,11 +1,4 @@
>>   # Large DSO sorting testcase adapted from Red Hat Bugzilla 1162810
>> -#
>> -# Note that below we specify different expected outputs between dynamic_sort=1
>> -# and dynamic_sort=2 algorithms, due to circular dependencies in the testcase
>> -# causing different sorting behavior.  These expected outputs are what the two
>> -# algorithms currently produce, and are used for regression comparison tests.
>> -# They are not "definitively" correct outputs, for circular dependencies
>> -# inherently have unspecified behavior.
>>     xtest(tst-redhat-1162810):
>>   {}->A101
>> @@ -610,5 +603,4 @@ M30X22
>>   M30X23
>>   M30X24
>>   M30X25
>> -xfail_output(glibc.rtld.dynamic_sort=1):
>> M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M27X14>M28X18>M27X15>M28X13>M27X11>M28X23>M27X25>M28X14>M28X25>M27X23>M27X22>M28X24>M27X21>M27X13>M27X19>M27X17>M26X11>M26X23>M26X21>M26X22>M26X20>M26X16>M25X21>M17X22>M15X15>M20X14>M20X16>M18X18>M28X12>M27X24>M25X17>M27X20>M26X18>M26X17>M27X16>M26X19>M25X18>M26X24>M25X20>M24X17>M23X18>M25X13>M26X13>M17X23>M16X16>M26X12>M25X12>M26X15>M24X19>M25X23>M25X24>M25X25>M24X20>M25X19>M24X21>M23X17>M22X21>M24X14>M23X22>M24X24>M22X20>M24X13>M25X11>M24X12>M25X15>M23X15>M25X16>M24X22>M23X13>M24X18>M23X14>M22X22>M21X20>M24X25>M23X16>M22X25>M21X19>M22X14>M23X11>M22X15>M21X18>M22X19>M21X17>M20X17>M19X17>M21X24>M21X12>M20X22>M19X16>M18X25>M19X21>M19X20>M18X24>M20X12>M19X11>M23X20>M22X24>M22X16>M21X21>M25X14>M23X19>M23X24>M20X24>M19X12>M18X15>M17X14>M16X18>M14X25>M16X22>M16X20>M17X17>M22X12>M21X11>M20X15>M18X22>M19X24>M19X18>M18X21>M17X16>M17X18>M16X21>M15X20>M19X22>M18X20>M18X11>M17X19>M16X17>M15X21>M16X14>M16X13>M15X22>M14X20>M17X25>M16X19>M14X21>M13X24>M12X12>M16X24>M15X23>M14X16>M16X15>M15X25>M15X11>M15X12>M14X15>M13X14>M14X22>M13X20>M12X13>M11X11>M22X23>M21X15>M21X16>M20X21>M20X20>M18X17>M19X25>M18X23>M21X13>M15X17>M15X18>M18X19>M17X24>M16X12>M17X13>M20X25>M19X23>M15X19>M14X13>M13X18>M15X13>M17X12>M16X11>M18X13>M18X12>M14X11>M14X24>M13X19>M15X14>M17X20>M20X11>M20X13>M21X14>M15X24>M14X12>M13X22>M14X23>M13X23>M14X19>M17X15>M16X25>M17X11>M18X14>M19X19>M21X25>M13X12>M13X11>M14X18>M13X13>M12X11>M15X16>M14X14>M27X12>M17X21>M20X23>M22X13>M21X22>M24X16>M24X15>M26X25>M23X25>M26X14>M23X12>M22X18>M24X11>M16X23>M19X14>M19X13>M21X23>M22X17>M23X23>M23X21>M25X22>M18X16>M19X15>M20X18>M20X19>M22X11>M24X23>C156>C118>C143>C137>C147>C106>C168>C113>C163>C155>C105>C146>C187>A150>C139>C180>C164>C193>C157>A191>C158>B188>A159>C184>C121>C154>B171>A105>C131>C104>B104>C161>C111>B145>C160>B155>A163>C112>C142>B148>C133>B198>A198>A115>C114>B157>A156>C175>B144>A120>C173>B184>A174>C126>B107>A139>C194>B194>A194>C116>B116>C166>B160>B110>A110>C128>B128>A128>C179>B162>A154>C186>B187>A179>C124>B181>A101>C153>B158>A136>C135>C176>A192>B133>A133>C177>B177>A177>C185>C103>B141>A141>C183>A162>C192>C129>B179>C144>B124>B183>C127>B127>A127>B108>A112>B153>A153>C167>B167>A186>A122>C162>A144>B149>C174>B131>A185>C141>B106>A126>A167>C140>B122>A170>C198>B143>C117>C123>B123>A147>A106>C200>B169>C191>B175>A123>B118>A182>C132>B151>A145>A104>A109>C159>C150>B119>A119>A178>B164>B114>A164>C181>A102>C122>B134>A157>A116>C195>B191>B111>C172>B172>A118>B129>A129>C149>A107>C170>B197>A197>A173>B168>A132>C107>B165>A160>A131>C188>A168>B109>C178>A189>A148>C119>C190>C120>B166>B176>C108>B135>B139>A103>B178>A169>B132>C125>C138>B163>A111>B170>C110>A165>C151>C169>C199>A138>C182>A135>B101>B142>C101>C148>B193>B152>A158>A199>C136>B137>A161>B120>A108>A149>A125>B113>A184>C171>A134>A175>A124>B150>B161>B102>A146>A187>C130>B192>B200>A200>A142>A183>C102>B105>B156>A176>C165>B147>A137>A196>B190>A190>B125>C134>C189>B126>B186>A166>B136>B195>A195>B154>B138>B112>B173>A117>B159>B182>A181>A140>C145>B117>A152>A193>C197>B130>A172>A113>A151>B115>A143>B140>B185>B103>A121>A180>A130>A171>B199>C196>B146>B180>C115>B174>B121>A188>B196>B189>C152>C109>A155>A114>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<A114<A155<C109<C152<B189<B196<A188<B121<B174<C115<B180<B146<C196<B199<A171<A130<A180<A121<B103<B185<B140<A143<B115<A151<A113<A172<B130<C197<A193<A152<B117<C145<A140<A181<B182<B159<A117<B173<B112<B138<B154<A195<B195<B136<A166<B186<B126<C189<C134<B125<A190<B190<A196<A137<B147<C165<A176<B156<B105<C102<A183<A142<A200<B200<B192<C130<A187<A146<B102<B161<B150<A124<A175<A134<C171<A184<B113<A125<A149<A108<B120<A161<B137<C136<A199<A158<B152<B193<C148<C101<B142<B101<A135<C182<A138<C199<C169<C151<A165<C110<B170<A111<B163<C138<C125<B132<A169<B178<A103<B139<B135<C108<B176<B166<C120<C190<C119<A148<A189<C178<B109<A168<C188<A131<A160<B165<C107<A132<B168<A173<A197<B197<C170<A107<C149<A129<B129<A118<B172<C172<B111<B191<C195<A116<A157<B134<C122<A102<C181<A164<B114<B164<A178<A119<B119<C150<C159<A109<A104<A145<B151<C132<A182<B118<A123<B175<C191<B169<C200<A106<A147<B123<C123<C117<B143<C198<A170<B122<C140<A167<A126<B106<C141<A185<B131<C174<B149<A144<C162<A122<A186<B167<C167<A153<B153<A112<B108<A127<B127<C127<B183<B124<C144<B179<C129<C192<A162<C183<A141<B141<C103<C185<A177<B177<C177<A133<B133<A192<C176<C135<A136<B158<C153<A101<B181<C124<A179<B187<C186<A154<B162<C179<A128<B128<C128<A110<B110<B160<C166<B116<C116<A194<B194<C194<A139<B107<C126<A174<B184<C173<A120<B144<C175<A156<B157<C114<A115<A198<B198<C133<B148<C142<C112<A163<B155<C160<B145<C111<C161<B104<C104<C131<A105<B171<C154<C121<C184<A159<B188<C158<A191<C157<C193<C164<C180<C139<A150<C187<C146<C105<C155<C163<C113<C168<C106<C147<C137<C143<C118<C156<M24X23<M22X11<M20X19<M20X18<M19X15<M18X16<M25X22<M23X21<M23X23<M22X17<M21X23<M19X13<M19X14<M16X23<M24X11<M22X18<M23X12<M26X14<M23X25<M26X25<M24X15<M24X16<M21X22<M22X13<M20X23<M17X21<M27X12<M14X14<M15X16<M12X11<M13X13<M14X18<M13X11<M13X12<M21X25<M19X19<M18X14<M17X11<M16X25<M17X15<M14X19<M13X23<M14X23<M13X22<M14X12<M15X24<M21X14<M20X13<M20X11<M17X20<M15X14<M13X19<M14X24<M14X11<M18X12<M18X13<M16X11<M17X12<M15X13<M13X18<M14X13<M15X19<M19X23<M20X25<M17X13<M16X12<M17X24<M18X19<M15X18<M15X17<M21X13<M18X23<M19X25<M18X17<M20X20<M20X21<M21X16<M21X15<M22X23<M11X11<M12X13<M13X20<M14X22<M13X14<M14X15<M15X12<M15X11<M15X25<M16X15<M14X16<M15X23<M16X24<M12X12<M13X24<M14X21<M16X19<M17X25<M14X20<M15X22<M16X13<M16X14<M15X21<M16X17<M17X19<M18X11<M18X20<M19X22<M15X20<M16X21<M17X18<M17X16<M18X21<M19X18<M19X24<M18X22<M20X15<M21X11<M22X12<M17X17<M16X20<M16X22<M14X25<M16X18<M17X14<M18X15<M19X12<M20X24<M23X24<M23X19<M25X14<M21X21<M22X16<M22X24<M23X20<M19X11<M20X12<M18X24<M19X20<M19X21<M18X25<M19X16<M20X22<M21X12<M21X24<M19X17<M20X17<M21X17<M22X19<M21X18<M22X15<M23X11<M22X14<M21X19<M22X25<M23X16<M24X25<M21X20<M22X22<M23X14<M24X18<M23X13<M24X22<M25X16<M23X15<M25X15<M24X12<M25X11<M24X13<M22X20<M24X24<M23X22<M24X14<M22X21<M23X17<M24X21<M25X19<M24X20<M25X25<M25X24<M25X23<M24X19<M26X15<M25X12<M26X12<M16X16<M17X23<M26X13<M25X13<M23X18<M24X17<M25X20<M26X24<M25X18<M26X19<M27X16<M26X17<M26X18<M27X20<M25X17<M27X24<M28X12<M18X18<M20X16<M20X14<M15X15<M17X22<M25X21<M26X16<M26X20<M26X22<M26X21<M26X23<M26X11<M27X17<M27X19<M27X13<M27X21<M28X24<M27X22<M27X23<M28X25<M28X14<M27X25<M28X23<M27X11<M28X13<M27X15<M28X18<M27X14<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
>> -output(glibc.rtld.dynamic_sort=2):
>> M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18>M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M26X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X17>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17>M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M18X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X16>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22>M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M17X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X12>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146>C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138>C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174>C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130>C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168>C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140>C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188>C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183>C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191>C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120>C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156>C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175>C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137>C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124>C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148>C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119>C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145>C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186>C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101>C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141>C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<B110<C110<A127<B127<C127<A133<B133<C133<A141<B141<C141<A185<B185<C185<A177<B177<C177<A192<B192<C192<A103<B103<C103<A101<B101<C101<A165<B165<C165<A117<B117<C117<A153<B153<C153<A160<B160<C160<A186<B186<C186<A195<B195<C195<A157<B157<C157<A173<B173<C173<A161<B161<C161<A145<B145<C145<A116<B116<C116<A135<B135<C135<A136<B136<C136<A154<B154<C154<A119<B119<C119<A189<B189<C189<A149<B149<C149<A129<B129<C129<A169<B169<C169<A148<B148<C148<A111<B111<C111<A104<B104<C104<A178<B178<C178<A151<B151<C151<A124<B124<C124<A179<B179<C179<A128<B128<C128<A110<B156<C156<A155<B155<C155<A137<B137<C137<A113<B113<C113<A181<B181<C181<A105<B105<C105<A196<B196<C196<A175<B175<C175<A197<B197<C197<A193<B193<C193<A121<B121<C121<A125<B125<C125<A156<B198<C198<A170<B170<C170<A107<B107<C107<A132<B132<C132<A123<B123<C123<A120<B120<C120<A166<B166<C166<A194<B194<C194<A139<B139<C139<A108<B108<C108<A191<B191<C191<A144<B144<C144<A198<B150<C150<A147<B147<C147<A152<B152<C152<A183<B183<C183<A200<B200<C200<A106<B106<C106<A114<B114<C114<A199<B199<C199<A188<B188<C188<A131<B131<C131<A164<B164<C164<A158<B158<C112<A163<B163<C163<A140<B140<C140<A167<B167<C146<A134<B134<C134<A159<B159<C159<A109<B109<C109<A168<B168<C182<A182<B182<C168<A171<B171<C171<A184<B184<C184<A118<B118<C118<A130<B130<C130<A187<B187<C187<A172<B172<C172<A143<B115<C115<A176<B176<C176<A174<B102<C102<A142<B142<C142<A162<B162<C162<A122<B122<C122<A102<B174<C174<A138<B138<C138<A190<B190<C190<A126<B126<C126<A115<B143<C143<A180<B180<C180<A146<B146<C167<A112<B112<C158<A150<M28X12<M18X18<M20X16<M22X24<M24X23<M25X12<M15X15<M17X13<M19X21<M21X19<M23X12<M13X13<M14X18<M15X21<M17X19<M19X12<M21X25<M23X18<M24X17<M25X22<M26X16<M27X12<M17X17<M19X20<M21X23<M23X11<M24X16<M26X12<M16X16<M18X24<M20X22<M21X14<M22X16<M23X23<M24X12<M14X14<M16X17<M18X20<M19X22<M21X15<M22X12<M12X12<M13X22<M13X23<M13X24<M14X19<M14X25<M16X18<M17X15<M18X11<M19X11<M20X11<M21X12<M11X11<M12X11<M13X11<M14X12<M13X12<M14X23<M15X24<M12X13<M13X18<M14X13<M13X19<M14X24<M15X19<M14X11<M13X20<M14X20<M15X20<M14X22<M15X13<M16X20<M15X14<M14X21<M15X16<M16X21<M15X18<M13X14<M14X15<M15X25<M16X15<M15X11<M16X11<M15X12<M16X22<M17X12<M14X16<M15X22<M16X12<M17X22<M16X13<M17X18<M16X14<M17X14<M18X14<M15X23<M16X23<M17X23<M18X25<M19X15<M16X25<M17X16<M18X23<M16X24<M17X21<M15X17<M16X19<M17X24<M18X19<M17X25<M18X15<M19X25<M18X17<M17X11<M18X13<M19X19<M17X20<M18X21<M19X16<M19X17<M20X17<M19X18<M18X22<M19X14<M20X15<M20X12<M22X25<M20X13<M20X14<M18X12<M19X24<M20X21<M21X18<M19X13<M20X18<M21X13<M20X19<M20X20<M21X22<M18X16<M19X23<M20X25<M21X16<M22X23<M21X17<M21X11<M22X13<M22X14<M20X24<M21X20<M21X21<M22X17<M23X20<M22X18<M23X16<M25X11<M22X22<M20X23<M21X24<M22X19<M23X25<M22X20<M23X21<M24X24<M22X21<M23X19<M24X11<M23X22<M24X15<M22X11<M23X14<M24X18<M23X15<M24X13<M23X24<M24X25<M23X17<M24X19<M25X14<M22X15<M23X13<M24X20<M25X24<M25X25<M24X21<M25X20<M25X21<M24X22<M25X15<M25X16<M26X25<M26X11<M25X23<M24X14<M25X19<M26X13<M26X15<M26X20<M25X17<M26X21<M25X18<M26X17<M27X22<M27X23<M26X18<M26X19<M27X16<M28X14<M25X13<M26X22<M27X17<M26X23<M27X13<M27X14<M27X15<M26X24<M27X24<M28X25<M27X11<M28X18<M27X25<M26X14<M27X19<M27X20<M28X13<M27X21<M28X23<M28X24<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
>> +output:
>> M30X19>M30X15>M30X16>M30X11>M30X12>M30X17>M30X13>M30X14>M29X20>M30X23>M30X24>M30X20>M30X18>M29X15>M29X12>M30X22>M30X21>M29X22>M30X25>M29X19>M29X23>M29X16>M29X24>M29X13>M29X17>M29X18>M28X19>M29X21>M29X25>M29X14>M28X20>M28X15>M28X16>M28X21>M27X18>M29X11>M28X17>M28X11>M28X22>M28X24>M28X23>M27X21>M28X13>M27X20>M27X19>M26X14>M27X25>M28X18>M27X11>M28X25>M27X24>M26X24>M27X15>M27X14>M27X13>M26X23>M27X17>M26X22>M25X13>M28X14>M27X16>M26X19>M26X18>M27X23>M27X22>M26X17>M25X18>M26X21>M25X17>M26X20>M26X15>M26X13>M25X19>M24X14>M25X23>M26X11>M26X25>M25X16>M25X15>M24X22>M25X21>M25X20>M24X21>M25X25>M25X24>M24X20>M23X13>M22X15>M25X14>M24X19>M23X17>M24X25>M23X24>M24X13>M23X15>M24X18>M23X14>M22X11>M24X15>M23X22>M24X11>M23X19>M22X21>M24X24>M23X21>M22X20>M23X25>M22X19>M21X24>M20X23>M22X22>M25X11>M23X16>M22X18>M23X20>M22X17>M21X21>M21X20>M20X24>M22X14>M22X13>M21X11>M21X17>M22X23>M21X16>M20X25>M19X23>M18X16>M21X22>M20X20>M20X19>M21X13>M20X18>M19X13>M21X18>M20X21>M19X24>M18X12>M20X14>M20X13>M22X25>M20X12>M20X15>M19X14>M18X22>M19X18>M20X17>M19X17>M19X16>M18X21>M17X20>M19X19>M18X13>M17X11>M18X17>M19X25>M18X15>M17X25>M18X19>M17X24>M16X19>M15X17>M17X21>M16X24>M18X23>M17X16>M16X25>M19X15>M18X25>M17X23>M16X23>M15X23>M18X14>M17X14>M16X14>M17X18>M16X13>M17X22>M16X12>M15X22>M14X16>M17X12>M16X22>M15X12>M16X11>M15X11>M16X15>M15X25>M14X15>M13X14>M15X18>M16X21>M15X16>M14X21>M15X14>M16X20>M15X13>M14X22>M15X20>M14X20>M13X20>M14X11>M15X19>M14X24>M13X19>M14X13>M13X18>M12X13>M15X24>M14X23>M13X12>M14X12>M13X11>M12X11>M11X11>M21X12>M20X11>M19X11>M18X11>M17X15>M16X18>M14X25>M14X19>M13X24>M13X23>M13X22>M12X12>M22X12>M21X15>M19X22>M18X20>M16X17>M14X14>M24X12>M23X23>M22X16>M21X14>M20X22>M18X24>M16X16>M26X12>M24X16>M23X11>M21X23>M19X20>M17X17>M27X12>M26X16>M25X22>M24X17>M23X18>M21X25>M19X12>M17X19>M15X21>M14X18>M13X13>M23X12>M21X19>M19X21>M17X13>M15X15>M25X12>M24X23>M22X24>M20X16>M18X18>M28X12>A150>C158>B112>A112>C167>B146>A146>C180>B180>A180>C143>B143>A115>C126>B126>A126>C190>B190>A190>C138>B138>A138>C174>B174>A102>C122>B122>A122>C162>B162>A162>C142>B142>A142>C102>B102>A174>C176>B176>A176>C115>B115>A143>C172>B172>A172>C187>B187>A187>C130>B130>A130>C118>B118>A118>C184>B184>A184>C171>B171>A171>C168>B182>A182>C182>B168>A168>C109>B109>A109>C159>B159>A159>C134>B134>A134>C146>B167>A167>C140>B140>A140>C163>B163>A163>C112>B158>A158>C164>B164>A164>C131>B131>A131>C188>B188>A188>C199>B199>A199>C114>B114>A114>C106>B106>A106>C200>B200>A200>C183>B183>A183>C152>B152>A152>C147>B147>A147>C150>B150>A198>C144>B144>A144>C191>B191>A191>C108>B108>A108>C139>B139>A139>C194>B194>A194>C166>B166>A166>C120>B120>A120>C123>B123>A123>C132>B132>A132>C107>B107>A107>C170>B170>A170>C198>B198>A156>C125>B125>A125>C121>B121>A121>C193>B193>A193>C197>B197>A197>C175>B175>A175>C196>B196>A196>C105>B105>A105>C181>B181>A181>C113>B113>A113>C137>B137>A137>C155>B155>A155>C156>B156>A110>C128>B128>A128>C179>B179>A179>C124>B124>A124>C151>B151>A151>C178>B178>A178>C104>B104>A104>C111>B111>A111>C148>B148>A148>C169>B169>A169>C129>B129>A129>C149>B149>A149>C189>B189>A189>C119>B119>A119>C154>B154>A154>C136>B136>A136>C135>B135>A135>C116>B116>A116>C145>B145>A145>C161>B161>A161>C173>B173>A173>C157>B157>A157>C195>B195>A195>C186>B186>A186>C160>B160>A160>C153>B153>A153>C117>B117>A117>C165>B165>A165>C101>B101>A101>C103>B103>A103>C192>B192>A192>C177>B177>A177>C185>B185>A185>C141>B141>A141>C133>B133>A133>C127>B127>A127>C110>B110>M14X17>M13X15>M13X16>M13X17>M12X17>M12X21>M12X25>M12X14>M13X25>M12X15>M13X21>M12X16>M12X18>M12X19>M12X20>M12X22>M12X23>M12X24>M11X25>M11X24>M11X23>M11X22>M11X21>M11X20>M11X19>M11X18>M11X17>M11X16>M11X15>M11X14>M11X13>M11X12>{}<M11X12<M11X13<M11X14<M11X15<M11X16<M11X17<M11X18<M11X19<M11X20<M11X21<M11X22<M11X23<M11X24<M11X25<M12X24<M12X23<M12X22<M12X20<M12X19<M12X18<M12X16<M13X21<M12X15<M13X25<M12X14<M12X25<M12X21<M12X17<M13X17<M13X16<M13X15<M14X17<B110<C110<A127<B127<C127<A133<B133<C133<A141<B141<C141<A185<B185<C185<A177<B177<C177<A192<B192<C192<A103<B103<C103<A101<B101<C101<A165<B165<C165<A117<B117<C117<A153<B153<C153<A160<B160<C160<A186<B186<C186<A195<B195<C195<A157<B157<C157<A173<B173<C173<A161<B161<C161<A145<B145<C145<A116<B116<C116<A135<B135<C135<A136<B136<C136<A154<B154<C154<A119<B119<C119<A189<B189<C189<A149<B149<C149<A129<B129<C129<A169<B169<C169<A148<B148<C148<A111<B111<C111<A104<B104<C104<A178<B178<C178<A151<B151<C151<A124<B124<C124<A179<B179<C179<A128<B128<C128<A110<B156<C156<A155<B155<C155<A137<B137<C137<A113<B113<C113<A181<B181<C181<A105<B105<C105<A196<B196<C196<A175<B175<C175<A197<B197<C197<A193<B193<C193<A121<B121<C121<A125<B125<C125<A156<B198<C198<A170<B170<C170<A107<B107<C107<A132<B132<C132<A123<B123<C123<A120<B120<C120<A166<B166<C166<A194<B194<C194<A139<B139<C139<A108<B108<C108<A191<B191<C191<A144<B144<C144<A198<B150<C150<A147<B147<C147<A152<B152<C152<A183<B183<C183<A200<B200<C200<A106<B106<C106<A114<B114<C114<A199<B199<C199<A188<B188<C188<A131<B131<C131<A164<B164<C164<A158<B158<C112<A163<B163<C163<A140<B140<C140<A167<B167<C146<A134<B134<C134<A159<B159<C159<A109<B109<C109<A168<B168<C182<A182<B182<C168<A171<B171<C171<A184<B184<C184<A118<B118<C118<A130<B130<C130<A187<B187<C187<A172<B172<C172<A143<B115<C115<A176<B176<C176<A174<B102<C102<A142<B142<C142<A162<B162<C162<A122<B122<C122<A102<B174<C174<A138<B138<C138<A190<B190<C190<A126<B126<C126<A115<B143<C143<A180<B180<C180<A146<B146<C167<A112<B112<C158<A150<M28X12<M18X18<M20X16<M22X24<M24X23<M25X12<M15X15<M17X13<M19X21<M21X19<M23X12<M13X13<M14X18<M15X21<M17X19<M19X12<M21X25<M23X18<M24X17<M25X22<M26X16<M27X12<M17X17<M19X20<M21X23<M23X11<M24X16<M26X12<M16X16<M18X24<M20X22<M21X14<M22X16<M23X23<M24X12<M14X14<M16X17<M18X20<M19X22<M21X15<M22X12<M12X12<M13X22<M13X23<M13X24<M14X19<M14X25<M16X18<M17X15<M18X11<M19X11<M20X11<M21X12<M11X11<M12X11<M13X11<M14X12<M13X12<M14X23<M15X24<M12X13<M13X18<M14X13<M13X19<M14X24<M15X19<M14X11<M13X20<M14X20<M15X20<M14X22<M15X13<M16X20<M15X14<M14X21<M15X16<M16X21<M15X18<M13X14<M14X15<M15X25<M16X15<M15X11<M16X11<M15X12<M16X22<M17X12<M14X16<M15X22<M16X12<M17X22<M16X13<M17X18<M16X14<M17X14<M18X14<M15X23<M16X23<M17X23<M18X25<M19X15<M16X25<M17X16<M18X23<M16X24<M17X21<M15X17<M16X19<M17X24<M18X19<M17X25<M18X15<M19X25<M18X17<M17X11<M18X13<M19X19<M17X20<M18X21<M19X16<M19X17<M20X17<M19X18<M18X22<M19X14<M20X15<M20X12<M22X25<M20X13<M20X14<M18X12<M19X24<M20X21<M21X18<M19X13<M20X18<M21X13<M20X19<M20X20<M21X22<M18X16<M19X23<M20X25<M21X16<M22X23<M21X17<M21X11<M22X13<M22X14<M20X24<M21X20<M21X21<M22X17<M23X20<M22X18<M23X16<M25X11<M22X22<M20X23<M21X24<M22X19<M23X25<M22X20<M23X21<M24X24<M22X21<M23X19<M24X11<M23X22<M24X15<M22X11<M23X14<M24X18<M23X15<M24X13<M23X24<M24X25<M23X17<M24X19<M25X14<M22X15<M23X13<M24X20<M25X24<M25X25<M24X21<M25X20<M25X21<M24X22<M25X15<M25X16<M26X25<M26X11<M25X23<M24X14<M25X19<M26X13<M26X15<M26X20<M25X17<M26X21<M25X18<M26X17<M27X22<M27X23<M26X18<M26X19<M27X16<M28X14<M25X13<M26X22<M27X17<M26X23<M27X13<M27X14<M27X15<M26X24<M27X24<M28X25<M27X11<M28X18<M27X25<M26X14<M27X19<M27X20<M28X13<M27X21<M28X23<M28X24<M28X22<M28X11<M28X17<M29X11<M27X18<M28X21<M28X16<M28X15<M28X20<M29X14<M29X25<M29X21<M28X19<M29X18<M29X17<M29X13<M29X24<M29X16<M29X23<M29X19<M30X25<M29X22<M30X21<M30X22<M29X12<M29X15<M30X18<M30X20<M30X24<M30X23<M29X20<M30X14<M30X13<M30X17<M30X12<M30X11<M30X16<M30X15<M30X19
>> diff --git a/elf/tst-rtld-list-tunables.exp b/elf/tst-rtld-list-tunables.exp
>> index 2233ea9c7c..f70c16ecb8 100644
>> --- a/elf/tst-rtld-list-tunables.exp
>> +++ b/elf/tst-rtld-list-tunables.exp
>> @@ -11,6 +11,5 @@ glibc.malloc.tcache_max: 0x0 (min: 0x0, max: 0x[f]+)
>>   glibc.malloc.tcache_unsorted_limit: 0x0 (min: 0x0, max: 0x[f]+)
>>   glibc.malloc.top_pad: 0x20000 (min: 0x0, max: 0x[f]+)
>>   glibc.malloc.trim_threshold: 0x0 (min: 0x0, max: 0x[f]+)
>> -glibc.rtld.dynamic_sort: 2 (min: 1, max: 2)
>>   glibc.rtld.nns: 0x4 (min: 0x1, max: 0x10)
>>   glibc.rtld.optional_static_tls: 0x200 (min: 0x0, max: 0x[f]+)
>> diff --git a/manual/tunables.texi b/manual/tunables.texi
>> index 70dd2264c5..ae6959379b 100644
>> --- a/manual/tunables.texi
>> +++ b/manual/tunables.texi
>> @@ -47,7 +47,6 @@ glibc.elision.enable: 0 (min: 0, max: 1)
>>   glibc.malloc.hugetlb: 0x0 (min: 0x0, max: 0xffffffffffffffff)
>>   glibc.cpu.x86_rep_movsb_threshold: 0x2000 (min: 0x100, max: 0xffffffffffffffff)
>>   glibc.malloc.mxfast: 0x0 (min: 0x0, max: 0xffffffffffffffff)
>> -glibc.rtld.dynamic_sort: 2 (min: 1, max: 2)
>>   glibc.elision.skip_lock_busy: 3 (min: 0, max: 2147483647)
>>   glibc.malloc.top_pad: 0x20000 (min: 0x0, max: 0xffffffffffffffff)
>>   glibc.cpu.x86_rep_stosb_threshold: 0x800 (min: 0x1, max: 0xffffffffffffffff)
>> @@ -334,18 +333,6 @@ changed once allocated at process startup.  The default allocation of
>>   optional static TLS is 512 bytes and is allocated in every thread.
>>   @end deftp
>>   -@deftp Tunable glibc.rtld.dynamic_sort
>> -Sets the algorithm to use for DSO sorting, valid values are @samp{1} and
>> -@samp{2}.  For value of @samp{1}, an older O(n^3) algorithm is used, which is
>> -long time tested, but may have performance issues when dependencies between
>> -shared objects contain cycles due to circular dependencies.  When set to the
>> -value of @samp{2}, a different algorithm is used, which implements a
>> -topological sort through depth-first search, and does not exhibit the
>> -performance issues of @samp{1}.
>> -
>> -The default value of this tunable is @samp{2}.
>> -@end deftp
>> -
>>   @node Elision Tunables
>>   @section Elision Tunables
>>   @cindex elision tunables
>> diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
>> index a2115f6edb..cc4e58043f 100644
>> --- a/sysdeps/mach/hurd/dl-sysdep.c
>> +++ b/sysdeps/mach/hurd/dl-sysdep.c
>> @@ -102,9 +102,6 @@ _dl_sysdep_start (void **start_argptr,
>>           __tunables_init (_environ);
>>   -      /* Initialize DSO sorting algorithm after tunables.  */
>> -      _dl_sort_maps_init ();
>> -
>>   #ifdef DL_SYSDEP_INIT
>>         DL_SYSDEP_INIT;
>>   #endif
>> diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
>> index 1b3dd869b5..4eed762754 100644
>> --- a/sysdeps/unix/sysv/linux/dl-sysdep.c
>> +++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
>> @@ -109,9 +109,6 @@ _dl_sysdep_start (void **start_argptr,
>>       __tunables_init (_environ);
>>   -  /* Initialize DSO sorting algorithm after tunables.  */
>> -  _dl_sort_maps_init ();
>> -
>>     __brk (0);            /* Initialize the break.  */
>>     #ifdef DL_PLATFORM_INIT

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] Make tunable a default feature
  2023-03-22 15:21             ` Siddhesh Poyarekar
@ 2023-03-22 17:58               ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-22 17:58 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 22/03/23 12:21, Siddhesh Poyarekar wrote:
> On 2023-03-22 10:40, Adhemerval Zanella Netto wrote:
>>
>>
>> On 20/03/23 20:15, Siddhesh Poyarekar wrote:
>>> On 2023-03-20 12:59, Adhemerval Zanella Netto wrote:
>>>> I think it might make sense for tunables that change the program semantic, such
>>>> as security hardening; although I don't think it really fits for performance
>>>> oriented ones (such malloc or pthread tuning).  So maybe we can define a global
>>>
>>> Administrative level performance tuning defaults for setuid binaries?
>>
>> I was thinking more of opt-in security features (such as mte_state on aarch64),
>> although it might fit better on some ABI extension (such as done by cet).
> 
> Yeah, that too.
> 
>>>> file format where the administrator can set where setuid binaries can use it,
>>>> and if uses can overwrite it.  My initial idea would be something quite simple,
>>>> similar to sysctl.conf:
>>>
>>> Yes, I think Florian suggested reusing ld.so.conf instead.  I don't have a strong preference either way so y'all can fight that one out - potato potato ;)
>>
>> Did he mean add the tunable information on ld.so.conf or using a similar scheme
>> where the file is preprocessed by a tool so loader can just mmap a file without
>> the need any parsing?
>>
>> For later, I don't have a strong opinion.  I assume that a global tunable won't
>> be a default configuration, like loader cache; and parsing should really easy
>> (it a ini like file).
> 
> Just the former IIRC, i.e. extending ld.so.conf to add a section for systemwide tunables.

I am not very found of mixing too different libc facilities in the same config
file and the syntax won't be the same and there are two different

> 
>>>
>>>> And I was thinking about an DF_1_NODEFLIB analogous so the program can opt-out
>>>> any performance or behavior difference any tunable might incur.  Although with
>>>> your idea of enforceable tunable, I think it does not make much sense.
>>>
>>> Yeah an ELF flag to override all tunables seems counter to the whole idea, but ELF flags to override specific tunables may make sense.  E.g. memory tagging enabled by default in the system and a program built with DF_NO_MEMTAG overrides that systemwide setting.
>>
>> The issue of a per-tunable flag is it will require to settle a minimum ABI for
>> tunable, or adding a ELF extension with a string blob that is only understable
>> by an specific glibc version.  I am not sure, maybe we can it only if required.
> 
> We shouldn't need a flag for *every* tunable, only those that would have practical benefit from having ELF overrides, e.g. those that control architecture-specific features.
> 
> That is, the ELF flag should not be tied to a tunable, but a tunable could change behaviour based on an ELF flag.

I think it might be an option if the flag is opaque to ELF itself, like a string
that glibc would parse.  But I don't have a strong preference.

I still think the simplest solution would to have a textual glibc-tunables.conf
similar to sysctl.conf.  

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable
  2023-03-22 17:51     ` Adhemerval Zanella Netto
@ 2023-03-22 18:40       ` Siddhesh Poyarekar
  2023-03-22 18:46         ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-22 18:40 UTC (permalink / raw)
  To: Adhemerval Zanella Netto, libc-alpha, Florian Weimer

On 2023-03-22 13:51, Adhemerval Zanella Netto wrote:
> 
> 
> On 22/03/23 14:08, Siddhesh Poyarekar wrote:
>> On 2023-03-13 15:06, Adhemerval Zanella wrote:
>>> And make the DFS algorithm (added on 2.35) the de-facto implementation.
>>
>> Isn't this orthogonal to the proposal to remove --enable-tunables?
> 
> Yes, the DFS is already the default one.  I meant that now there is no way to
> select the one algorithm.  Maybe use the commit messagE:
> 
>    And make the old sort algorithm no longer available.

OK, I'll stick to reviewing the --enable-tunables patch then, assuming 
that it can go in independently of this one.  I feel much less 
comfortable acking this one since I haven't been closely involved in 
sorting algorithm selection.  I get the sense that maybe it makes sense 
to wait a couple more releases before removing the old sort algorithm 
but that's not based on any specific knowledge, just an instinct.

Thanks,
Sid

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable
  2023-03-22 18:40       ` Siddhesh Poyarekar
@ 2023-03-22 18:46         ` Adhemerval Zanella Netto
  2023-03-22 18:52           ` Siddhesh Poyarekar
  0 siblings, 1 reply; 18+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-22 18:46 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 22/03/23 15:40, Siddhesh Poyarekar wrote:
> On 2023-03-22 13:51, Adhemerval Zanella Netto wrote:
>>
>>
>> On 22/03/23 14:08, Siddhesh Poyarekar wrote:
>>> On 2023-03-13 15:06, Adhemerval Zanella wrote:
>>>> And make the DFS algorithm (added on 2.35) the de-facto implementation.
>>>
>>> Isn't this orthogonal to the proposal to remove --enable-tunables?
>>
>> Yes, the DFS is already the default one.  I meant that now there is no way to
>> select the one algorithm.  Maybe use the commit messagE:
>>
>>    And make the old sort algorithm no longer available.
> 
> OK, I'll stick to reviewing the --enable-tunables patch then, assuming that it can go in independently of this one.  I feel much less comfortable acking this one since I haven't been closely involved in sorting algorithm selection.  I get the sense that maybe it makes sense to wait a couple more releases before removing the old sort algorithm but that's not based on any specific knowledge, just an instinct.

Well, without tunables the old algorithm can not be selected.  So the second
part does depend of this.

The old algorithm was kept mainly to provide some fallback compatibility to
binaries that does not work correctly with newer one; but the default one
is already in 3 release, it is faster, and so far I have not heard of any
drawnback. 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable
  2023-03-22 18:46         ` Adhemerval Zanella Netto
@ 2023-03-22 18:52           ` Siddhesh Poyarekar
  2023-03-22 19:11             ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 18+ messages in thread
From: Siddhesh Poyarekar @ 2023-03-22 18:52 UTC (permalink / raw)
  To: Adhemerval Zanella Netto, libc-alpha, Florian Weimer

On 2023-03-22 14:46, Adhemerval Zanella Netto wrote:
>> OK, I'll stick to reviewing the --enable-tunables patch then, assuming that it can go in independently of this one.  I feel much less comfortable acking this one since I haven't been closely involved in sorting algorithm selection.  I get the sense that maybe it makes sense to wait a couple more releases before removing the old sort algorithm but that's not based on any specific knowledge, just an instinct.
> 
> Well, without tunables the old algorithm can not be selected.  So the second
> part does depend of this.

I don't get it, wouldn't the old algorithm get selected using the 
glibc.rtld.dynamic_sort tunable?  How would the ability to disable 
tunables affect that?

> The old algorithm was kept mainly to provide some fallback compatibility to
> binaries that does not work correctly with newer one; but the default one
> is already in 3 release, it is faster, and so far I have not heard of any
> drawnback.

It may take 2-3 years for some of the slower moving application devs to 
get to use the current glibc, hence my spitball about another year or 
so.  But don't mind my opinion on this, hopefully others can chime in on it.

Thanks,
Sid

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable
  2023-03-22 18:52           ` Siddhesh Poyarekar
@ 2023-03-22 19:11             ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 18+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-22 19:11 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 22/03/23 15:52, Siddhesh Poyarekar wrote:
> On 2023-03-22 14:46, Adhemerval Zanella Netto wrote:
>>> OK, I'll stick to reviewing the --enable-tunables patch then, assuming that it can go in independently of this one.  I feel much less comfortable acking this one since I haven't been closely involved in sorting algorithm selection.  I get the sense that maybe it makes sense to wait a couple more releases before removing the old sort algorithm but that's not based on any specific knowledge, just an instinct.
>>
>> Well, without tunables the old algorithm can not be selected.  So the second
>> part does depend of this.
> 
> I don't get it, wouldn't the old algorithm get selected using the glibc.rtld.dynamic_sort tunable?  How would the ability to disable tunables affect that?
> 

You are right, I got myself confused.


>> The old algorithm was kept mainly to provide some fallback compatibility to
>> binaries that does not work correctly with newer one; but the default one
>> is already in 3 release, it is faster, and so far I have not heard of any
>> drawnback.
> 
> It may take 2-3 years for some of the slower moving application devs to get to use the current glibc, hence my spitball about another year or so.  But don't mind my opinion on this, hopefully others can chime in on it.



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-03-22 19:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 19:06 [PATCH 0/2] Make tunable a default feature Adhemerval Zanella
2023-03-13 19:06 ` [PATCH 1/2] elf: Remove glibc.rtld.dynamic_sort tunable Adhemerval Zanella
2023-03-22 17:08   ` Siddhesh Poyarekar
2023-03-22 17:51     ` Adhemerval Zanella Netto
2023-03-22 18:40       ` Siddhesh Poyarekar
2023-03-22 18:46         ` Adhemerval Zanella Netto
2023-03-22 18:52           ` Siddhesh Poyarekar
2023-03-22 19:11             ` Adhemerval Zanella Netto
2023-03-13 19:06 ` [PATCH 2/2] Remove --enable-tunables configure option Adhemerval Zanella
2023-03-22 16:25   ` Siddhesh Poyarekar
2023-03-14 18:02 ` [PATCH 0/2] Make tunable a default feature Siddhesh Poyarekar
2023-03-15 20:05   ` Adhemerval Zanella Netto
2023-03-17 11:15     ` Siddhesh Poyarekar
2023-03-20 16:59       ` Adhemerval Zanella Netto
2023-03-20 23:15         ` Siddhesh Poyarekar
2023-03-22 14:40           ` Adhemerval Zanella Netto
2023-03-22 15:21             ` Siddhesh Poyarekar
2023-03-22 17:58               ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).