Skip to contentSkip to conversation

SLAB_LEVEL_MASK question

DISCUSSION Henry Qian 1 participant 1 message Sep 4, 2003

lore
Share & tools
lore

Henry Qian

author
#0 lore raw

I had a kernel panic at:

static int kmem_cache_grow (kmem_cache_t * cachep, int flags)

{
        .....

        /*
         * The test for missing atomic flag is performed here, rather

than
* the more obvious place, simply to reduce the critical path
length
* in kmem_cache_alloc(). If a caller is seriously mis-behaving
they

         * will eventually be caught here (where it matters).
         */
        if (in_interrupt() && (flags & SLAB_LEVEL_MASK) != SLAB_ATOMIC)
                BUG();
        ...
}

The kernel panics because in the flags variable, I have other flags (0x1f0) besides SLAB_ATOMIC.

I modified it to:

        if (in_interrupt() && (flags & SLAB_ATOMIC) != SLAB_ATOMIC)
                BUG();

It seems working fine.

Is this good?

Henry Qian