linux-4.4.1/rmqueue_bulk()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#r9396f1b]
#backlinks
*説明 [#m3b6c6a3]
-パス: [[linux-4.4.1/mm/page_alloc.c]]
-FIXME: これは何?
--説明
**引数 [#s63d58ab]
-struct zone *zone
--
--[[linux-4.4.1/zone]]
-unsigned int order
--
-unsigned long count
--
-struct list_head *list
--
--[[linux-4.4.1/list_head]]
-int migratetype
--
--[[linux-4.4.1/cold]]
-bool cold
--
**返り値 [#fd50a6cc]
-int
--
**参考 [#g6660778]
*実装 [#zb8d4b8e]
/*
* 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, bool cold)
{
int i;
spin_lock(&zone->lock);
-
--[[linux-4.4.1/spin_lock()]]
for (i = 0; i < count; ++i) {
struct page *page = __rmqueue(zone, order, migratetype...
if (unlikely(page == NULL))
break;
-
--[[linux-4.4.1/page]]
--[[linux-4.4.1/__rmqueue()]]
--[[linux-4.4.1/unlikely()]]
/*
* Split buddy pages returned by expand() are received...
* in physical page order. The page is added to the ca...
* list and the list head then moves forward. From the...
* perspective, the linked list is ordered by page num...
* some conditions. This is useful for IO devices that...
* merge IO requests if the physical pages are ordered
* properly.
*/
if (likely(!cold))
list_add(&page->lru, list);
else
list_add_tail(&page->lru, list);
-
--[[linux-4.4.1/likely()]]
--[[linux-4.4.1/list_add()]]
--[[linux-4.4.1/list_add_tail()]]
list = &page->lru;
if (is_migrate_cma(get_pcppage_migratetype(page)))
__mod_zone_page_state(zone, NR_FREE_CMA_PAGES,
-(1 << order));
-
--[[linux-4.4.1/is_migrate_cma()]]
--[[linux-4.4.1/get_pcppage_migratetype()]]
--[[linux-4.4.1/__mod_zone_page_state()]]
}
__mod_zone_page_state(zone, NR_FREE_PAGES, -(i << order...
spin_unlock(&zone->lock);
-
--[[linux-4.4.1/__mod_zone_page_state()]]
--[[linux-4.4.1/spin_unlock()]]
return i;
}
*コメント [#sb217229]
終了行:
*参照元 [#r9396f1b]
#backlinks
*説明 [#m3b6c6a3]
-パス: [[linux-4.4.1/mm/page_alloc.c]]
-FIXME: これは何?
--説明
**引数 [#s63d58ab]
-struct zone *zone
--
--[[linux-4.4.1/zone]]
-unsigned int order
--
-unsigned long count
--
-struct list_head *list
--
--[[linux-4.4.1/list_head]]
-int migratetype
--
--[[linux-4.4.1/cold]]
-bool cold
--
**返り値 [#fd50a6cc]
-int
--
**参考 [#g6660778]
*実装 [#zb8d4b8e]
/*
* 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, bool cold)
{
int i;
spin_lock(&zone->lock);
-
--[[linux-4.4.1/spin_lock()]]
for (i = 0; i < count; ++i) {
struct page *page = __rmqueue(zone, order, migratetype...
if (unlikely(page == NULL))
break;
-
--[[linux-4.4.1/page]]
--[[linux-4.4.1/__rmqueue()]]
--[[linux-4.4.1/unlikely()]]
/*
* Split buddy pages returned by expand() are received...
* in physical page order. The page is added to the ca...
* list and the list head then moves forward. From the...
* perspective, the linked list is ordered by page num...
* some conditions. This is useful for IO devices that...
* merge IO requests if the physical pages are ordered
* properly.
*/
if (likely(!cold))
list_add(&page->lru, list);
else
list_add_tail(&page->lru, list);
-
--[[linux-4.4.1/likely()]]
--[[linux-4.4.1/list_add()]]
--[[linux-4.4.1/list_add_tail()]]
list = &page->lru;
if (is_migrate_cma(get_pcppage_migratetype(page)))
__mod_zone_page_state(zone, NR_FREE_CMA_PAGES,
-(1 << order));
-
--[[linux-4.4.1/is_migrate_cma()]]
--[[linux-4.4.1/get_pcppage_migratetype()]]
--[[linux-4.4.1/__mod_zone_page_state()]]
}
__mod_zone_page_state(zone, NR_FREE_PAGES, -(i << order...
spin_unlock(&zone->lock);
-
--[[linux-4.4.1/__mod_zone_page_state()]]
--[[linux-4.4.1/spin_unlock()]]
return i;
}
*コメント [#sb217229]
ページ名: