linux-5.15/rmqueue_bulk()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#l49c0976]
#backlinks
*説明 [#j34cf960]
-パス: [[linux-5.15/mm/page_alloc.c]]
-FIXME: これは何?
--説明
**引数 [#tce46665]
-struct zone *zone
--
--[[linux-5.15/zone]]
-unsigned int order
--
-unsigned long count
--
-struct list_head *list
--
--[[linux-5.15/list_head]]
-int migratetype
--
-unsigned int alloc_flags
--
**返り値 [#y5ae8725]
-int
--
**参考 [#g379cdea]
*実装 [#ed86e9ab]
/*
* Obtain a specified number of elements from the buddy ...
* a single hold of the lock, for efficiency. Add them ...
* Returns the number of new pages which were placed at ...
*/
static int rmqueue_bulk(struct zone *zone, unsigned int ...
unsigned long count, struct list_head *list,
int migratetype, unsigned int alloc_flags)
{
int i, allocated = 0;
/*
* local_lock_irq held so equivalent to spin_lock_irqsa...
* both PREEMPT_RT and non-PREEMPT_RT configurations.
*/
spin_lock(&zone->lock);
-
--[[linux-5.15/spin_lock()]]
for (i = 0; i < count; ++i) {
struct page *page = __rmqueue(zone, order, migratetype,
alloc_flags);
if (unlikely(page == NULL))
break;
if (unlikely(check_pcp_refill(page)))
continue;
-
--[[linux-5.15/page]]
--[[linux-5.15/__rmqueue()]]
--[[linux-5.15/unlikely()]]
--[[linux-5.15/check_pcp_refill()]]
/*
* Split buddy pages returned by expand() are received...
* physical page order. The page is added to the tail of
* caller's list. From the callers perspective, the li...
* is ordered by page number under some conditions. Th...
* useful for IO devices that can forward direction fr...
* head, thus also in the physical page order. This is...
* for IO devices that can merge IO requests if the ph...
* pages are ordered properly.
*/
list_add_tail(&page->lru, list);
allocated++;
if (is_migrate_cma(get_pcppage_migratetype(page)))
__mod_zone_page_state(zone, NR_FREE_CMA_PAGES,
-(1 << order));
}
-
--[[linux-5.15/list_add_tail()]]
--[[linux-5.15/is_migrate_cma()]]
--[[linux-5.15/get_pcppage_migratetype()]]
--[[linux-5.15/__mod_zone_page_state()]]
/*
* i pages were removed from the buddy list even if som...
* to check_pcp_refill failing so adjust NR_FREE_PAGES ...
* on i. Do not confuse with 'allocated' which is the n...
* pages added to the pcp list.
*/
__mod_zone_page_state(zone, NR_FREE_PAGES, -(i << order...
spin_unlock(&zone->lock);
return allocated;
}
-
--[[linux-5.15/__mod_zone_page_state()]]
--[[linux-5.15/spin_unlock()]]
*コメント [#j5d36c0d]
終了行:
*参照元 [#l49c0976]
#backlinks
*説明 [#j34cf960]
-パス: [[linux-5.15/mm/page_alloc.c]]
-FIXME: これは何?
--説明
**引数 [#tce46665]
-struct zone *zone
--
--[[linux-5.15/zone]]
-unsigned int order
--
-unsigned long count
--
-struct list_head *list
--
--[[linux-5.15/list_head]]
-int migratetype
--
-unsigned int alloc_flags
--
**返り値 [#y5ae8725]
-int
--
**参考 [#g379cdea]
*実装 [#ed86e9ab]
/*
* Obtain a specified number of elements from the buddy ...
* a single hold of the lock, for efficiency. Add them ...
* Returns the number of new pages which were placed at ...
*/
static int rmqueue_bulk(struct zone *zone, unsigned int ...
unsigned long count, struct list_head *list,
int migratetype, unsigned int alloc_flags)
{
int i, allocated = 0;
/*
* local_lock_irq held so equivalent to spin_lock_irqsa...
* both PREEMPT_RT and non-PREEMPT_RT configurations.
*/
spin_lock(&zone->lock);
-
--[[linux-5.15/spin_lock()]]
for (i = 0; i < count; ++i) {
struct page *page = __rmqueue(zone, order, migratetype,
alloc_flags);
if (unlikely(page == NULL))
break;
if (unlikely(check_pcp_refill(page)))
continue;
-
--[[linux-5.15/page]]
--[[linux-5.15/__rmqueue()]]
--[[linux-5.15/unlikely()]]
--[[linux-5.15/check_pcp_refill()]]
/*
* Split buddy pages returned by expand() are received...
* physical page order. The page is added to the tail of
* caller's list. From the callers perspective, the li...
* is ordered by page number under some conditions. Th...
* useful for IO devices that can forward direction fr...
* head, thus also in the physical page order. This is...
* for IO devices that can merge IO requests if the ph...
* pages are ordered properly.
*/
list_add_tail(&page->lru, list);
allocated++;
if (is_migrate_cma(get_pcppage_migratetype(page)))
__mod_zone_page_state(zone, NR_FREE_CMA_PAGES,
-(1 << order));
}
-
--[[linux-5.15/list_add_tail()]]
--[[linux-5.15/is_migrate_cma()]]
--[[linux-5.15/get_pcppage_migratetype()]]
--[[linux-5.15/__mod_zone_page_state()]]
/*
* i pages were removed from the buddy list even if som...
* to check_pcp_refill failing so adjust NR_FREE_PAGES ...
* on i. Do not confuse with 'allocated' which is the n...
* pages added to the pcp list.
*/
__mod_zone_page_state(zone, NR_FREE_PAGES, -(i << order...
spin_unlock(&zone->lock);
return allocated;
}
-
--[[linux-5.15/__mod_zone_page_state()]]
--[[linux-5.15/spin_unlock()]]
*コメント [#j5d36c0d]
ページ名: