GFP_ATOMIC or GFP_KERNEL 区别
来源:互联网 发布:网络任务源码 编辑:程序博客网 时间:2024/06/05 19:58
本文转载至:http://lists.metaprl.org/pipermail/cs134-labs/2002-October/000025.html
The short (or kinda long) answer is this:GFP_ATOMIC means roughly "make the allocation operation atomic". Thismeans that the kernel will try to find the memory using a pile of freememory set aside for urgent allocation. If that pile doesn't haveenough free pages, the operation will fail. This flag is useful forallocation within interrupt handlers.GFP_KERNEL will try a little harder to find memory. There's apossibility that the call to kmalloc() will sleep while the kernel istrying to find memory (thus making it unsuitable for interrupthandlers). It's much more rare for an allocation with GFP_KERNEL tofail than with GFP_ATOMIC.In all cases, kmalloc() should only be used allocating small amounts ofmemory (a few kb). vmalloc() is better for larger amounts.Also note that in lab 1 and lab 2, it would have been arguably better touse GFP_KERNEL instead of GFP_ATOMIC. GFP_ATOMIC should be saved forthose instances in which a sleep would be totally unacceptable.This is a fuzzy issue though...there's no absolute right or wronganswer.
0 0
- GFP_ATOMIC or GFP_KERNEL 区别
- GFP_ATOMIC or GFP_KERNEL?
- GFP_ATOMIC or GFP_KERNEL?
- GFP_ATOMIC & GFP_KERNEL kmalloc& vmalloc
- linux内核Kmalloc - GFP_ATOMIC - GFP_KERNEL - GFP_USER
- GFP_KERNEL or SLAB_KERNEL?
- linux中GFP_KERNEL
- __nonnull or __nullable 区别
- in、or、exists区别
- mysql in 和or区别
- AndAlso,OrElse和And,Or的区别
- AndAlso,OrElse和And,Or的区别
- AndAlso,OrElse和And,Or的区别
- AndAlso,OrElse和And,Or的区别
- AndAlso,OrElse和And,Or的区别
- AndAlso,OrElse和And,Or的区别
- mybatis createcriteria和or的区别
- php中 || 和 or的区别
- 修改值类型的实例方法 mutating
- 垃圾邮件分类(Scala 版本)
- 神经网络学习笔记(三) 梯度下降法
- python3 基于socket的irc机器人
- ArrayAdapter、SimpleAdapter和BaseAdapter
- GFP_ATOMIC or GFP_KERNEL 区别
- JS程序的先后执行顺序
- C语言知识总结
- poj 2034 Anti-prime Sequences
- 《Java多线程编程核心技术》(三)线程通信
- linux添加tomcat到服务中
- XUtils之DButils用法简介,非常容易使用
- plsql编程
- HDU 5900 QSC and Master(区间DP)