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/fs/zfs/zcp.c
          +++ new/usr/src/uts/common/fs/zfs/zcp.c
↓ open down ↓ 710 lines elided ↑ open up ↑
 711  711   * Shrinking the buffer size never fails.
 712  712   *
 713  713   * The original allocated buffer size is stored as a uint64 at the beginning of
 714  714   * the buffer to avoid actually reallocating when shrinking a buffer, since lua
 715  715   * requires that this operation never fail.
 716  716   */
 717  717  static void *
 718  718  zcp_lua_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
 719  719  {
 720  720          zcp_alloc_arg_t *allocargs = ud;
 721      -        int flags = (allocargs->aa_must_succeed) ?
 722      -            KM_SLEEP : (KM_NOSLEEP | KM_NORMALPRI);
      721 +        int flags = (allocargs->aa_must_succeed) ? KM_SLEEP : KM_NOSLEEP_LAZY;
 723  722  
 724  723          if (nsize == 0) {
 725  724                  if (ptr != NULL) {
 726  725                          int64_t *allocbuf = (int64_t *)ptr - 1;
 727  726                          int64_t allocsize = *allocbuf;
 728  727                          ASSERT3S(allocsize, >, 0);
 729  728                          ASSERT3S(allocargs->aa_alloc_remaining + allocsize, <=,
 730  729                              allocargs->aa_alloc_limit);
 731  730                          allocargs->aa_alloc_remaining += allocsize;
 732  731                          kmem_free(allocbuf, allocsize);
↓ open down ↓ 693 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX