Print this page
        
*** 128,137 ****
--- 128,146 ----
  #define TUNE_NVMU       "phys-mcap-no-vmusage"
  #define TUNE_NPAGE      "phys-mcap-no-pageout"
  #define TUNE_NPFTHROT   "phys-mcap-no-pf-throttle"
  
  /*
+  * The large mapping value was derived empirically by seeing that mappings
+  * much bigger than 16mb sometimes take a relatively long time to invalidate
+  * (significant fraction of a second).
+  */
+ #define SEC_INTERIM     4       /* num secs to pause after stopped too long */
+ #define MSEC_TOO_LONG   100     /* release proc. after stopped for 100ms */
+ #define LARGE_MAPPING   16384   /* >= 16MB in KB - pageout in chunks */
+ 
+ /*
   * These are only used in get_mem_info but global. We always need scale_rss and
   * prev_fast_rss to be persistent but we also have the other two global so we
   * can easily see these with mdb.
   */
  uint64_t        scale_rss = 0;
*** 151,162 ****
  static char     over_cmd[2 * BUFSIZ];   /* same size as zone_attr_value */
  static boolean_t skip_vmusage = B_FALSE;
  static boolean_t skip_pageout = B_FALSE;
  static boolean_t skip_pf_throttle = B_FALSE;
  
- static zlog_t   *logp;
- 
  static int64_t check_suspend();
  static void get_mcap_tunables();
  
  /*
   * Structure to hold current state about a process address space that we're
--- 160,169 ----
*** 377,387 ****
  pageout_process(pid_t pid, int64_t excess)
  {
          int                     psfd;
          prmap_t                 *pmap;
          proc_map_t              cur;
-         int                     res;
          int64_t                 sum_d_rss, d_rss;
          int64_t                 old_rss;
          int                     map_cnt;
          psinfo_t                psinfo;
          char                    pathbuf[MAXPATHLEN];
--- 384,393 ----
*** 429,441 ****
           * Within the process's address space, attempt to page out mappings.
           */
          sum_d_rss = 0;
          while (excess > 0 && pmap != NULL && !shutting_down) {
                  /* invalidate the entire mapping */
!                 if ((res = pageout_mapping(pid, pmap)) < 0)
                          debug("pid %ld: mapping 0x%p %ldkb unpageable (%d)\n",
!                             pid, pmap->pr_vaddr, pmap->pr_size / 1024, errno);
  
                  map_cnt++;
  
                  /*
                   * Re-check the process rss and get the delta.
--- 435,448 ----
           * Within the process's address space, attempt to page out mappings.
           */
          sum_d_rss = 0;
          while (excess > 0 && pmap != NULL && !shutting_down) {
                  /* invalidate the entire mapping */
!                 if (pageout_mapping(pid, pmap) < 0)
                          debug("pid %ld: mapping 0x%p %ldkb unpageable (%d)\n",
!                             pid, (void *)pmap->pr_vaddr,
!                             (long)pmap->pr_size / 1024L, errno);
  
                  map_cnt++;
  
                  /*
                   * Re-check the process rss and get the delta.
*** 1145,1155 ****
  {
          int             res;
  
          shutting_down = 0;
          zid = id;
-         logp = zlogp;
  
          /* all but the lx brand currently use /proc */
          if (strcmp(brand_name, "lx") == 0) {
                  (void) snprintf(zoneproc, sizeof (zoneproc),
                      "%s/root/native/proc", zonepath);
--- 1152,1161 ----