| /linux/drivers/gpu/drm/ |
| H A D | drm_buddy.c | 27 static struct drm_buddy_block *drm_block_alloc(struct drm_buddy *mm, in drm_block_alloc() argument 50 static void drm_block_free(struct drm_buddy *mm, in drm_block_free() argument 93 static void rbtree_insert(struct drm_buddy *mm, in rbtree_insert() argument 98 &mm->free_trees[tree][drm_buddy_block_order(block)], in rbtree_insert() 102 static void rbtree_remove(struct drm_buddy *mm, in rbtree_remove() argument 110 root = &mm->free_trees[tree][order]; in rbtree_remove() 126 static void mark_allocated(struct drm_buddy *mm, in mark_allocated() argument 132 rbtree_remove(mm, block); in mark_allocated() 135 static void mark_free(struct drm_buddy *mm, in mark_free() argument 144 rbtree_insert(mm, block, tree); in mark_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/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 | 57 TP_PROTO(struct mm_struct *mm, struct folio *folio, 60 TP_ARGS(mm, folio, referenced, none_or_zero, status, unmapped), 63 __field(struct mm_struct *, mm) 72 __entry->mm = mm; 80 TP_printk("mm=%p, scan_pfn=0x%lx, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d", 81 __entry->mm, 91 TP_PROTO(struct mm_struct *mm, int isolated, int status), 93 TP_ARGS(mm, isolated, status), 96 __field(struct mm_struct *, 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 …]
|
| H A D | mmap.c | 3 * mm/mmap.c 15 #include <linux/mm.h> 48 #include <linux/sched/mm.h> 111 return mlock_future_ok(current->mm, in check_brk_limits() 112 current->mm->def_flags & VM_LOCKED, len) in check_brk_limits() 119 struct mm_struct *mm = current->mm; in SYSCALL_DEFINE1() local 126 if (mmap_write_lock_killable(mm)) in SYSCALL_DEFINE1() 129 origbrk = mm->brk; in SYSCALL_DEFINE1() 131 min_brk = mm->start_brk; in SYSCALL_DEFINE1() 135 * randomize_va_space to 2, which will still cause mm->start_brk in SYSCALL_DEFINE1() [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/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 …]
|
| /linux/arch/arm/mm/ |
| H A D | pgd.c | 3 * linux/arch/arm/mm/pgd.c 7 #include <linux/mm.h> 17 #include "mm.h" 20 #define _pgd_alloc(mm) kmalloc_objs(pgd_t, PTRS_PER_PGD, GFP_KERNEL | __GFP_ZERO) argument 21 #define _pgd_free(mm, pgd) kfree(pgd) argument 23 #define _pgd_alloc(mm) __pgd_alloc(mm, 2) argument 24 #define _pgd_free(mm, pgd) __pgd_free(mm, pgd) argument 30 pgd_t *pgd_alloc(struct mm_struct *mm) in pgd_alloc() argument 38 new_pgd = _pgd_alloc(mm); in pgd_alloc() 55 new_p4d = p4d_alloc(mm, new_pgd + pgd_index(MODULES_VADDR), in pgd_alloc() [all …]
|
| /linux/tools/testing/vma/tests/ |
| H A D | merge.c | 72 static struct vm_area_struct *try_merge_new_vma(struct mm_struct *mm, in try_merge_new_vma() argument 92 return alloc_and_link_vma(mm, start, end, pgoff, vm_flags); in try_merge_new_vma() 99 struct mm_struct mm = {}; in test_simple_merge() local 100 struct vm_area_struct *vma_left = alloc_vma(&mm, 0, 0x1000, 0, vm_flags); in test_simple_merge() 101 struct vm_area_struct *vma_right = alloc_vma(&mm, 0x2000, 0x3000, 2, vm_flags); in test_simple_merge() 102 VMA_ITERATOR(vmi, &mm, 0x1000); in test_simple_merge() 104 .mm = &mm, in test_simple_merge() 112 ASSERT_FALSE(attach_vma(&mm, vma_left)); in test_simple_merge() 113 ASSERT_FALSE(attach_vma(&mm, vma_right)); in test_simple_merge() 124 mtree_destroy(&mm.mm_mt); in test_simple_merge() [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/include/linux/ |
| 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 …]
|
| H A D | mmu_notifier.h | 40 * that the mm refcount is zero and the range is no longer accessible. 66 * Called either by mmu_notifier_unregister or when the mm is 69 * methods (the ones invoked outside the mm context) and it 74 * tsk->mm == mm exits. 81 * last thread of this mm quits, you've also to be sure that 89 struct mm_struct *mm); 101 struct mm_struct *mm, 111 struct mm_struct *mm, 122 struct mm_struct *mm, 199 struct mm_struct *mm, [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/drivers/gpu/drm/tests/ |
| H A D | drm_mm_test.c | 39 static bool assert_no_holes(struct kunit *test, const struct drm_mm *mm) in assert_no_holes() argument 46 drm_mm_for_each_hole(hole, mm, hole_start, hole_end) in assert_no_holes() 54 drm_mm_for_each_node(hole, mm) { in assert_no_holes() 64 static bool assert_one_hole(struct kunit *test, const struct drm_mm *mm, u64 start, u64 end) in assert_one_hole() argument 75 drm_mm_for_each_hole(hole, mm, hole_start, hole_end) { in assert_one_hole() 79 "empty mm has incorrect hole, found (%llx, %llx), expect (%llx, %llx)\n", in assert_one_hole() 104 static bool assert_node(struct kunit *test, struct drm_mm_node *node, struct drm_mm *mm, in assert_node() argument 109 if (!drm_mm_node_allocated(node) || node->mm != mm) { in assert_node() 139 struct drm_mm mm; in drm_test_mm_init() local 143 memset(&mm, 0, sizeof(mm)); in drm_test_mm_init() [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/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> 118 #include "../mm/internal.h" 478 /* SLAB cache for mm_struct structures (tsk->mm) */ 560 void dup_mm_exe_file(struct mm_struct *mm, struct mm_struct *oldmm) in dup_mm_exe_file() argument 565 RCU_INIT_POINTER(mm->exe_file, exe_file); in dup_mm_exe_file() 575 static inline int mm_alloc_pgd(struct mm_struct *mm) in mm_alloc_pgd() argument 577 mm->pgd = pgd_alloc(mm); in mm_alloc_pgd() 578 if (unlikely(!mm->pgd)) in mm_alloc_pgd() [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/rust/helpers/ |
| H A D | mm.c | 3 #include <linux/mm.h> 4 #include <linux/sched/mm.h> 6 __rust_helper void rust_helper_mmgrab(struct mm_struct *mm) in rust_helper_mmgrab() argument 8 mmgrab(mm); in rust_helper_mmgrab() 11 __rust_helper void rust_helper_mmdrop(struct mm_struct *mm) in rust_helper_mmdrop() argument 13 mmdrop(mm); in rust_helper_mmdrop() 16 __rust_helper void rust_helper_mmget(struct mm_struct *mm) in rust_helper_mmget() argument 18 mmget(mm); in rust_helper_mmget() 21 __rust_helper 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() 26 rust_helper_mmap_read_lock(struct mm_struct * mm) rust_helper_mmap_read_lock() argument 31 rust_helper_mmap_read_trylock(struct mm_struct * mm) rust_helper_mmap_read_trylock() argument 36 rust_helper_mmap_read_unlock(struct mm_struct * mm) rust_helper_mmap_read_unlock() argument 41 rust_helper_vma_lookup(struct mm_struct * mm,unsigned long addr) rust_helper_vma_lookup() argument [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_obj(struct hash_mm_context); in hash__init_new_context() 100 if (!mm->context.hash_context) in hash__init_new_context() 110 * initialize context slice details for newly allocated mm's (which will in hash__init_new_context() 117 if (mm->context.id == 0) { in hash__init_new_context() 118 memset(mm->context.hash_context, 0, sizeof(struct hash_mm_context)); in hash__init_new_context() 119 slice_init_new_context_exec(mm); in hash__init_new_context() 121 /* This is fork. Copy hash_context details from current->mm */ in hash__init_new_context() 122 …memcpy(mm->context.hash_context, current->mm->context.hash_context, sizeof(struct hash_mm_context)… in hash__init_new_context() [all …]
|
| /linux/drivers/gpu/drm/amd/amdkfd/ |
| H A D | kfd_mqd_manager_v9.c | 37 static void update_mqd(struct mqd_manager *mm, void *mqd, 41 static uint64_t mqd_stride_v9(struct mqd_manager *mm, in mqd_stride_v9() argument 44 if (mm->dev->kfd->cwsr_enabled && in mqd_stride_v9() 49 return mm->mqd_size; in mqd_stride_v9() 62 static void update_cu_mask(struct mqd_manager *mm, void *mqd, in update_cu_mask() argument 71 mqd_symmetrically_map_cu_mask(mm, in update_cu_mask() 80 if (KFD_GC_VERSION(mm->dev) != IP_VERSION(9, 4, 3) && in update_cu_mask() 81 KFD_GC_VERSION(mm->dev) != IP_VERSION(9, 4, 4) && in update_cu_mask() 82 KFD_GC_VERSION(mm->dev) != IP_VERSION(9, 5, 0)) { in update_cu_mask() 126 static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, in allocate_mqd() argument [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 …]
|
| /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 …]
|