linux-4.4.1/gfpflags_to_migratetype()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#lc32b544]
#backlinks
*説明 [#eecfca4f]
-パス: [[linux-4.4.1/include/linux/gfp.h]]
-FIXME: これは何?
--gfp フラグから、ページマイグレーション属性(MIGRATE_XX...
--求め方は gfp_flags を GFP_MOVABLE_MASK でマスクして GFP...
---GFP_MOVABLE_MASK の値は (__GFP_RECLAIMABLE|__GFP_MOVAB...
---__GFP_MOVABLE は、数値にすると 0x08u
---__GFP_RECLAIMABLE は、数値にすると 0x10u
---GFP_MOVABLE_SHIFT は 3
| GFP_RECLAIMABLE | GFP_MOVABLE | 結果 |
| x | x | 0 = MIGRATE_UNMOVABLE |
| x | o | 1 = MIGRATE_MOVABLE |
| o | x | 2 = MIGRATE_RECLAIMABLE |
| o | o | 3 = MIGRATE_PCPTYPES, M...
-MIGRATE_CMA 以上の値は特殊
**引数 [#nf4ff30f]
-const gfp_t gfp_flags
--
--[[linux-4.4.1/gfp_t]]
**返り値 [#i228b4c9]
-int
--
**参考 [#b5e80a1a]
enum {
MIGRATE_UNMOVABLE,
MIGRATE_MOVABLE,
MIGRATE_RECLAIMABLE,
MIGRATE_PCPTYPES, /* the number of types on the pcp lis...
MIGRATE_HIGHATOMIC = MIGRATE_PCPTYPES,
#ifdef CONFIG_CMA
/*
* MIGRATE_CMA migration type is designed to mimic the ...
* ZONE_MOVABLE works. Only movable pages can be alloc...
* from MIGRATE_CMA pageblocks and page allocator never
* implicitly change migration type of MIGRATE_CMA page...
*
* The way to use it is to change migratetype of a rang...
* pageblocks to MIGRATE_CMA which can be done by
* __free_pageblock_cma() function. What is important ...
* is that a range of pageblocks must be aligned to
* MAX_ORDER_NR_PAGES should biggest page be bigger then
* a single pageblock.
*/
MIGRATE_CMA,
#endif
#ifdef CONFIG_MEMORY_ISOLATION
MIGRATE_ISOLATE, /* can't allocate from here */
#endif
MIGRATE_TYPES
};
#define ___GFP_MOVABLE 0x08u
#define ___GFP_RECLAIMABLE 0x10u
#define ___GFP_HIGH 0x20u
#define ___GFP_IO 0x40u
#define ___GFP_FS 0x80u
-他の値は下記参照。
--[[linux-4.4.1/GFP]]
#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /...
...
#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIM...
*実装 [#w1a5880b]
/* Convert GFP flags to their corresponding migrate type...
#define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE)
#define GFP_MOVABLE_SHIFT 3
static inline int gfpflags_to_migratetype(const gfp_t gf...
{
VM_WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABL...
BUILD_BUG_ON((1UL << GFP_MOVABLE_SHIFT) != ___GFP_MOVAB...
BUILD_BUG_ON((___GFP_MOVABLE >> GFP_MOVABLE_SHIFT) != M...
-
--[[linux-4.4.1/VM_WARN_ON()]]
--[[linux-4.4.1/BUILD_BUG_ON()]]
--[[linux-4.4.1/___GFP_MOVABLE]]
if (unlikely(page_group_by_mobility_disabled))
return MIGRATE_UNMOVABLE;
-
--[[linux-4.4.1/unlikely()]]
--[[linux-4.4.1/page_group_by_mobility_disabled(global)]]
/* Group based on mobility */
return (gfp_flags & GFP_MOVABLE_MASK) >> GFP_MOVABLE_SH...
}
#undef GFP_MOVABLE_MASK
#undef GFP_MOVABLE_SHIFT
*コメント [#o972f373]
終了行:
*参照元 [#lc32b544]
#backlinks
*説明 [#eecfca4f]
-パス: [[linux-4.4.1/include/linux/gfp.h]]
-FIXME: これは何?
--gfp フラグから、ページマイグレーション属性(MIGRATE_XX...
--求め方は gfp_flags を GFP_MOVABLE_MASK でマスクして GFP...
---GFP_MOVABLE_MASK の値は (__GFP_RECLAIMABLE|__GFP_MOVAB...
---__GFP_MOVABLE は、数値にすると 0x08u
---__GFP_RECLAIMABLE は、数値にすると 0x10u
---GFP_MOVABLE_SHIFT は 3
| GFP_RECLAIMABLE | GFP_MOVABLE | 結果 |
| x | x | 0 = MIGRATE_UNMOVABLE |
| x | o | 1 = MIGRATE_MOVABLE |
| o | x | 2 = MIGRATE_RECLAIMABLE |
| o | o | 3 = MIGRATE_PCPTYPES, M...
-MIGRATE_CMA 以上の値は特殊
**引数 [#nf4ff30f]
-const gfp_t gfp_flags
--
--[[linux-4.4.1/gfp_t]]
**返り値 [#i228b4c9]
-int
--
**参考 [#b5e80a1a]
enum {
MIGRATE_UNMOVABLE,
MIGRATE_MOVABLE,
MIGRATE_RECLAIMABLE,
MIGRATE_PCPTYPES, /* the number of types on the pcp lis...
MIGRATE_HIGHATOMIC = MIGRATE_PCPTYPES,
#ifdef CONFIG_CMA
/*
* MIGRATE_CMA migration type is designed to mimic the ...
* ZONE_MOVABLE works. Only movable pages can be alloc...
* from MIGRATE_CMA pageblocks and page allocator never
* implicitly change migration type of MIGRATE_CMA page...
*
* The way to use it is to change migratetype of a rang...
* pageblocks to MIGRATE_CMA which can be done by
* __free_pageblock_cma() function. What is important ...
* is that a range of pageblocks must be aligned to
* MAX_ORDER_NR_PAGES should biggest page be bigger then
* a single pageblock.
*/
MIGRATE_CMA,
#endif
#ifdef CONFIG_MEMORY_ISOLATION
MIGRATE_ISOLATE, /* can't allocate from here */
#endif
MIGRATE_TYPES
};
#define ___GFP_MOVABLE 0x08u
#define ___GFP_RECLAIMABLE 0x10u
#define ___GFP_HIGH 0x20u
#define ___GFP_IO 0x40u
#define ___GFP_FS 0x80u
-他の値は下記参照。
--[[linux-4.4.1/GFP]]
#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /...
...
#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIM...
*実装 [#w1a5880b]
/* Convert GFP flags to their corresponding migrate type...
#define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE)
#define GFP_MOVABLE_SHIFT 3
static inline int gfpflags_to_migratetype(const gfp_t gf...
{
VM_WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABL...
BUILD_BUG_ON((1UL << GFP_MOVABLE_SHIFT) != ___GFP_MOVAB...
BUILD_BUG_ON((___GFP_MOVABLE >> GFP_MOVABLE_SHIFT) != M...
-
--[[linux-4.4.1/VM_WARN_ON()]]
--[[linux-4.4.1/BUILD_BUG_ON()]]
--[[linux-4.4.1/___GFP_MOVABLE]]
if (unlikely(page_group_by_mobility_disabled))
return MIGRATE_UNMOVABLE;
-
--[[linux-4.4.1/unlikely()]]
--[[linux-4.4.1/page_group_by_mobility_disabled(global)]]
/* Group based on mobility */
return (gfp_flags & GFP_MOVABLE_MASK) >> GFP_MOVABLE_SH...
}
#undef GFP_MOVABLE_MASK
#undef GFP_MOVABLE_SHIFT
*コメント [#o972f373]
ページ名: