Lines Matching refs:mm
26 struct mm_struct *mm = tb->mm; in flush_tlb_pending() local
33 if (CTX_VALID(mm->context)) { in flush_tlb_pending()
35 global_flush_tlb_page(mm, tb->vaddrs[0]); in flush_tlb_pending()
38 smp_flush_tlb_pending(tb->mm, tb->tlb_nr, in flush_tlb_pending()
41 __flush_tlb_pending(CTX_HWBITS(tb->mm->context), in flush_tlb_pending()
69 static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr, in tlb_batch_add_one() argument
81 if (unlikely(nr != 0 && mm != tb->mm)) { in tlb_batch_add_one()
87 flush_tsb_user_page(mm, vaddr, hugepage_shift); in tlb_batch_add_one()
88 global_flush_tlb_page(mm, vaddr); in tlb_batch_add_one()
93 tb->mm = mm; in tlb_batch_add_one()
112 void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, in tlb_batch_add() argument
136 flush_dcache_page_all(mm, page); in tlb_batch_add()
141 tlb_batch_add_one(mm, vaddr, pte_exec(orig), hugepage_shift); in tlb_batch_add()
145 static void tlb_batch_pmd_scan(struct mm_struct *mm, unsigned long vaddr, in tlb_batch_pmd_scan() argument
157 tlb_batch_add_one(mm, vaddr, exec, PAGE_SHIFT); in tlb_batch_pmd_scan()
166 static void __set_pmd_acct(struct mm_struct *mm, unsigned long addr, in __set_pmd_acct() argument
169 if (mm == &init_mm) in __set_pmd_acct()
183 mm->context.hugetlb_pte_count++; in __set_pmd_acct()
185 mm->context.thp_pte_count++; in __set_pmd_acct()
188 mm->context.hugetlb_pte_count--; in __set_pmd_acct()
190 mm->context.thp_pte_count--; in __set_pmd_acct()
209 tlb_batch_add_one(mm, addr, exec, REAL_HPAGE_SHIFT); in __set_pmd_acct()
210 tlb_batch_add_one(mm, addr + REAL_HPAGE_SIZE, exec, in __set_pmd_acct()
213 tlb_batch_pmd_scan(mm, addr, orig); in __set_pmd_acct()
218 void set_pmd_at(struct mm_struct *mm, unsigned long addr, in set_pmd_at() argument
224 __set_pmd_acct(mm, addr, orig, pmd); in set_pmd_at()
264 void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, in pgtable_trans_huge_deposit() argument
269 assert_spin_locked(&mm->page_table_lock); in pgtable_trans_huge_deposit()
272 if (!pmd_huge_pte(mm, pmdp)) in pgtable_trans_huge_deposit()
275 list_add(lh, (struct list_head *) pmd_huge_pte(mm, pmdp)); in pgtable_trans_huge_deposit()
276 pmd_huge_pte(mm, pmdp) = pgtable; in pgtable_trans_huge_deposit()
279 pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) in pgtable_trans_huge_withdraw() argument
284 assert_spin_locked(&mm->page_table_lock); in pgtable_trans_huge_withdraw()
287 pgtable = pmd_huge_pte(mm, pmdp); in pgtable_trans_huge_withdraw()
290 pmd_huge_pte(mm, pmdp) = NULL; in pgtable_trans_huge_withdraw()
292 pmd_huge_pte(mm, pmdp) = (pgtable_t) lh->next; in pgtable_trans_huge_withdraw()