Print this page
Revert "OS-8005 bhyve memory pressure needs to target ARC better (#354)"
This reverts commit a6033573eedd94118d2b9e65f45deca0bf4b42f7.
        
*** 36,46 ****
   * A full copy of the text of the CDDL should have accompanied this
   * source.  A copy of the CDDL is also available via the Internet at
   * http://www.illumos.org/license/CDDL.
   *
   * Copyright 2015 Pluribus Networks Inc.
!  * Copyright 2021 Joyent, Inc.
   * Copyright 2021 Oxide Computer Company
   * Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
   */
  
  #include <sys/cdefs.h>
--- 36,46 ----
   * A full copy of the text of the CDDL should have accompanied this
   * source.  A copy of the CDDL is also available via the Internet at
   * http://www.illumos.org/license/CDDL.
   *
   * Copyright 2015 Pluribus Networks Inc.
!  * Copyright 2018 Joyent, Inc.
   * Copyright 2021 Oxide Computer Company
   * Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
   */
  
  #include <sys/cdefs.h>
*** 187,197 ****
          uint16_t        sockets;                /* (o) num of sockets */
          uint16_t        cores;                  /* (o) num of cores/socket */
          uint16_t        threads;                /* (o) num of threads/core */
          uint16_t        maxcpus;                /* (o) max pluggable cpus */
          uint64_t        boot_tsc_offset;        /* (i) TSC offset at VM boot */
-         size_t          arc_resv;               /* # of pages take from ARC */
  
          struct ioport_config ioports;           /* (o) ioport handling */
  };
  
  static int vmm_initialized;
--- 187,196 ----
*** 273,285 ****
  static bool sysmem_mapping(struct vm *vm, struct mem_map *mm);
  static void vcpu_notify_event_locked(struct vcpu *vcpu, vcpu_notify_t);
  static bool vcpu_sleep_bailout_checks(struct vm *vm, int vcpuid);
  static int vcpu_vector_sipi(struct vm *vm, int vcpuid, uint8_t vector);
  
- extern int arc_virt_machine_reserve(size_t);
- extern void arc_virt_machine_release(size_t);
- 
  /* Flags for vtc_status */
  #define VTCS_FPU_RESTORED       1 /* guest FPU restored, host FPU saved */
  #define VTCS_FPU_CTX_CRITICAL   2 /* in ctx where FPU restore cannot be lazy */
  
  typedef struct vm_thread_ctx {
--- 272,281 ----
*** 621,633 ****
                  for (i = 0; i < VM_MAX_MEMSEGS; i++)
                          vm_free_memseg(vm, i);
  
                  VMSPACE_FREE(vm->vmspace);
                  vm->vmspace = NULL;
- 
-                 arc_virt_machine_release(vm->arc_resv);
-                 vm->arc_resv = 0;
          }
  }
  
  void
  vm_destroy(struct vm *vm)
--- 617,626 ----
*** 3661,3680 ****
          vvk->vvk_time_emu_user.value.ui64 = vcpu->ustate_total[VU_EMU_USER];
          vvk->vvk_time_sched.value.ui64 = vcpu->ustate_total[VU_SCHED];
  
          return (0);
  }
- 
- int
- vm_arc_resv(struct vm *vm, uint64_t len)
- {
-         /* Since we already have the compat macros included, we use those */
-         size_t pages = (size_t)roundup2(len, PAGE_SIZE) >> PAGE_SHIFT;
-         int err = 0;
- 
-         err = arc_virt_machine_reserve(pages);
-         if (err != 0)
-                 return (err);
- 
-         vm->arc_resv += pages;
-         return (0);
- }
--- 3654,3658 ----