mm_inline.h 878 字节
Newer Older
L
Linus Torvalds 已提交
1 2 3 4
static inline void
add_page_to_active_list(struct zone *zone, struct page *page)
{
	list_add(&page->lru, &zone->active_list);
5
	__inc_zone_state(zone, NR_ACTIVE);
L
Linus Torvalds 已提交
6 7 8 9 10 11
}

static inline void
add_page_to_inactive_list(struct zone *zone, struct page *page)
{
	list_add(&page->lru, &zone->inactive_list);
12
	__inc_zone_state(zone, NR_INACTIVE);
L
Linus Torvalds 已提交
13 14 15 16 17 18
}

static inline void
del_page_from_active_list(struct zone *zone, struct page *page)
{
	list_del(&page->lru);
19
	__dec_zone_state(zone, NR_ACTIVE);
L
Linus Torvalds 已提交
20 21 22 23 24 25
}

static inline void
del_page_from_inactive_list(struct zone *zone, struct page *page)
{
	list_del(&page->lru);
26
	__dec_zone_state(zone, NR_INACTIVE);
L
Linus Torvalds 已提交
27 28 29 30 31 32 33
}

static inline void
del_page_from_lru(struct zone *zone, struct page *page)
{
	list_del(&page->lru);
	if (PageActive(page)) {
N
Nick Piggin 已提交
34
		__ClearPageActive(page);
35
		__dec_zone_state(zone, NR_ACTIVE);
L
Linus Torvalds 已提交
36
	} else {
37
		__dec_zone_state(zone, NR_INACTIVE);
L
Linus Torvalds 已提交
38 39
	}
}
40