Print this page
Revert "OS-8005 bhyve memory pressure needs to target ARC better (#354)"
This reverts commit a6033573eedd94118d2b9e65f45deca0bf4b42f7.
        
*** 10,20 ****
   */
  /* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
  
  /*
   * Copyright 2015 Pluribus Networks Inc.
!  * Copyright 2020 Joyent, Inc.
   * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
   * Copyright 2021 Oxide Computer Company
   */
  
  #include <sys/types.h>
--- 10,20 ----
   */
  /* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
  
  /*
   * Copyright 2015 Pluribus Networks Inc.
!  * Copyright 2019 Joyent, Inc.
   * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
   * Copyright 2021 Oxide Computer Company
   */
  
  #include <sys/types.h>
*** 474,484 ****
          case VM_ALLOC_MEMSEG:
          case VM_MMAP_MEMSEG:
          case VM_MUNMAP_MEMSEG:
          case VM_WRLOCK_CYCLE:
          case VM_PMTMR_LOCATE:
-         case VM_ARC_RESV:
                  vmm_write_lock(sc);
                  lock_type = LOCK_WRITE_HOLD;
                  break;
  
          case VM_GET_GPA_PMAP:
--- 474,483 ----
*** 1410,1422 ****
                   * Present a test mechanism to acquire/release the write lock
                   * on the VM without any other effects.
                   */
                  break;
          }
!         case VM_ARC_RESV:
!                 error = vm_arc_resv(sc->vmm_vm, (uint64_t)arg);
!                 break;
          default:
                  error = ENOTTY;
                  break;
          }
  
--- 1409,1419 ----
                   * Present a test mechanism to acquire/release the write lock
                   * on the VM without any other effects.
                   */
                  break;
          }
! 
          default:
                  error = ENOTTY;
                  break;
          }
  
*** 2187,2197 ****
                  r = ENXIO;
                  msg = "Unsupported CPU vendor";
          }
  
          if (r != 0 && arg != (intptr_t)NULL) {
!                 if (copyoutstr(msg, (char *)arg, strlen(msg), NULL) != 0)
                          return (EFAULT);
          }
          return (r);
  }
  
--- 2184,2194 ----
                  r = ENXIO;
                  msg = "Unsupported CPU vendor";
          }
  
          if (r != 0 && arg != (intptr_t)NULL) {
!                 if (copyoutstr(msg, (char *)arg, strlen(msg) + 1, NULL) != 0)
                          return (EFAULT);
          }
          return (r);
  }