Widespread misuse of GFP_ATOMIC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello linux janitors,

from kmalloc man page:

GFP_ATOMIC - Allocation will not sleep. May use emergency pools. For
example, use this inside interrupt handlers.
GFP_NOWAIT - Allocation will not sleep.

grepping linux kernel tree:

[0:/usr/linux-src> ]$ grep -R GFP_ATOMIC . |wc -l
4452
[0:/usr/linux-src> ]$ grep -R GFP_NOWAIT . |wc -l
220

(alternative flags and some accounting:
total k.*alloc calls:   34320
GFP_KERNEL appearances: 23819
GDP_ATOMIC appearances: 4452
GFP_NOWAIT appearances: 220

unaccounted: 5829)

GFP_ATOMIC is meant for interrupt handlers and emergency pool.
Widespread misuse renders the emergency pool useless.

I believe the vast majority of such uses can be converted to GFP_NOWAIT.
Even valid uses of GFP_ATOMIC are likely rendered useless by this
widespread misuse.

You may wish to replace such calls.

Cheers, coypu
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux