*参照元 [#s5b4454d]
#backlinks

*説明 [#v039ae21]
-パス: [[linux-4.4.1/mm/page_alloc.c]]

-FIXME: これは何?
--説明


**引数 [#k6177d80]
-struct compact_control *cc
--
--[[linux-4.4.1/compact_control]]
-unsigned long start
--
-unsigned long end
--


**返り値 [#md2b547e]
-int
--


**参考 [#qb1e03df]


*実装 [#ea95f08b]
 /* [start, end) must belong to a single zone. */
 static int __alloc_contig_migrate_range(struct compact_control *cc,
                                         unsigned long start, unsigned long end)
 {               
         /* This function is based on compact_zone() from compaction.c. */
         unsigned long nr_reclaimed;
         unsigned long pfn = start;
         unsigned int tries = 0;
         int ret = 0;    
 
         migrate_prep();
 
-
--[[linux-4.4.1/migrate_prep()]]

         while (pfn < end || !list_empty(&cc->migratepages)) {
                 if (fatal_signal_pending(current)) {
                         ret = -EINTR;
                         break;
                 }
 
-
--[[linux-4.4.1/list_empty()]]
--[[linux-4.4.1/fatal_signal_pending()]]

                 if (list_empty(&cc->migratepages)) {
                         cc->nr_migratepages = 0;
                         pfn = isolate_migratepages_range(cc, pfn, end);
                         if (!pfn) {
                                 ret = -EINTR;
                                 break;
                         }
                         tries = 0;
                 } else if (++tries == 5) {
                         ret = ret < 0 ? ret : -EBUSY;
                         break;
                 }
 
-
--[[linux-4.4.1/isolate_migratepages_range()]]

                 nr_reclaimed = reclaim_clean_pages_from_list(cc->zone,
                                                         &cc->migratepages);
                 cc->nr_migratepages -= nr_reclaimed;
 
-
--[[linux-4.4.1/reclaim_clean_pages_from_list()]]

                 ret = migrate_pages(&cc->migratepages, alloc_migrate_target,
                                     NULL, 0, cc->mode, MR_CMA);
-
--get_new_page: alloc_migrate_target
--put_new_page: NULL
--[[linux-4.4.1/migrate_pages()]]
--[[linux-4.4.1/alloc_migrate_target()]]

         }
         if (ret < 0) {
                 putback_movable_pages(&cc->migratepages);
-
--[[linux-4.4.1/putback_movable_pages()]]

                 return ret;
         }
         return 0;
 }


*コメント [#m9575f96]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS