Print this page
12045 segkmem_page_create(): Fire Walk With Me

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/vm/seg_kmem.c
          +++ new/usr/src/uts/common/vm/seg_kmem.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) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - * Copyright 2016 Joyent, Inc.
       23 + * Copyright 2019 Joyent, Inc.
  24   24   */
  25   25  
  26   26  #include <sys/types.h>
  27   27  #include <sys/t_lock.h>
  28   28  #include <sys/param.h>
  29   29  #include <sys/sysmacros.h>
  30   30  #include <sys/tuneable.h>
  31   31  #include <sys/systm.h>
  32   32  #include <sys/vm.h>
  33   33  #include <sys/kmem.h>
↓ open down ↓ 784 lines elided ↑ open up ↑
 818  818          seg->s_ops = &segkmem_ops;
 819  819          seg->s_data = &kvp;
 820  820          kas.a_size += seg->s_size;
 821  821          return (0);
 822  822  }
 823  823  
 824  824  /*ARGSUSED*/
 825  825  page_t *
 826  826  segkmem_page_create(void *addr, size_t size, int vmflag, void *arg)
 827  827  {
 828      -        struct seg kseg;
 829      -        int pgflags;
      828 +        struct seg kseg = { 0 };
      829 +        int pgflags = PG_EXCL;
 830  830          struct vnode *vp = arg;
 831  831  
 832  832          if (vp == NULL)
 833  833                  vp = &kvp;
 834  834  
 835  835          kseg.s_as = &kas;
 836      -        pgflags = PG_EXCL;
 837  836  
 838  837          if (segkmem_reloc == 0 || (vmflag & VM_NORELOC))
 839  838                  pgflags |= PG_NORELOC;
 840  839          if ((vmflag & VM_NOSLEEP) == 0)
 841  840                  pgflags |= PG_WAIT;
 842  841          if (vmflag & VM_PANIC)
 843  842                  pgflags |= PG_PANIC;
 844  843          if (vmflag & VM_PUSHPAGE)
 845  844                  pgflags |= PG_PUSHPAGE;
 846  845          if (vmflag & VM_NORMALPRI) {
↓ open down ↓ 799 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX