Print this page
5255 uts shouldn't open-code ISP2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/kmem.c
          +++ new/usr/src/uts/common/os/kmem.c
↓ open down ↓ 3758 lines elided ↑ open up ↑
3759 3759                  align = KMEM_ALIGN;
3760 3760  
3761 3761          /*
3762 3762           * If we're not at least KMEM_ALIGN aligned, we can't use free
3763 3763           * memory to hold bufctl information (because we can't safely
3764 3764           * perform word loads and stores on it).
3765 3765           */
3766 3766          if (align < KMEM_ALIGN)
3767 3767                  cflags |= KMC_NOTOUCH;
3768 3768  
3769      -        if ((align & (align - 1)) != 0 || align > vmp->vm_quantum)
     3769 +        if (!ISP2(align) || align > vmp->vm_quantum)
3770 3770                  panic("kmem_cache_create: bad alignment %lu", align);
3771 3771  
3772 3772          mutex_enter(&kmem_flags_lock);
3773 3773          if (kmem_flags & KMF_RANDOMIZE)
3774 3774                  kmem_flags = (((kmem_flags | ~KMF_RANDOM) + 1) & KMF_RANDOM) |
3775 3775                      KMF_RANDOMIZE;
3776 3776          cp->cache_flags = (kmem_flags | cflags) & KMF_DEBUG;
3777 3777          mutex_exit(&kmem_flags_lock);
3778 3778  
3779 3779          /*
↓ open down ↓ 1808 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX