Print this page
9525 kmem_dump_size is a corrupting influence

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/kmem_impl.h
          +++ new/usr/src/uts/common/sys/kmem_impl.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  /*
  23   23   * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2018 Joyent, Inc.
  24   25   */
  25   26  
  26   27  #ifndef _SYS_KMEM_IMPL_H
  27   28  #define _SYS_KMEM_IMPL_H
  28   29  
  29   30  #include <sys/kmem.h>
  30   31  #include <sys/vmem.h>
  31   32  #include <sys/thread.h>
  32   33  #include <sys/t_lock.h>
  33   34  #include <sys/time.h>
↓ open down ↓ 287 lines elided ↑ open up ↑
 321  322          size_t          kmd_tries;              /* nth scan interval counter */
 322  323          /*
 323  324           * Fields used to ASSERT that the client does not kmem_cache_free()
 324  325           * objects passed to the move callback.
 325  326           */
 326  327          void            *kmd_from_buf;          /* object to move */
 327  328          void            *kmd_to_buf;            /* move destination */
 328  329          kthread_t       *kmd_thread;            /* thread calling move */
 329  330  } kmem_defrag_t;
 330  331  
      332 +typedef struct kmem_dump {
      333 +        void            *kd_freelist;           /* heap during crash dump */
      334 +        uint_t          kd_alloc_fails;         /* # of allocation failures */
      335 +        uint_t          kd_unsafe;              /* cache was used, but unsafe */
      336 +} kmem_dump_t;
      337 +
 331  338  #define KMEM_CACHE_NAMELEN      31
 332  339  
 333  340  struct kmem_cache {
 334  341          /*
 335  342           * Statistics
 336  343           */
 337  344          uint64_t        cache_slab_create;      /* slab creates */
 338  345          uint64_t        cache_slab_destroy;     /* slab destroys */
 339  346          uint64_t        cache_slab_alloc;       /* slab layer allocations */
 340  347          uint64_t        cache_slab_free;        /* slab layer frees */
↓ open down ↓ 50 lines elided ↑ open up ↑
 391  398          kmem_bufctl_t   **cache_hash_table;     /* hash table base */
 392  399          kmem_defrag_t   *cache_defrag;          /* slab consolidator fields */
 393  400  
 394  401          /*
 395  402           * Depot layer
 396  403           */
 397  404          kmutex_t        cache_depot_lock;       /* protects depot */
 398  405          kmem_magtype_t  *cache_magtype;         /* magazine type */
 399  406          kmem_maglist_t  cache_full;             /* full magazines */
 400  407          kmem_maglist_t  cache_empty;            /* empty magazines */
 401      -        void            *cache_dumpfreelist;    /* heap during crash dump */
 402      -        void            *cache_dumplog;         /* log entry during dump */
      408 +        kmem_dump_t     cache_dump;             /* used during crash dump */
 403  409  
 404  410          /*
 405  411           * Per-CPU layer
 406  412           */
 407  413          kmem_cpu_cache_t cache_cpu[1];          /* max_ncpus actual elements */
 408  414  };
 409  415  
 410  416  typedef struct kmem_cpu_log_header {
 411  417          kmutex_t        clh_lock;
 412  418          char            *clh_current;
↓ open down ↓ 44 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX