mm_inline.h 878 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. static inline void
  2. add_page_to_active_list(struct zone *zone, struct page *page)
  3. {
  4. list_add(&page->lru, &zone->active_list);
  5. __inc_zone_state(zone, NR_ACTIVE);
  6. }
  7. static inline void
  8. add_page_to_inactive_list(struct zone *zone, struct page *page)
  9. {
  10. list_add(&page->lru, &zone->inactive_list);
  11. __inc_zone_state(zone, NR_INACTIVE);
  12. }
  13. static inline void
  14. del_page_from_active_list(struct zone *zone, struct page *page)
  15. {
  16. list_del(&page->lru);
  17. __dec_zone_state(zone, NR_ACTIVE);
  18. }
  19. static inline void
  20. del_page_from_inactive_list(struct zone *zone, struct page *page)
  21. {
  22. list_del(&page->lru);
  23. __dec_zone_state(zone, NR_INACTIVE);
  24. }
  25. static inline void
  26. del_page_from_lru(struct zone *zone, struct page *page)
  27. {
  28. list_del(&page->lru);
  29. if (PageActive(page)) {
  30. __ClearPageActive(page);
  31. __dec_zone_state(zone, NR_ACTIVE);
  32. } else {
  33. __dec_zone_state(zone, NR_INACTIVE);
  34. }
  35. }