Print this page
OS-3088 need a lighterweight page invalidation mechanism for zone memcap
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/uts/common/vm/hat.h
          +++ new/usr/src/uts/common/vm/hat.h
↓ 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 2009 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  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   28  /*        All Rights Reserved   */
  28   29  
  29   30  /*
  30   31   * University Copyright- Copyright (c) 1982, 1986, 1988
  31   32   * The Regents of the University of California
  32   33   * All Rights Reserved
  33   34   *
↓ open down ↓ 228 lines elided ↑ open up ↑
 262  263   * void hat_page_clrattr(pp, flag)
 263  264   *      used to set/clr red/mod bits.
 264  265   *
 265  266   * uint hat_page_getattr(pp, flag)
 266  267   *      If flag is specified, returns 0 if attribute is disabled
 267  268   *      and non zero if enabled.  If flag specifes multiple attributs
 268  269   *      then returns 0 if ALL atriibutes are disabled.  This is an advisory
 269  270   *      call.
 270  271   *
 271  272   * int hat_pageunload(pp, forceflag)
 272      - *      unload all translations attached to pp.
      273 + *      Unload all translations attached to pp. On x86 the bulk of the work is
      274 + *      done by hat_page_inval.
 273  275   *
      276 + * void hat_page_inval(pp, pgsz, curhat)
      277 + *      Unload translations attached to pp. If curhat is provided, only the
      278 + *      translation for that process is unloaded, otherwise all are unloaded.
      279 + *
 274  280   * uint_t hat_pagesync(pp, flags)
 275  281   *      get hw stats from hardware into page struct and reset hw stats
 276  282   *      returns attributes of page
 277  283   *
 278  284   * ulong_t hat_page_getshare(pp)
 279  285   *      returns approx number of mappings to this pp.  A return of 0 implies
 280  286   *      there are no mappings to the page.
 281  287   *
 282  288   * faultcode_t hat_softlock(hat, addr, lenp, ppp, flags);
 283  289   *      called to softlock pages for zero copy tcp
 284  290   *
 285  291   * void hat_page_demote(pp);
 286  292   *      unload all large mappings to pp and decrease p_szc of all
 287  293   *      constituent pages according to the remaining mappings.
 288  294   */
 289  295  
 290  296  void    hat_page_setattr(struct page *, uint_t);
 291  297  void    hat_page_clrattr(struct page *, uint_t);
 292  298  uint_t  hat_page_getattr(struct page *, uint_t);
 293  299  int     hat_pageunload(struct page *, uint_t);
      300 +void    hat_page_inval(struct page *, uint_t, struct hat *);
 294  301  uint_t  hat_pagesync(struct page *, uint_t);
 295  302  ulong_t hat_page_getshare(struct page *);
 296  303  int     hat_page_checkshare(struct page *, ulong_t);
 297  304  faultcode_t hat_softlock(struct hat *, caddr_t, size_t *,
 298  305                          struct page **, uint_t);
 299  306  void    hat_page_demote(struct page *);
 300  307  
 301  308  /*
 302  309   * Rountine to expose supported HAT features to PIM.
 303  310   */
↓ open down ↓ 149 lines elided ↑ open up ↑
 453  460  /*
 454  461   * Flags for hat_map
 455  462   */
 456  463  #define HAT_MAP                 0x00
 457  464  
 458  465  /*
 459  466   * Flag for hat_pageunload
 460  467   */
 461  468  #define HAT_ADV_PGUNLOAD        0x00
 462  469  #define HAT_FORCE_PGUNLOAD      0x01
      470 +#define HAT_CURPROC_PGUNLOAD    0x02
 463  471  
 464  472  /*
 465  473   * Attributes for hat_page_*attr, hat_setstats and
 466  474   * returned by hat_pagesync.
 467  475   */
 468  476  #define P_MOD   0x1             /* the modified bit */
 469  477  #define P_REF   0x2             /* the referenced bit */
 470  478  #define P_RO    0x4             /* Read only page */
 471  479  #define P_NSH   0x8             /* Not to shuffle v_pages */
 472  480  
↓ open down ↓ 155 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX