Print this page
OS-3088 need a lighterweight page invalidation mechanism for zone memcap

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/syscall/rusagesys.c
          +++ new/usr/src/uts/common/syscall/rusagesys.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 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2014 Joyent, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Implement fast getrusage call
  28   29   */
  29   30  
  30   31  #include <sys/types.h>
  31   32  #include <sys/systm.h>
  32   33  #include <sys/time.h>
  33   34  #include <sys/errno.h>
↓ open down ↓ 216 lines elided ↑ open up ↑
 250  251  
 251  252          case _RUSAGESYS_GETRUSAGE:
 252  253                  return (getrusage(arg1));
 253  254          case _RUSAGESYS_GETRUSAGE_CHLD:
 254  255                  return (getrusage_chld(arg1));
 255  256          case _RUSAGESYS_GETRUSAGE_LWP:
 256  257                  return (getrusage_lwp(arg1));
 257  258          case _RUSAGESYS_GETVMUSAGE:
 258  259                  return (vm_getusage((uint_t)(uintptr_t)arg1, (time_t)arg2,
 259  260                      (vmusage_t *)arg3, (size_t *)arg4, 0));
      261 +        case _RUSAGESYS_INVALMAP:
      262 +                /*
      263 +                 * SPARC sfmmu hat does not support HAT_CURPROC_PGUNLOAD
      264 +                 * handling so callers on SPARC should get simple sync
      265 +                 * handling with invalidation to all processes.
      266 +                 */
      267 +#if defined(__sparc)
      268 +                return (memcntl((caddr_t)arg2, (size_t)arg3, MC_SYNC,
      269 +                    (caddr_t)(MS_ASYNC | MS_INVALIDATE), 0, 0));
      270 +#else
      271 +                return (vm_map_inval((pid_t)(uintptr_t)arg1, (caddr_t)arg2,
      272 +                    (size_t)arg3));
      273 +#endif
 260  274          default:
 261  275                  return (set_errno(EINVAL));
 262  276          }
 263  277  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX