From: coypu@SDF.ORG
To: kernel-janitors@vger.kernel.org
Subject: Widespread misuse of GFP_ATOMIC
Date: Sun, 10 Apr 2016 23:32:05 +0000 [thread overview]
Message-ID: <20160410233205.GA19912@SDF.ORG> (raw)
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
next reply other threads:[~2016-04-10 23:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-10 23:32 coypu [this message]
2016-04-11 5:27 ` Widespread misuse of GFP_ATOMIC Julia Lawall
2016-04-11 6:07 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160410233205.GA19912@SDF.ORG \
--to=coypu@sdf.org \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.