函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:include\linux\mempolicy.h Create Date:2022-07-27 06:53:12
首页 Copyright©Brick

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/* Check if a vma is migratable */
static inline bool vma_migratable(struct vm_area_struct *vma)
{
    if (vma->vm_flags & (VM_IO | VM_PFNMAP))
        return false;
 
    /*
     * DAX device mappings require predictable access latency, so avoid
     * incurring periodic faults.
     */
    if (vma_is_dax(vma))
        return false;
 
#ifndef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
    if (vma->vm_flags & VM_HUGETLB)
        return false;
#endif
 
    /*
     * Migration allocates pages in the highest zone. If we cannot
     * do so then migration (at least from node to node) is not
     * possible.
     */
    if (vma->vm_file &&
        gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping))
                                < policy_zone)
            return false;
    return true;
}