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/os/ddi_ufm.c
          +++ new/usr/src/uts/common/os/ddi_ufm.c
↓ open down ↓ 173 lines elided ↑ open up ↑
 174  174          }
 175  175  
 176  176          /*
 177  177           * Now that we know how many images we're dealing with, allocate space
 178  178           * for an appropriately-sized array of ddi_ufm_image_t structs and then
 179  179           * iterate through them calling the ddi_ufm_op_fill_image entry point
 180  180           * so that the driver can fill them in.
 181  181           */
 182  182          ufmh->ufmh_images =
 183  183              kmem_zalloc((sizeof (ddi_ufm_image_t) * ufmh->ufmh_nimages),
 184      -            KM_NOSLEEP | KM_NORMALPRI);
      184 +            KM_NOSLEEP_LAZY);
 185  185          if (ufmh->ufmh_images == NULL)
 186  186                  return (ENOMEM);
 187  187  
 188  188          for (uint_t i = 0; i < ufmh->ufmh_nimages; i++) {
 189  189                  struct ddi_ufm_image *img = &ufmh->ufmh_images[i];
 190  190  
 191  191                  ret = ufmh->ufmh_ops->ddi_ufm_op_fill_image(ufmh,
 192  192                      ufmh->ufmh_arg, i, img);
 193  193  
 194  194                  if (ret != 0)
 195  195                          goto cache_fail;
 196  196  
 197  197                  if (img->ufmi_desc == NULL || img->ufmi_nslots == 0) {
 198  198                          ret = EIO;
 199  199                          goto cache_fail;
 200  200                  }
 201  201  
 202  202                  img->ufmi_slots =
 203  203                      kmem_zalloc((sizeof (ddi_ufm_slot_t) * img->ufmi_nslots),
 204      -                    KM_NOSLEEP | KM_NORMALPRI);
      204 +                    KM_NOSLEEP_LAZY);
 205  205                  if (img->ufmi_slots == NULL) {
 206  206                          ret = ENOMEM;
 207  207                          goto cache_fail;
 208  208                  }
 209  209  
 210  210                  for (uint_t s = 0; s < img->ufmi_nslots; s++) {
 211  211                          struct ddi_ufm_slot *slot = &img->ufmi_slots[s];
 212  212  
 213  213                          ret = ufmh->ufmh_ops->ddi_ufm_op_fill_slot(ufmh,
 214  214                              ufmh->ufmh_arg, i, s, slot);
↓ open down ↓ 320 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX