linux-4.4.1/isolate_migratepages_range()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#sc89772b]
#backlinks
*説明 [#m2d3f889]
-パス: [[linux-4.4.1/mm/compaction.c]]
-FIXME: これは何?
--説明
**引数 [#nb9654e7]
-struct compact_control *cc
--
--[[linux-4.4.1/compact_control]]
-unsigned long start_pfn
--
-unsigned long end_pfn
--
**返り値 [#e79f85d3]
-unsigned long
--
**参考 [#ka8688b1]
*実装 [#t51f01fb]
/**
* isolate_migratepages_range() - isolate migrate-able p...
* @cc: Compaction control structure.
* @start_pfn: The first PFN to start isolating.
* @end_pfn: The one-past-last PFN.
*
* Returns zero if isolation fails fatally due to e.g. p...
* Otherwise, function returns one-past-the-last PFN of ...
* (which may be greater than end_pfn if end fell in a m...
*/
unsigned long
isolate_migratepages_range(struct compact_control *cc, u...
unsigned long end_pfn)
{
unsigned long pfn, block_end_pfn;
/* Scan block by block. First and last block may be inc...
pfn = start_pfn;
block_end_pfn = ALIGN(pfn + 1, pageblock_nr_pages);
-
--[[linux-4.4.1/ALIGN()]]
--[[linux-4.4.1/pageblock_nr_pages(global)]]
for (; pfn < end_pfn; pfn = block_end_pfn,
block_end_pfn += pageblock_nr_pages) {
block_end_pfn = min(block_end_pfn, end_pfn);
if (!pageblock_pfn_to_page(pfn, block_end_pfn, cc->zon...
continue;
-範囲が大きいときは、一度に pageblock_nr_pages ページずつ...
--[[linux-4.4.1/pageblock_pfn_to_page()]]
pfn = isolate_migratepages_block(cc, pfn, block_end_pfn,
ISOLATE_UNEVICTABLE);
-
--[[linux-4.4.1/isolate_migratepages_block()]]
/*
* In case of fatal failure, release everything that m...
* have been isolated in the previous iteration, and s...
* the failure back to caller.
*/
if (!pfn) {
putback_movable_pages(&cc->migratepages);
cc->nr_migratepages = 0;
break;
}
-
--[[linux-4.4.1/putback_movable_pages()]]
if (cc->nr_migratepages == COMPACT_CLUSTER_MAX)
break;
}
acct_isolated(cc->zone, cc);
-
--[[linux-4.4.1/acct_isolated()]]
return pfn;
}
*コメント [#z5929465]
終了行:
*参照元 [#sc89772b]
#backlinks
*説明 [#m2d3f889]
-パス: [[linux-4.4.1/mm/compaction.c]]
-FIXME: これは何?
--説明
**引数 [#nb9654e7]
-struct compact_control *cc
--
--[[linux-4.4.1/compact_control]]
-unsigned long start_pfn
--
-unsigned long end_pfn
--
**返り値 [#e79f85d3]
-unsigned long
--
**参考 [#ka8688b1]
*実装 [#t51f01fb]
/**
* isolate_migratepages_range() - isolate migrate-able p...
* @cc: Compaction control structure.
* @start_pfn: The first PFN to start isolating.
* @end_pfn: The one-past-last PFN.
*
* Returns zero if isolation fails fatally due to e.g. p...
* Otherwise, function returns one-past-the-last PFN of ...
* (which may be greater than end_pfn if end fell in a m...
*/
unsigned long
isolate_migratepages_range(struct compact_control *cc, u...
unsigned long end_pfn)
{
unsigned long pfn, block_end_pfn;
/* Scan block by block. First and last block may be inc...
pfn = start_pfn;
block_end_pfn = ALIGN(pfn + 1, pageblock_nr_pages);
-
--[[linux-4.4.1/ALIGN()]]
--[[linux-4.4.1/pageblock_nr_pages(global)]]
for (; pfn < end_pfn; pfn = block_end_pfn,
block_end_pfn += pageblock_nr_pages) {
block_end_pfn = min(block_end_pfn, end_pfn);
if (!pageblock_pfn_to_page(pfn, block_end_pfn, cc->zon...
continue;
-範囲が大きいときは、一度に pageblock_nr_pages ページずつ...
--[[linux-4.4.1/pageblock_pfn_to_page()]]
pfn = isolate_migratepages_block(cc, pfn, block_end_pfn,
ISOLATE_UNEVICTABLE);
-
--[[linux-4.4.1/isolate_migratepages_block()]]
/*
* In case of fatal failure, release everything that m...
* have been isolated in the previous iteration, and s...
* the failure back to caller.
*/
if (!pfn) {
putback_movable_pages(&cc->migratepages);
cc->nr_migratepages = 0;
break;
}
-
--[[linux-4.4.1/putback_movable_pages()]]
if (cc->nr_migratepages == COMPACT_CLUSTER_MAX)
break;
}
acct_isolated(cc->zone, cc);
-
--[[linux-4.4.1/acct_isolated()]]
return pfn;
}
*コメント [#z5929465]
ページ名: