Print this page
5513 KM_NORMALPRI should be documented in kmem_alloc(9f) and kmem_cache_create(9f) man pages
14465 Present KM_NOSLEEP_LAZY as documented interface
Change-Id: I002ec28ddf390650f1fcba1ca94f6abfdb241439

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/kmem.h
          +++ new/usr/src/uts/common/sys/kmem.h
↓ open down ↓ 15 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2012 by Delphix. All rights reserved.
  25   25   * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  26      - * Copyright 2018, Joyent, Inc.
       26 + * Copyright 2022 Joyent, Inc.
  27   27   */
  28   28  
  29   29  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  30   30  /*        All Rights Reserved   */
  31   31  
  32   32  #ifndef _SYS_KMEM_H
  33   33  #define _SYS_KMEM_H
  34   34  
  35   35  #include <sys/types.h>
  36   36  #include <sys/vmem.h>
↓ open down ↓ 5 lines elided ↑ open up ↑
  42   42  /*
  43   43   * Kernel memory allocator: DDI interfaces.
  44   44   * See kmem_alloc(9F) for details.
  45   45   */
  46   46  
  47   47  #define KM_SLEEP        0x0000  /* can block for memory; success guaranteed */
  48   48  #define KM_NOSLEEP      0x0001  /* cannot block for memory; may fail */
  49   49  #define KM_PANIC        0x0002  /* if memory cannot be allocated, panic */
  50   50  #define KM_PUSHPAGE     0x0004  /* can block for memory; may use reserve */
  51   51  #define KM_NORMALPRI    0x0008  /* with KM_NOSLEEP, lower priority allocation */
       52 +#define KM_NOSLEEP_LAZY (KM_NOSLEEP | KM_NORMALPRI)  /* Syntactic sugar. */
  52   53  #define KM_VMFLAGS      0x00ff  /* flags that must match VM_* flags */
  53   54  
  54   55  #define KM_FLAGS        0xffff  /* all settable kmem flags */
  55   56  
  56   57  #if defined(_KERNEL) || defined(_FAKE_KERNEL)
  57   58  
  58   59  extern void *kmem_alloc(size_t size, int kmflags);
  59   60  extern void *kmem_zalloc(size_t size, int kmflags);
  60   61  extern void kmem_free(void *buf, size_t size);
  61   62  extern void *kmem_alloc_tryhard(size_t size, size_t *alloc_size, int kmflags);
↓ open down ↓ 81 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX