GFP_ATOMIC or GFP_KERNEL?
来源:互联网 发布:python xml解析 编辑:程序博客网 时间:2024/05/20 00:13
本文转载至: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
- linux内核Kmalloc分配内存需要注意的问题(GFP_KERNEL可能会造成内核调度错误)
- linux内核Kmalloc分配内存需要注意的问题(GFP_KERNEL可能会造成内核调度错误)
- linux内核Kmalloc分配内存需要注意的问题(GFP_KERNEL可能会造成内核调度错误)
- linux内核Kmalloc分配内存需要注意的问题(GFP_KERNEL可能会造成内核调度错误)
- linux内核Kmalloc分配内存需要注意的问题(GFP_KERNEL可能会造成内核调度错误)
- 'or'='or'
- 'or'='or'
- Hibernate or JPA or JDBC or?
- WHERE.....OR(........)
- OR Mapping
- OR Mapping
- linux文件权限
- 输入一个int型的正整数,计算出该int型数据在内存中存储时1的个数。
- 【jzoj5220】【GDOI2018模拟7.10】【C】【动态规划】
- redisson使用第一次碰到的坑
- BZOJ 1060: [ZJOI2007]时态同步
- GFP_ATOMIC or GFP_KERNEL?
- Python 基础与笔记(1)
- 访问Oracle数据库的四款工具软件介绍
- 【简记】Java Web 内幕——AOP源码
- MATLAB实现PFFM算法
- Vim技能修炼教程(7)
- [bzoj3698]XWW的难题 有源汇的上下界最大流
- 【bzoj1731】[Usaco2005 dec]Layout 排队布局
- 解决SurfaceView调用setZOrderOnTop(true)遮挡其他控件的问题