Lines Matching refs:mm_slot

85 struct mm_slot {  struct
101 struct mm_slot *mm_slot; member
348 sizeof(struct mm_slot), in khugepaged_init()
349 __alignof__(struct mm_slot), 0, NULL); in khugepaged_init()
365 static inline struct mm_slot *alloc_mm_slot(void) in alloc_mm_slot()
372 static inline void free_mm_slot(struct mm_slot *mm_slot) in free_mm_slot() argument
374 kmem_cache_free(mm_slot_cache, mm_slot); in free_mm_slot()
377 static struct mm_slot *get_mm_slot(struct mm_struct *mm) in get_mm_slot()
379 struct mm_slot *mm_slot; in get_mm_slot() local
381 hash_for_each_possible(mm_slots_hash, mm_slot, hash, (unsigned long)mm) in get_mm_slot()
382 if (mm == mm_slot->mm) in get_mm_slot()
383 return mm_slot; in get_mm_slot()
389 struct mm_slot *mm_slot) in insert_to_mm_slots_hash() argument
391 mm_slot->mm = mm; in insert_to_mm_slots_hash()
392 hash_add(mm_slots_hash, &mm_slot->hash, (long)mm); in insert_to_mm_slots_hash()
422 struct mm_slot *mm_slot; in __khugepaged_enter() local
425 mm_slot = alloc_mm_slot(); in __khugepaged_enter()
426 if (!mm_slot) in __khugepaged_enter()
432 free_mm_slot(mm_slot); in __khugepaged_enter()
437 insert_to_mm_slots_hash(mm, mm_slot); in __khugepaged_enter()
443 list_add_tail(&mm_slot->mm_node, &khugepaged_scan.mm_head); in __khugepaged_enter()
474 struct mm_slot *mm_slot; in __khugepaged_exit() local
478 mm_slot = get_mm_slot(mm); in __khugepaged_exit()
479 if (mm_slot && khugepaged_scan.mm_slot != mm_slot) { in __khugepaged_exit()
480 hash_del(&mm_slot->hash); in __khugepaged_exit()
481 list_del(&mm_slot->mm_node); in __khugepaged_exit()
488 free_mm_slot(mm_slot); in __khugepaged_exit()
490 } else if (mm_slot) { in __khugepaged_exit()
1224 static void collect_mm_slot(struct mm_slot *mm_slot) in collect_mm_slot() argument
1226 struct mm_struct *mm = mm_slot->mm; in collect_mm_slot()
1232 hash_del(&mm_slot->hash); in collect_mm_slot()
1233 list_del(&mm_slot->mm_node); in collect_mm_slot()
1242 free_mm_slot(mm_slot); in collect_mm_slot()
1662 struct mm_slot *mm_slot; in khugepaged_scan_mm_slot() local
1670 if (khugepaged_scan.mm_slot) in khugepaged_scan_mm_slot()
1671 mm_slot = khugepaged_scan.mm_slot; in khugepaged_scan_mm_slot()
1673 mm_slot = list_entry(khugepaged_scan.mm_head.next, in khugepaged_scan_mm_slot()
1674 struct mm_slot, mm_node); in khugepaged_scan_mm_slot()
1676 khugepaged_scan.mm_slot = mm_slot; in khugepaged_scan_mm_slot()
1680 mm = mm_slot->mm; in khugepaged_scan_mm_slot()
1756 VM_BUG_ON(khugepaged_scan.mm_slot != mm_slot); in khugepaged_scan_mm_slot()
1767 if (mm_slot->mm_node.next != &khugepaged_scan.mm_head) { in khugepaged_scan_mm_slot()
1768 khugepaged_scan.mm_slot = list_entry( in khugepaged_scan_mm_slot()
1769 mm_slot->mm_node.next, in khugepaged_scan_mm_slot()
1770 struct mm_slot, mm_node); in khugepaged_scan_mm_slot()
1773 khugepaged_scan.mm_slot = NULL; in khugepaged_scan_mm_slot()
1777 collect_mm_slot(mm_slot); in khugepaged_scan_mm_slot()
1814 if (!khugepaged_scan.mm_slot) in khugepaged_do_scan()
1857 struct mm_slot *mm_slot; in khugepaged() local
1868 mm_slot = khugepaged_scan.mm_slot; in khugepaged()
1869 khugepaged_scan.mm_slot = NULL; in khugepaged()
1870 if (mm_slot) in khugepaged()
1871 collect_mm_slot(mm_slot); in khugepaged()