LWN.net Logo

reasons for kmalloc GFP_ATOMIC...

reasons for kmalloc GFP_ATOMIC...

Posted Mar 31, 2008 20:10 UTC (Mon) by hmh (subscriber, #3838)
Parent article: How Do I Make This Hard to Misuse?

AFAIK, kmalloc in fact CANNOT know if it could sleep or not.  As it was explained to me in the
in_atomic() thread on LKML, that information just doesn't exist in the kernel right now.  You
simply have to know in which context you are, and tell everyone about it (thus, GFP_ATOMIC).


(Log in to post comments)

reasons for kmalloc GFP_ATOMIC...

Posted Mar 31, 2008 21:57 UTC (Mon) by jengelh (subscriber, #33263) [Link]

And you might even have a reason to call it with GFP_ATOMIC even if you have a user context
and could, theoretically, sleep!

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds