1. Jan 12, 2024
    • Alexandre Ghiti's avatar
      riscv: Add support for BATCHED_UNMAP_TLB_FLUSH · 54d7431a
      Alexandre Ghiti authored
      Allow to defer the flushing of the TLB when unmapping pages, which allows
      to reduce the numbers of IPI and the number of sfence.vma.
      
      The ubenchmarch used in commit 43b3dfdd ("arm64: support
      batched/deferred tlb shootdown during page reclamation/migration") that
      was multithreaded to force the usage of IPI shows good performance
      improvement on all platforms:
      
      * Unmatched: ~34%
      * TH1520   : ~78%
      * Qemu     : ~81%
      
      In addition, perf on qemu reports an important decrease in time spent
      dealing with IPIs:
      
      Before:  68.17%  main     [kernel.kallsyms]            [k] __sbi_rfence_v02_call
      After :   8.64%  main     [kernel.kallsyms]            [k] __sbi_rfence_v02_call
      
      * Benchmark:
      
      int stick_this_thread_to_core(int core_id) {
              int num_cores = sysconf(_SC_NPROCESSORS_ONLN);
              if (core_id < 0 || core_id >= num_cores)
                 return EINVAL;
      
              cpu_set_t cpuset;
              CPU_ZERO(&cpuset);
              CPU_SET(core_id, &cpuset);
      
              pthread_t cur...
      54d7431a
    • Alexandre Ghiti's avatar
      riscv: Use hugepage mappings for vmemmap · ff172d48
      Alexandre Ghiti authored
      
      
      This will allow better TLB utilization and then should be more performant.
      
      Before:
      
      ---[ vmemmap start ]---
      0xffff8d8002000000-0xffff8d8012000000    0x000000046ec00000       256M PTE .   ..     ..   D A G . . W R V
      ---[ vmemmap end ]---
      
      After:
      
      ---[ vmemmap start ]---
      0xffff8d8002000000-0xffff8d8012000000    0x000000046ec00000       256M PMD .   ..     ..   D A G . . W R V
      ---[ vmemmap end ]---
      
      Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
      Link: https://lore.kernel.org/r/20231214132935.212864-1-alexghiti@rivosinc.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      ff172d48
  2. Jan 11, 2024
  3. Jan 10, 2024