Skip to contentSkip to conversation

SLAB_LEVEL_MASK question

DISCUSSION Manfred Spraul 1 participant 1 message Sep 4, 2003

lore
Share & tools
lore
#0 lore raw

Hi Henry,

Quoted 4 lines

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

Which flags were set? __GFP_WAIT must not be set [i.e. will panic], the other combinations are invalid. The only legal values for the flags variable are 0 or SLAB_ATOMIC [aka GFP_ATOMIC, aka __GFP_HIGH].

Quoted 10 lines

I modified it to:

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

It seems working fine.

Is this good?

No, it's wrong. Your driver will panic once in a while, especially under memory intensive stress tests.

--
Manfred