| /linux/arch/s390/mm/ |
| H A D | pgtable.c | 1 // SPDX-License-Identifier: GPL-2.0 13 #include <linux/mm.h> 26 #include <asm/page-states.h> 40 static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr, in ptep_ipte_local() argument 46 opt = 0; in ptep_ipte_local() 47 asce = READ_ONCE(mm->context.gmap_asce); in ptep_ipte_local() 48 if (asce == 0UL || nodat) in ptep_ipte_local() 50 if (asce != -1UL) { in ptep_ipte_local() 51 asce = asce ? : mm->context.asce; in ptep_ipte_local() 56 __ptep_ipte(addr, ptep, 0, 0, IPTE_LOCAL); in ptep_ipte_local() [all …]
|
| /linux/arch/m68k/include/asm/ |
| H A D | mmu_context.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 5 #include <asm-generic/mm_hooks.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() 42 ctx = 0; 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() [all …]
|
| /linux/tools/testing/vma/ |
| H A D | vma.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 #include "generated/bit-length.h" 9 #include "maple-shared.h" 13 #include "../../../mm/vma.h" 19 (fail_prealloc ? -ENOMEM : mas_preallocate(&(vmi)->ma 64 alloc_vma(struct mm_struct * mm,unsigned long start,unsigned long end,pgoff_t pgoff,vm_flags_t flags) alloc_vma() argument 85 attach_vma(struct mm_struct * mm,struct vm_area_struct * vma) attach_vma() argument 102 alloc_and_link_vma(struct mm_struct * mm,unsigned long start,unsigned long end,pgoff_t pgoff,vm_flags_t flags) alloc_and_link_vma() argument 211 try_merge_new_vma(struct mm_struct * mm,struct vma_merge_struct * vmg,unsigned long start,unsigned long end,pgoff_t pgoff,vm_flags_t flags,bool * was_merged) try_merge_new_vma() argument 249 cleanup_mm(struct mm_struct * mm,struct vma_iterator * vmi) cleanup_mm() argument 305 struct mm_struct mm = {}; test_simple_merge() local 339 struct mm_struct mm = {}; test_simple_modify() local 398 struct mm_struct mm = {}; test_simple_expand() local 426 struct mm_struct mm = {}; test_simple_shrink() local 447 struct mm_struct mm = {}; test_merge_new() local 643 struct mm_struct mm = {}; test_vma_merge_special_flags() local 715 struct mm_struct mm = {}; test_vma_merge_with_close() local 924 struct mm_struct mm = {}; test_vma_merge_new_with_close() local 979 struct mm_struct mm = {}; test_merge_existing() local 1209 struct mm_struct mm = {}; test_anon_vma_non_mergeable() local 1296 struct mm_struct mm = {}; test_dup_anon_vma() local 1456 struct mm_struct mm = {}; test_vmi_prealloc_fail() local 1522 struct mm_struct mm = {}; test_merge_extend() local 1552 struct mm_struct mm = {}; test_copy_vma() local 1585 struct mm_struct mm = {}; test_expand_only_mode() local 1624 struct mm_struct mm = {}; test_mmap_region_basic() local [all...] |
| /linux/kernel/ |
| H A D | fork.c | 1 // SPDX-License-Identifier: GPL-2.0-only 9 * 'fork.c' contains the help-routines for the 'fork' system call 12 * management can be a bitch. See 'mm/memory.c': 'copy_page_range()' 18 #include <linux/sched/mm.h> 45 #include <linux/mm.h> 84 #include <linux/posix-timers.h> 85 #include <linux/user-return-notifier.h> 117 #include "../mm/internal.h" 153 DEFINE_PER_CPU(unsigned long, process_counts) = 0; 168 int total = 0; in nr_processes() [all …]
|
| /linux/drivers/gpu/drm/tests/ |
| H A D | drm_mm_test.c | 1 // SPDX-License-Identifier: GPL-2.0-only 32 [BOTTOMUP] = { "bottom-up", DRM_MM_INSERT_LOW }, 33 [TOPDOWN] = { "top-down", DRM_MM_INSERT_HIGH }, 38 static bool assert_no_holes(struct kunit *test, const struct drm_mm *mm) in assert_no_holes() argument 44 count = 0; in assert_no_holes() 45 drm_mm_for_each_hole(hole, mm, hole_start, hole_end) in assert_no_holes() 53 drm_mm_for_each_node(hole, mm) { in assert_no_holes() 63 static bool assert_one_hole(struct kunit *test, const struct drm_mm *mm, u64 start, u64 end) in assert_one_hole() argument 73 count = 0; in assert_one_hole() 74 drm_mm_for_each_hole(hole, mm, hole_start, hole_end) { in assert_one_hole() [all …]
|
| /linux/include/linux/ |
| H A D | mmap_lock.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 12 #include <linux/tracepoint-defs.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() [all …]
|
| H A D | ksm.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 12 #include <linux/mm.h> 20 vm_flags_t ksm_vma_flags(const 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() [all …]
|
| /linux/drivers/net/ethernet/mscc/ |
| H A D | ocelot_mm.c | 1 // SPDX-License-Identifier: (GPL-2.0 OR MIT) 3 * Hardware library for MAC Merge Layer and Frame Preemption on TSN-capable 6 * Copyright 2022-2023 NXP 37 case 0: in ocelot_mm_verify_status() 54 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_port_update_active_preemptible_tcs() 55 struct ocelot_mm_state *mm = &ocelot->mm[port]; in ocelot_port_update_active_preemptible_tcs() local 56 u32 val = 0; in ocelot_port_update_active_preemptible_tcs() 58 lockdep_assert_held(&ocelot->fwd_domain_lock); in ocelot_port_update_active_preemptible_tcs() 65 if ((ocelot_port->phy_mode != PHY_INTERFACE_MODE_QSGMII || in ocelot_port_update_active_preemptible_tcs() 66 ocelot_port->speed == SPEED_1000) && mm->tx_active) in ocelot_port_update_active_preemptible_tcs() [all …]
|
| /linux/drivers/gpu/drm/amd/amdkfd/ |
| H A D | kfd_mqd_manager_v9.c | 1 // SPDX-License-Identifier: GPL-2.0 OR MIT 3 * Copyright 2016-2022 Advanced Micro Devices, Inc. 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() 45 q->type == KFD_QUEUE_TYPE_COMPUTE) in mqd_stride_v9() 46 return ALIGN(q->ctl_stack_size, PAGE_SIZE) + 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 66 uint32_t se_mask[KFD_MAX_NUM_SE] = {0}; in update_cu_mask() [all …]
|
| H A D | kfd_mqd_manager.c | 1 // SPDX-License-Identifier: GPL-2.0 OR MIT 3 * Copyright 2014-2022 Advanced Micro Devices, Inc. 57 mqd_mem_obj->gtt_mem = dev->dqm->hiq_sdma_mqd.gtt_mem; in allocate_hiq_mqd() 58 mqd_mem_obj->gpu_addr = dev->dqm->hiq_sdma_mqd.gpu_addr; in allocate_hiq_mqd() 59 mqd_mem_obj->cpu_ptr = dev->dqm->hiq_sdma_mqd.cpu_ptr; in allocate_hiq_mqd() 74 offset = (q->sdma_engine_id * in allocate_sdma_mqd() 75 dev->kfd->device_info.num_sdma_queues_per_engine + in allocate_sdma_mqd() 76 q->sdma_queue_id) * in allocate_sdma_mqd() 77 dev->dqm->mqd_mgrs[KFD_MQD_TYPE_SDMA]->mqd_size; in allocate_sdma_mqd() 79 offset += dev->dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ]->mqd_size * in allocate_sdma_mqd() [all …]
|
| /linux/fs/proc/ |
| H A D | task_nommu.c | 1 // SPDX-License-Identifier: GPL-2.0 3 #include <linux/mm.h> 11 #include <linux/sched/mm.h> 17 * "non-shared". Shared memory may get counted more than once, for 18 * each process that owns it. Non-shared memory is counted 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() 26 unsigned long bytes = 0, sbytes = 0, slack = 0, size; in task_mem() 28 mmap_read_lock(mm); in task_mem() 32 region = vma->vm_region; in task_mem() [all …]
|
| /linux/mm/ |
| H A D | mmu_notifier.c | 1 // SPDX-License-Identifier: GPL-2.0-only 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 */ 53 * This is a collision-retry read-side/write-side 'lock', a lot like a 54 * seqcount, however this allows multiple write-sides to hold it at 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 [all …]
|
| H A D | debug.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * mm/debug.c 5 * mm/ specific debug routines. 10 #include <linux/mm.h> 36 {0, NULL} 41 {0, NULL} 46 {0, NULL} 49 #define DEF_PAGETYPE_NAME(_name) [PGTY_##_name - 0xf0] = __stringify(_name) 63 unsigned i = (page_type >> 24) - 0xf0; in page_type_name() 74 int mapcount = atomic_read(&page->_mapcount) + 1; in __dump_folio() [all …]
|
| H A D | mmap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * mm/mmap.c 14 #include <linux/backing-dev.h> 15 #include <linux/mm.h> 48 #include <linux/sched/mm.h> 63 #define arch_mmap_check(addr, len, flags) (0) 80 /* Update vma->vm_page_prot to reflect vma->vm_flags. */ 83 vm_flags_t vm_flags = vma->vm_flags; in vma_set_page_prot() 86 vm_page_prot = vm_pgprot_modify(vma->vm_page_prot, vm_flags); in vma_set_page_prot() 91 /* remove_protection_ptes reads vma->vm_page_prot without mmap_lock */ in vma_set_page_prot() [all …]
|
| /linux/arch/powerpc/include/asm/ |
| H A D | mmu_context.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 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, [all …]
|
| /linux/arch/sparc/mm/ |
| H A D | tsb.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* arch/sparc64/mm/tsb.c 25 return vaddr & (nentries - 1); in tsb_hash() 37 for (idx = 0; idx < KERNEL_TSB_NENTRIES; idx++) { in flush_tsb_kernel_range_scan() 41 match |= (ent->tag << 22); in flush_tsb_kernel_range_scan() 43 ent->tag = (1UL << TSB_TAG_INVALID_BIT); in flush_tsb_kernel_range_scan() 56 if ((end - start) >> PAGE_SHIFT >= 2 * KERNEL_TSB_NENTRIES) in flush_tsb_kernel_range() 64 if (tag_compare(ent->tag, v)) in flush_tsb_kernel_range() 65 ent->tag = (1UL << TSB_TAG_INVALID_BIT); in flush_tsb_kernel_range() 75 v &= ~0x1UL; in __flush_tsb_one_entry() [all …]
|
| /linux/arch/x86/kernel/ |
| H A D | ldt.c | 1 // SPDX-License-Identifier: GPL-2.0 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() 65 if (WARN_ON_ONCE((unsigned long)ldt->slot > 1)) { in load_mm_ldt() 67 * Whoops -- either the new LDT isn't mapped in load_mm_ldt() 68 * (if slot == -1) or is mapped into a bogus in load_mm_ldt() 76 * If page table isolation is enabled, ldt->entries in load_mm_ldt() [all …]
|
| /linux/kernel/sched/ |
| H A D | membarrier.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Copyright (C) 2010-2017 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> 19 * int x = 0, y = 0; 24 * CPU1 after the IPI-induced memory barrier: 31 * b: send IPI IPI-induced mb 38 * BUG_ON(r1 == 0 && r2 == 0) 43 * can be reordered after (a) (although not after (c)), so we get r1 == 0 44 * and r2 == 0. This violates the guarantee that membarrier() is 48 * before the IPI-induced memory barrier on CPU1. 55 * int x = 0, y = 0; [all …]
|
| /linux/arch/powerpc/mm/book3s64/ |
| H A D | radix_tlb.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright 2015-2016, Aneesh Kumar K.V, IBM Corporation. 8 #include <linux/mm.h> 12 #include <linux/sched/mm.h> 15 #include <asm/ppc-opcode.h> 38 asm volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) in tlbiel_radix_set_isa300() 57 tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); in tlbiel_all_isa300() 61 tlbiel_radix_set_isa300(set, is, 0, in tlbiel_all_isa300() 62 RIC_FLUSH_TLB, 0); in tlbiel_all_isa300() 67 tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); in tlbiel_all_isa300() [all …]
|
| H A D | subpage_prot.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Copyright 2007-2008 Paul Mackerras, IBM Corp. 22 void subpage_prot_free(struct mm_struct *mm) in subpage_prot_free() argument 24 struct subpage_prot_table *spt = mm_ctx_subpage_prot(&mm->context); in subpage_prot_free() 31 for (i = 0; i < 4; ++i) { in subpage_prot_free() 32 if (spt->low_prot[i]) { in subpage_prot_free() 33 free_page((unsigned long)spt->low_prot[i]); in subpage_prot_free() 34 spt->low_prot[i] = NULL; in subpage_prot_free() 37 addr = 0; in subpage_prot_free() 38 for (i = 0; i < (TASK_SIZE_USER64 >> 43); ++i) { in subpage_prot_free() [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 : \ 27 list_entry((root)->nl_entry.dir, struct nvkm_mm_node, nl_entry) 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() 38 node->offset, node->length, node->type); in nvkm_mm_dump() 41 list_for_each_entry(node, &mm->free, fl_entry) { in nvkm_mm_dump() 43 node->offset, node->length, node->type); in nvkm_mm_dump() 48 nvkm_mm_free(struct nvkm_mm *mm, struct nvkm_mm_node **pthis) in nvkm_mm_free() argument 56 if (prev && prev->type == NVKM_MM_TYPE_NONE) { in nvkm_mm_free() [all …]
|
| /linux/arch/riscv/mm/ |
| H A D | hugetlbpage.c | 1 // SPDX-License-Identifier: GPL-2.0 6 pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep) in huge_ptep_get() argument 17 for (i = 0; i < pte_num; i++, ptep++) { in huge_ptep_get() 30 pte_t *huge_pte_alloc(struct mm_struct *mm, in huge_pte_alloc() argument 42 pgd = pgd_offset(mm, addr); in huge_pte_alloc() 43 p4d = p4d_alloc(mm, pgd, addr); in huge_pte_alloc() 47 pud = pud_alloc(mm, p4d, addr); in huge_pte_alloc() 58 pte = huge_pmd_share(mm, vma, addr, pud); in huge_pte_alloc() 60 pte = (pte_t *)pmd_alloc(mm, pud, addr); in huge_pte_alloc() 64 pmd = pmd_alloc(mm, pud, addr); in huge_pte_alloc() [all …]
|
| /linux/mm/damon/ |
| H A D | vaddr.c | 1 // SPDX-License-Identifier: GPL-2.0 8 #define pr_fmt(fmt) "damon-va: " fmt 16 #include <linux/sched/mm.h> 19 #include "ops-common.h" 27 * 't->pid' should be the pointer to the relevant 'struct pid' having reference 32 return get_pid_task(t->pid, PIDTYPE_PID); in damon_get_task_struct() 45 struct mm_struct *mm; in damon_get_mm() local 51 mm = get_task_mm(task); in damon_get_mm() 53 return mm; in damon_get_mm() 61 * Size-evenly split a region into 'nr_pieces' small regions [all …]
|
| /linux/include/asm-generic/ |
| H A D | pgalloc.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 11 * __pte_alloc_one_kernel - allocate memory for a PTE-level kernel page table 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 22 ~__GFP_HIGHMEM, 0); in __pte_alloc_one_kernel_noprof() 26 if (!pagetable_pte_ctor(mm, ptdesc)) { in __pte_alloc_one_kernel_noprof() 37 * pte_alloc_one_kernel - allocate memory for a PTE-level kernel page table 38 * @mm: the mm_struct of the current context 42 static inline pte_t *pte_alloc_one_kernel_noprof(struct mm_struct *mm) in pte_alloc_one_kernel_noprof() argument 44 return __pte_alloc_one_kernel_noprof(mm); in pte_alloc_one_kernel_noprof() [all …]
|
| /linux/arch/arm/include/asm/ |
| H A D | mmu_context.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 8 * 27-06-1996 RMK Created 20 #include <asm/proc-fns.h> 22 #include <asm-generic/mm_hooks.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 [all …]
|