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/uts/common/sys/buf.h
          +++ new/usr/src/uts/common/sys/buf.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 2008 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  /*      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 ↓ 145 lines elided ↑ open up ↑
 179  180  #define B_INVAL         0x010000        /* destroy page when done */
 180  181  #define B_FORCE         0x020000        /* semi-permanent removal from cache */
 181  182  #define B_NOCACHE       0x080000        /* don't cache block when released */
 182  183  #define B_TRUNC         0x100000        /* truncate page without I/O */
 183  184  #define B_SHADOW        0x200000        /* is b_shadow field valid? */
 184  185  #define B_RETRYWRI      0x400000        /* retry write til works or bfinval */
 185  186  #define B_FAILFAST      0x1000000       /* Fail promptly if device goes away */
 186  187  #define B_STARTED       0x2000000       /* io:::start probe called for buf */
 187  188  #define B_ABRWRITE      0x4000000       /* Application based recovery active */
 188  189  #define B_PAGE_NOWAIT   0x8000000       /* Skip the page if it is locked */
      190 +#define B_INVALCURONLY  0x10000000      /* invalidate only for curproc */
 189  191  
 190  192  /*
 191  193   * There is some confusion over the meaning of B_FREE and B_INVAL and what
 192  194   * the use of one over the other implies.
 193  195   *
 194  196   * In both cases, when we are done with the page (buffer) we want to free
 195  197   * up the page.  In the case of B_FREE, the page will go to the cachelist.
 196  198   * In the case of B_INVAL, the page will be destroyed (hashed out of it's
 197  199   * vnode) and placed on the freelist.  Beyond this, there is no difference
 198  200   * between the sole use of these two flags.  In both cases, IO will be done
 199  201   * if the page is not yet committed to storage.
 200  202   *
      203 + * The B_INVALCURONLY flag modifies the behavior of the B_INVAL flag and is
      204 + * intended to be used in conjunction with B_INVAL.  B_INVALCURONLY has no
      205 + * meaning on its own.  When both B_INVALCURONLY and B_INVAL are set, then
      206 + * the mapping for the page is only invalidated for the current process.
      207 + * In this case, the page is not destroyed unless this was the final mapping.
      208 + *
 201  209   * In order to discard pages without writing them back, (B_INVAL | B_TRUNC)
 202  210   * should be used.
 203  211   *
 204  212   * Use (B_INVAL | B_FORCE) to force the page to be destroyed even if we
 205  213   * could not successfuly write out the page.
 206  214   */
 207  215  
 208  216  /*
 209  217   * Insq/Remq for the buffer hash lists.
 210  218   */
↓ open down ↓ 196 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX