Print this page
5508 move segvn #defines into seg_vn.c
Reviewed by: Marcel Telka <marcel@telka.sk>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/vm/seg_vn.c
          +++ new/usr/src/uts/common/vm/seg_vn.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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 (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  23   24   */
  24   25  
  25   26  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  26   27  /*        All Rights Reserved   */
  27   28  
  28   29  /*
  29   30   * University Copyright- Copyright (c) 1982, 1986, 1988
  30   31   * The Regents of the University of California
  31   32   * All Rights Reserved
  32   33   *
↓ open down ↓ 33 lines elided ↑ open up ↑
  66   67  #include <vm/seg_vn.h>
  67   68  #include <vm/pvn.h>
  68   69  #include <vm/anon.h>
  69   70  #include <vm/page.h>
  70   71  #include <vm/vpage.h>
  71   72  #include <sys/proc.h>
  72   73  #include <sys/task.h>
  73   74  #include <sys/project.h>
  74   75  #include <sys/zone.h>
  75   76  #include <sys/shm_impl.h>
       77 +
       78 +/*
       79 + * segvn_fault needs a temporary page list array.  To avoid calling kmem all
       80 + * the time, it creates a small (PVN_GETPAGE_NUM entry) array and uses it if
       81 + * it can.  In the rare case when this page list is not large enough, it
       82 + * goes and gets a large enough array from kmem.
       83 + *
       84 + * This small page list array covers either 8 pages or 64kB worth of pages -
       85 + * whichever is smaller.
       86 + */
       87 +#define PVN_MAX_GETPAGE_SZ      0x10000
       88 +#define PVN_MAX_GETPAGE_NUM     0x8
       89 +
       90 +#if PVN_MAX_GETPAGE_SZ > PVN_MAX_GETPAGE_NUM * PAGESIZE
       91 +#define PVN_GETPAGE_SZ  ptob(PVN_MAX_GETPAGE_NUM)
       92 +#define PVN_GETPAGE_NUM PVN_MAX_GETPAGE_NUM
       93 +#else
       94 +#define PVN_GETPAGE_SZ  PVN_MAX_GETPAGE_SZ
       95 +#define PVN_GETPAGE_NUM btop(PVN_MAX_GETPAGE_SZ)
       96 +#endif
       97 +
  76   98  /*
  77   99   * Private seg op routines.
  78  100   */
  79  101  static int      segvn_dup(struct seg *seg, struct seg *newseg);
  80  102  static int      segvn_unmap(struct seg *seg, caddr_t addr, size_t len);
  81  103  static void     segvn_free(struct seg *seg);
  82  104  static faultcode_t segvn_fault(struct hat *hat, struct seg *seg,
  83  105                      caddr_t addr, size_t len, enum fault_type type,
  84  106                      enum seg_rw rw);
  85  107  static faultcode_t segvn_faulta(struct seg *seg, caddr_t addr);
↓ open down ↓ 10047 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX