1. Jun 13, 2024
    • H.J. Lu's avatar
      x86: Properly set x86 minimum ISA level [BZ #31883] · 29807a27
      H.J. Lu authored
      
      
      Properly set libc_cv_have_x86_isa_level in shell for MINIMUM_X86_ISA_LEVEL
      defined as
      
      (__X86_ISA_V1 + __X86_ISA_V2 + __X86_ISA_V3 + __X86_ISA_V4)
      
      Also set __X86_ISA_V2 to 1 for i386 if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
      is defined.  There are no changes in config.h nor in config.make on x86-64.
      On i386, -march=x86-64-v2 with GCC generates
      
       #define MINIMUM_X86_ISA_LEVEL 2
      
      in config.h and
      
      have-x86-isa-level = 2
      
      in config.make.  This fixes BZ #31883.
      
      Signed-off-by: default avatarH.J. Lu <hjl.tools@gmail.com>
      Reviewed-by: default avatarNoah Goldstein <goldstein.w.n@gmail.com>
      29807a27
    • DJ Delorie's avatar
      tunables: sort tunables list (BZ 30027) · 8859607e
      DJ Delorie authored
      Sort tunables list at the time it's generated.  Note: adding new
      tunables will cause other tunable IDs to change, but that was
      the case before anyway.  POSIX does not guarantee the order of "foo
      in bar" AWK operators, so the order was indeterminate before anyway.
      Even depending on the order to be the same across multiple calls,
      such as in this script, is undefined, so sorting the list resolves
      that also.
      
      Note that sorting is not dependent on the user's locale.
      8859607e
    • Adhemerval Zanella's avatar
      linux: Remove __stack_prot · 7edd3814
      Adhemerval Zanella authored
      
      
      The __stack_prot is used by Linux to make the stack executable if
      a modules requires it.  It is also marked as RELRO, which requires
      to change the segment permission to RW to update it.
      
      Also, there is no need to keep track of the flags: either the stack
      will have the default permission of the ABI or should be change to
      PROT_READ | PROT_WRITE | PROT_EXEC.  The only additional flag,
      PROT_GROWSDOWN or PROT_GROWSUP, is Linux only and can be deducted
      from _STACK_GROWS_DOWN/_STACK_GROWS_UP.
      
      Also, the check_consistency function was already removed some time
      ago.
      
      Checked on x86_64-linux-gnu and i686-linux-gnu.
      Reviewed-by: default avatarFlorian Weimer <fweimer@redhat.com>
      7edd3814
  2. Jun 12, 2024
  3. Jun 11, 2024
  4. Jun 07, 2024
  5. Jun 05, 2024
  6. Jun 04, 2024
  7. May 31, 2024
    • Noah Goldstein's avatar
      x86: Add seperate non-temporal tunable for memset · 46b5e98e
      Noah Goldstein authored
      
      
      The tuning for non-temporal stores for memset vs memcpy is not always
      the same. This includes both the exact value and whether non-temporal
      stores are profitable at all for a given arch.
      
      This patch add `x86_memset_non_temporal_threshold`. Currently we
      disable non-temporal stores for non Intel vendors as the only
      benchmarks showing its benefit have been on Intel hardware.
      Reviewed-by: default avatarH.J. Lu <hjl.tools@gmail.com>
      46b5e98e
    • Noah Goldstein's avatar
      x86: Improve large memset perf with non-temporal stores [RHEL-29312] · 5bf0ab80
      Noah Goldstein authored
      Previously we use `rep stosb` for all medium/large memsets. This is
      notably worse than non-temporal stores for large (above a
      few MBs) memsets.
      See:
      https://docs.google.com/spreadsheets/d/1opzukzvum4n6-RUVHTGddV6RjAEil4P2uMjjQGLbLcU/edit?usp=sharing
      
      
      For data using different stategies for large memset on ICX and SKX.
      
      Using non-temporal stores can be up to 3x faster on ICX and 2x faster
      on SKX. Historically, these numbers would not have been so good
      because of the zero-over-zero writeback optimization that `rep stosb`
      is able to do. But, the zero-over-zero writeback optimization has been
      removed as a potential side-channel attack, so there is no longer any
      good reason to only rely on `rep stosb` for large memsets. On the flip
      size, non-temporal writes can avoid data in their RFO requests saving
      memory bandwidth.
      
      All of the other changes to the file are to re-organize the
      code-blocks to maintain "good" alignment given the new code added in
      the `L(stosb_local)` case.
      
      The results from running the GLIBC memset benchmarks on TGL-client for
      N=20 runs:
      
      Geometric Mean across the suite New / Old EXEX256: 0.979
      Geometric Mean across the suite New / Old EXEX512: 0.979
      Geometric Mean across the suite New / Old AVX2   : 0.986
      Geometric Mean across the suite New / Old SSE2   : 0.979
      
      Most of the cases are essentially unchanged, this is mostly to show
      that adding the non-temporal case didn't add any regressions to the
      other cases.
      
      The results on the memset-large benchmark suite on TGL-client for N=20
      runs:
      
      Geometric Mean across the suite New / Old EXEX256: 0.926
      Geometric Mean across the suite New / Old EXEX512: 0.925
      Geometric Mean across the suite New / Old AVX2   : 0.928
      Geometric Mean across the suite New / Old SSE2   : 0.924
      
      So roughly a 7.5% speedup. This is lower than what we see on servers
      (likely because clients typically have faster single-core bandwidth so
      saving bandwidth on RFOs is less impactful), but still advantageous.
      
      Full test-suite passes on x86_64 w/ and w/o multiarch.
      Reviewed-by: default avatarH.J. Lu <hjl.tools@gmail.com>
      5bf0ab80
  8. May 30, 2024
  9. May 28, 2024
  10. May 27, 2024
  11. May 26, 2024
  12. May 25, 2024
  13. May 24, 2024