Print this page
OS-881 To workaround OS-580 add support to only invalidate mappings from a single process

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/rcap/rcapd/rcapd_scanner.c
          +++ new/usr/src/cmd/rcap/rcapd/rcapd_scanner.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2012 Joyent, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  #pragma ident   "%Z%%M% %I%     %E% SMI"
  27   28  
  28   29  #include <sys/mman.h>
  29   30  #include <sys/param.h>
  30   31  #include <sys/stat.h>
  31   32  #include <sys/types.h>
  32   33  #include <assert.h>
  33   34  #include <errno.h>
↓ open down ↓ 510 lines elided ↑ open up ↑
 544  545  static int
 545  546  pageout(pid_t pid, struct ps_prochandle *Pr, caddr_t start, caddr_t end)
 546  547  {
 547  548          int res;
 548  549  
 549  550          if (end <= start)
 550  551                  return (0);
 551  552  
 552  553          errno = 0;
 553  554          res = pr_memcntl(Pr, start, (end - start), MC_SYNC,
 554      -            (caddr_t)(MS_ASYNC | MS_INVALIDATE), 0, 0);
      555 +            (caddr_t)(MS_ASYNC | MS_INVALCURPROC), 0, 0);
 555  556          debug_high("pr_memcntl [%p-%p): %d", (void *)start, (void *)end, res);
 556  557  
 557  558          /*
 558  559           * EBUSY indicates none of the pages have backing store allocated, or
 559  560           * some pages were locked, which are less interesting than other
 560  561           * conditions, which are noted.
 561  562           */
 562  563          if (res != 0)
 563  564                  if (errno == EBUSY)
 564  565                          res = 0;
↓ open down ↓ 506 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX