*参照元 [#ed0f0f92]
#backlinks

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

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


**引数 [#l2468554]
-unsigned long start_pfn
--
-unsigned long end_pfn
--
-unsigned migratetype
--
-bool skip_hwpoisoned_pages
--


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


**参考 [#h3d941d4]


*実装 [#x009d738]
 /*
  * start_isolate_page_range() -- make page-allocation-type of range of pages
  * to be MIGRATE_ISOLATE.
  * @start_pfn: The lower PFN of the range to be isolated.
  * @end_pfn: The upper PFN of the range to be isolated.
  * @migratetype: migrate type to set in error recovery.
  *
  * Making page-allocation-type to be MIGRATE_ISOLATE means free pages in
  * the range will never be allocated. Any free pages and pages freed in the
  * future will not be allocated again.
  *
  * start_pfn/end_pfn must be aligned to pageblock_order.
  * Returns 0 on success and -EBUSY if any part of range cannot be isolated.
  */     
 int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
                              unsigned migratetype, bool skip_hwpoisoned_pages)
 {
         unsigned long pfn;
         unsigned long undo_pfn;
         struct page *page;
 
-
--[[linux-4.4.1/page]]

         BUG_ON((start_pfn) & (pageblock_nr_pages - 1));
         BUG_ON((end_pfn) & (pageblock_nr_pages - 1));
 
-
--[[linux-4.4.1/BUG_ON()]]
--[[linux-4.4.1/pageblock_nr_pages(global)]]

         for (pfn = start_pfn;
              pfn < end_pfn;
              pfn += pageblock_nr_pages) {
                 page = __first_valid_page(pfn, pageblock_nr_pages);
                 if (page &&
                     set_migratetype_isolate(page, skip_hwpoisoned_pages)) {
                         undo_pfn = pfn;
                         goto undo;
                 }
         }
-
--[[linux-4.4.1/__first_valid_page()]]
--[[linux-4.4.1/set_migratetype_isolate()]]

         return 0;
 undo:
         for (pfn = start_pfn;
              pfn < undo_pfn;
              pfn += pageblock_nr_pages)
                 unset_migratetype_isolate(pfn_to_page(pfn), migratetype);
 
-
--[[linux-4.4.1/unset_migratetype_isolate()]]
--[[linux-4.4.1/pfn_to_page()]]

         return -EBUSY;
 }


*コメント [#e9ec0242]

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