| /linux/include/linux/ |
| H A D | mmap_lock.h | 15 #include <linux/sched/mm.h> 26 void __mmap_lock_do_trace_start_locking(struct mm_struct *mm, bool write); 27 void __mmap_lock_do_trace_acquire_returned(struct mm_struct *mm, bool write, 29 void __mmap_lock_do_trace_released(struct mm_struct *mm, bool write); 31 static inline void __mmap_lock_trace_start_locking(struct mm_struct *mm, in __mmap_lock_trace_start_locking() argument 35 __mmap_lock_do_trace_start_locking(mm, write); in __mmap_lock_trace_start_locking() 38 static inline void __mmap_lock_trace_acquire_returned(struct mm_struct *mm, in __mmap_lock_trace_acquire_returned() argument 42 __mmap_lock_do_trace_acquire_returned(mm, write, success); in __mmap_lock_trace_acquire_returned() 45 static inline void __mmap_lock_trace_released(struct mm_struct *mm, bool write) in __mmap_lock_trace_released() argument 48 __mmap_lock_do_trace_released(mm, write); in __mmap_lock_trace_released() [all …]
|
| H A D | ksm.h | 12 #include <linux/mm.h> 20 vm_flags_t ksm_vma_flags(struct mm_struct *mm, const struct file *file, 22 int ksm_enable_merge_any(struct mm_struct *mm); 23 int ksm_disable_merge_any(struct mm_struct *mm); 24 int ksm_disable(struct mm_struct *mm); 26 int __ksm_enter(struct mm_struct *mm); 27 void __ksm_exit(struct mm_struct *mm); 37 static inline void ksm_map_zero_page(struct mm_struct *mm) in ksm_map_zero_page() argument 40 atomic_long_inc(&mm->ksm_zero_pages); in ksm_map_zero_page() 43 static inline void ksm_might_unmap_zero_page(struct mm_struct *mm, pte_t pte) in ksm_might_unmap_zero_page() argument [all …]
|
| /linux/arch/s390/include/asm/ |
| H A D | pgalloc.h | 18 #include <linux/mm.h> 30 struct ptdesc *page_table_alloc_pgste_noprof(struct mm_struct *mm); 39 int crst_table_upgrade(struct mm_struct *mm, unsigned long limit); 41 static inline unsigned long check_asce_limit(struct mm_struct *mm, unsigned long addr, in check_asce_limit() argument 46 if (addr + len > mm->context.asce_limit && in check_asce_limit() 48 rc = crst_table_upgrade(mm, addr + len); in check_asce_limit() 55 static inline p4d_t *p4d_alloc_one_noprof(struct mm_struct *mm, unsigned long address) in p4d_alloc_one_noprof() argument 57 unsigned long *table = crst_table_alloc_noprof(mm); in p4d_alloc_one_noprof() 68 static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) in p4d_free() argument 70 if (mm_p4d_folded(mm)) in p4d_free() [all …]
|
| /linux/arch/powerpc/include/asm/ |
| H A D | mmu_context.h | 7 #include <linux/mm.h> 18 extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 20 extern void destroy_context(struct mm_struct *mm); 24 extern bool mm_iommu_preregistered(struct mm_struct *mm); 25 extern long mm_iommu_new(struct mm_struct *mm, 28 extern long mm_iommu_newdev(struct mm_struct *mm, unsigned long ua, 31 extern long mm_iommu_put(struct mm_struct *mm, 33 extern void mm_iommu_init(struct mm_struct *mm); 34 extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup(struct mm_struct *mm, 36 extern struct mm_iommu_table_group_mem_t *mm_iommu_get(struct mm_struct *mm, [all …]
|
| /linux/arch/s390/mm/ |
| H A D | pgtable.c | 13 #include <linux/mm.h> 40 static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr, in ptep_ipte_local() argument 47 asce = READ_ONCE(mm->context.gmap_asce); in ptep_ipte_local() 51 asce = asce ? : mm->context.asce; in ptep_ipte_local() 60 static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr, in ptep_ipte_global() argument 67 asce = READ_ONCE(mm->context.gmap_asce); in ptep_ipte_global() 71 asce = asce ? : mm->context.asce; in ptep_ipte_global() 80 static inline pte_t ptep_flush_direct(struct mm_struct *mm, in ptep_flush_direct() argument 89 atomic_inc(&mm->context.flush_count); in ptep_flush_direct() 91 cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id()))) in ptep_flush_direct() [all …]
|
| H A D | gmap_helpers.c | 11 #include <linux/mm.h> 22 * @mm: the mm 29 static void ptep_zap_softleaf_entry(struct mm_struct *mm, softleaf_t entry) in ptep_zap_softleaf_entry() argument 32 dec_mm_counter(mm, MM_SWAPENTS); in ptep_zap_softleaf_entry() 34 dec_mm_counter(mm, mm_counter(softleaf_to_folio(entry))); in ptep_zap_softleaf_entry() 40 * @mm: the mm 47 void gmap_helper_zap_one_page(struct mm_struct *mm, unsigned long vmaddr) in gmap_helper_zap_one_page() argument 55 mmap_assert_locked(mm); in gmap_helper_zap_one_page() 58 vma = vma_lookup(mm, vmaddr); in gmap_helper_zap_one_page() 63 ptep = get_locked_pte(mm, vmaddr, &ptl); in gmap_helper_zap_one_page() [all …]
|
| /linux/include/trace/events/ |
| H A D | ksm.h | 71 * @mm: address of the mm object of the process 77 TP_PROTO(void *mm), 79 TP_ARGS(mm), 82 __field(void *, mm) 86 __entry->mm = mm; 89 TP_printk("mm %p", __entry->mm) 95 * @mm: address of the mm object of the process 101 TP_PROTO(void *mm), 103 TP_ARGS(mm) 109 * @mm: address of the mm object of the process [all …]
|
| H A D | huge_memory.h | 56 TP_PROTO(struct mm_struct *mm, struct folio *folio, 59 TP_ARGS(mm, folio, referenced, none_or_zero, status, unmapped), 62 __field(struct mm_struct *, mm) 71 __entry->mm = mm; 79 TP_printk("mm=%p, scan_pfn=0x%lx, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d", 80 __entry->mm, 90 TP_PROTO(struct mm_struct *mm, int isolated, int status), 92 TP_ARGS(mm, isolated, status), 95 __field(struct mm_struct *, mm) 101 __entry->mm = mm; [all …]
|
| /linux/arch/m68k/include/asm/ |
| H A D | mmu_context.h | 28 static inline void get_mmu_context(struct mm_struct *mm) in get_mmu_context() argument 32 if (mm->context != NO_CONTEXT) in get_mmu_context() 45 mm->context = ctx; in get_mmu_context() 46 context_mm[ctx] = mm; in get_mmu_context() 52 #define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0) argument 58 static inline void destroy_context(struct mm_struct *mm) in destroy_context() argument 60 if (mm->context != NO_CONTEXT) { in destroy_context() 61 clear_bit(mm->context, context_map); in destroy_context() 62 mm->context = NO_CONTEXT; in destroy_context() 75 get_mmu_context(tsk->mm); in switch_mm() [all …]
|
| /linux/mm/ |
| H A D | mmu_notifier.c | 3 * linux/mm/mmu_notifier.c 13 #include <linux/mm.h> 19 #include <linux/sched/mm.h> 35 * mm->notifier_subscriptions inside the mm_take_all_locks() protected 40 /* all mmu notifiers registered in this mm are queued in this list */ 56 * this mm, such that PTES cannot be read into SPTEs (shadow PTEs) while any 59 * Note that the core mm creates nested invalidate_range_start()/end() regions 62 * progress on the mm side. 69 * - mm->active_invalidate_ranges != 0 75 * - mm->active_invalidate_ranges != 0 [all …]
|
| H A D | debug.c | 3 * mm/debug.c 5 * mm/ specific debug routines. 10 #include <linux/mm.h> 157 pr_emerg("vma %px start %px end %px mm %px\n" in dump_vma() 175 void dump_mm(const struct mm_struct *mm) in dump_mm() argument 177 pr_emerg("mm %px task_size %lu\n" in dump_mm() 202 mm, mm->task_size, in dump_mm() 203 mm->mmap_base, mm->mmap_legacy_base, in dump_mm() 204 mm->pgd, atomic_read(&mm->mm_users), in dump_mm() 205 atomic_read(&mm->mm_count), in dump_mm() [all …]
|
| /linux/Documentation/core-api/ |
| H A D | mm-api.rst | 14 .. kernel-doc:: mm/gup.c 40 .. kernel-doc:: mm/slub.c 43 .. kernel-doc:: mm/slab_common.c 46 .. kernel-doc:: mm/util.c 52 .. kernel-doc:: mm/vmalloc.c 61 .. kernel-doc:: mm/filemap.c 67 .. kernel-doc:: mm/readahead.c 70 .. kernel-doc:: mm/readahead.c 76 .. kernel-doc:: mm/page-writeback.c 82 .. kernel-doc:: mm/truncate.c [all …]
|
| /linux/include/asm-generic/ |
| H A D | pgalloc.h | 12 * @mm: the mm_struct of the current context 19 static inline pte_t *__pte_alloc_one_kernel_noprof(struct mm_struct *mm) in __pte_alloc_one_kernel_noprof() argument 25 if (!pagetable_pte_ctor(mm, ptdesc)) { in __pte_alloc_one_kernel_noprof() 39 * @mm: the mm_struct of the current context 43 static inline pte_t *pte_alloc_one_kernel_noprof(struct mm_struct *mm) in pte_alloc_one_kernel_noprof() argument 45 return __pte_alloc_one_kernel_noprof(mm); in pte_alloc_one_kernel_noprof() 52 * @mm: the mm_struct of the current context 55 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) in pte_free_kernel() argument 62 * @mm: the mm_struct of the current context 72 static inline pgtable_t __pte_alloc_one_noprof(struct mm_struct *mm, gfp_t gfp) in __pte_alloc_one_noprof() argument [all …]
|
| H A D | mmu_context.h | 15 * @mm: the currently active mm context which is becoming lazy 18 * tsk->mm will be NULL 21 static inline void enter_lazy_tlb(struct mm_struct *mm, in enter_lazy_tlb() argument 29 * @tsk: task struct for the mm 30 * @mm: the new mm struct 35 struct mm_struct *mm) in init_new_context() argument 42 * destroy_context - Undo init_new_context when the mm is going away 43 * @mm: old mm struct 46 static inline void destroy_context(struct mm_struct *mm) in destroy_context() argument 52 * activate_mm - called after exec switches the current task to a new mm, to switch to it [all …]
|
| /linux/arch/arm/include/asm/ |
| H A D | mmu_context.h | 24 void __check_vmalloc_seq(struct mm_struct *mm); 27 static inline void check_vmalloc_seq(struct mm_struct *mm) in check_vmalloc_seq() argument 30 unlikely(atomic_read(&mm->context.vmalloc_seq) != in check_vmalloc_seq() 32 __check_vmalloc_seq(mm); in check_vmalloc_seq() 38 void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); 42 init_new_context(struct task_struct *tsk, struct mm_struct *mm) in init_new_context() argument 44 atomic64_set(&mm->context.id, 0); in init_new_context() 49 void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, 52 static inline void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, in a15_erratum_get_cpumask() argument 62 static inline void check_and_switch_context(struct mm_struct *mm, in check_and_switch_context() argument [all …]
|
| /linux/fs/proc/ |
| H A D | task_nommu.c | 3 #include <linux/mm.h> 11 #include <linux/sched/mm.h> 21 void task_mem(struct seq_file *m, struct mm_struct *mm) in task_mem() argument 23 VMA_ITERATOR(vmi, mm, 0); in task_mem() 28 mmap_read_lock(mm); in task_mem() 40 if (atomic_read(&mm->mm_count) > 1 || in task_mem() 50 if (atomic_read(&mm->mm_count) > 1) in task_mem() 51 sbytes += kobjsize(mm); in task_mem() 53 bytes += kobjsize(mm); in task_mem() 72 mmap_read_unlock(mm); in task_mem() [all …]
|
| /linux/tools/testing/vma/ |
| H A D | vma.c | 13 #include "../../../mm/vma.h" 31 #include "../../../mm/vma_init.c" 32 #include "../../../mm/vma_exec.c" 33 #include "../../../mm/vma.c" 66 static struct vm_area_struct *alloc_vma(struct mm_struct *mm, in alloc_vma() argument 72 struct vm_area_struct *vma = vm_area_alloc(mm); in alloc_vma() 87 static int attach_vma(struct mm_struct *mm, struct vm_area_struct *vma) in attach_vma() argument 91 res = vma_link(mm, vma); in attach_vma() 104 static struct vm_area_struct *alloc_and_link_vma(struct mm_struct *mm, in alloc_and_link_vma() argument 110 struct vm_area_struct *vma = alloc_vma(mm, start, end, pgoff, vm_flags); in alloc_and_link_vma() [all …]
|
| /linux/drivers/net/ethernet/mscc/ |
| H A D | ocelot_mm.c | 55 struct ocelot_mm_state *mm = &ocelot->mm[port]; in ocelot_port_update_active_preemptible_tcs() local 66 ocelot_port->speed == SPEED_1000) && mm->tx_active) in ocelot_port_update_active_preemptible_tcs() 67 val = mm->preemptible_tcs; in ocelot_port_update_active_preemptible_tcs() 75 mm->active_preemptible_tcs = val; in ocelot_port_update_active_preemptible_tcs() 79 "port %d %s/%s, MM TX %s, preemptible TCs 0x%x, active 0x%x\n", in ocelot_port_update_active_preemptible_tcs() 82 mm->tx_active ? "active" : "inactive", mm->preemptible_tcs, in ocelot_port_update_active_preemptible_tcs() 83 mm->active_preemptible_tcs); in ocelot_port_update_active_preemptible_tcs() 93 struct ocelot_mm_state *mm = &ocelot->mm[port]; in ocelot_port_change_fp() local 97 if (mm->preemptible_tcs == preemptible_tcs) in ocelot_port_change_fp() 100 mm->preemptible_tcs = preemptible_tcs; in ocelot_port_change_fp() [all …]
|
| /linux/rust/helpers/ |
| H A D | mm.c | 3 #include <linux/mm.h> 4 #include <linux/sched/mm.h> 6 void rust_helper_mmgrab(struct mm_struct *mm) in rust_helper_mmgrab() argument 8 mmgrab(mm); in rust_helper_mmgrab() 11 void rust_helper_mmdrop(struct mm_struct *mm) in rust_helper_mmdrop() argument 13 mmdrop(mm); in rust_helper_mmdrop() 16 void rust_helper_mmget(struct mm_struct *mm) in rust_helper_mmget() argument 18 mmget(mm); in rust_helper_mmget() 21 bool rust_helper_mmget_not_zero(struct mm_struct *mm) in rust_helper_mmget_not_zero() argument 23 return mmget_not_zero(mm); in rust_helper_mmget_not_zero() [all …]
|
| /linux/arch/x86/kernel/ |
| H A D | ldt.c | 19 #include <linux/mm.h> 42 void load_mm_ldt(struct mm_struct *mm) in load_mm_ldt() argument 47 ldt = READ_ONCE(mm->context.ldt); in load_mm_ldt() 50 * Any change to mm->context.ldt is followed by an IPI to all in load_mm_ldt() 51 * CPUs with the mm active. The LDT will not be freed until in load_mm_ldt() 93 * Load the LDT if either the old or new mm had an LDT. in switch_ldt() 95 * An mm will never go from having an LDT to not having an LDT. Two in switch_ldt() 138 struct mm_struct *mm = __mm; in flush_ldt() local 140 if (this_cpu_read(cpu_tlbstate.loaded_mm) != mm) in flush_ldt() 143 load_mm_ldt(mm); in flush_ldt() [all …]
|
| /linux/kernel/ |
| H A D | fork.c | 12 * management can be a bitch. See 'mm/memory.c': 'copy_page_range()' 18 #include <linux/sched/mm.h> 45 #include <linux/mm.h> 117 #include "../mm/internal.h" 477 /* SLAB cache for mm_struct structures (tsk->mm) */ 559 void dup_mm_exe_file(struct mm_struct *mm, struct mm_struct *oldmm) in dup_mm_exe_file() argument 564 RCU_INIT_POINTER(mm->exe_file, exe_file); in dup_mm_exe_file() 574 static inline int mm_alloc_pgd(struct mm_struct *mm) in mm_alloc_pgd() argument 576 mm->pgd = pgd_alloc(mm); in mm_alloc_pgd() 577 if (unlikely(!mm->pgd)) in mm_alloc_pgd() [all …]
|
| /linux/arch/powerpc/mm/book3s64/ |
| H A D | mmu_context.c | 13 #include <linux/mm.h> 95 static int hash__init_new_context(struct mm_struct *mm) in hash__init_new_context() argument 99 mm->context.hash_context = kmalloc(sizeof(struct hash_mm_context), in hash__init_new_context() 101 if (!mm->context.hash_context) in hash__init_new_context() 111 * initialize context slice details for newly allocated mm's (which will in hash__init_new_context() 118 if (mm->context.id == 0) { in hash__init_new_context() 119 memset(mm->context.hash_context, 0, sizeof(struct hash_mm_context)); in hash__init_new_context() 120 slice_init_new_context_exec(mm); in hash__init_new_context() 122 /* This is fork. Copy hash_context details from current->mm */ in hash__init_new_context() 123 …memcpy(mm->context.hash_context, current->mm->context.hash_context, sizeof(struct hash_mm_context)… in hash__init_new_context() [all …]
|
| /linux/arch/x86/include/asm/ |
| H A D | pgalloc.h | 6 #include <linux/mm.h> /* for struct page */ 15 static inline int __paravirt_pgd_alloc(struct mm_struct *mm) { return 0; } in __paravirt_pgd_alloc() argument 20 #define paravirt_pgd_alloc(mm) __paravirt_pgd_alloc(mm) argument 21 static inline void paravirt_pgd_free(struct mm_struct *mm, pgd_t *pgd) {} in paravirt_pgd_free() argument 22 static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_pte() argument 23 static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_pmd() argument 26 static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_pud() argument 27 static inline void paravirt_alloc_p4d(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_p4d() argument 50 extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); 62 static inline void pmd_populate_kernel(struct mm_struct *mm, in pmd_populate_kernel() argument [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/core/ |
| H A D | mm.c | 24 #include <core/mm.h> 26 #define node(root, dir) ((root)->nl_entry.dir == &mm->nodes) ? NULL : \ 30 nvkm_mm_dump(struct nvkm_mm *mm, const char *header) in nvkm_mm_dump() argument 36 list_for_each_entry(node, &mm->nodes, nl_entry) { in nvkm_mm_dump() 41 list_for_each_entry(node, &mm->free, fl_entry) { in nvkm_mm_dump() 48 nvkm_mm_free(struct nvkm_mm *mm, struct nvkm_mm_node **pthis) in nvkm_mm_free() argument 72 list_for_each_entry(prev, &mm->free, fl_entry) { in nvkm_mm_free() 86 region_head(struct nvkm_mm *mm, struct nvkm_mm_node *a, u32 size) in region_head() argument 111 nvkm_mm_head(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, in nvkm_mm_head() argument 121 list_for_each_entry(this, &mm->free, fl_entry) { in nvkm_mm_head() [all …]
|
| /linux/arch/sparc/mm/ |
| H A D | tsb.c | 2 /* arch/sparc64/mm/tsb.c 121 struct mm_struct *mm = tb->mm; in flush_tsb_user() local 124 spin_lock_irqsave(&mm->context.lock, flags); in flush_tsb_user() 127 base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb; in flush_tsb_user() 128 nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries; in flush_tsb_user() 140 else if (mm->context.tsb_block[MM_TSB_HUGE].tsb) { in flush_tsb_user() 141 base = (unsigned long) mm->context.tsb_block[MM_TSB_HUGE].tsb; in flush_tsb_user() 142 nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries; in flush_tsb_user() 149 spin_unlock_irqrestore(&mm->context.lock, flags); in flush_tsb_user() 152 void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr, in flush_tsb_user_page() argument [all …]
|