/* Returns effective policy for a VMA at specified address. Falls back to @task or system default policy, as necessary. Current or other task's task mempolicy and non-shared vma policies are protected by the task's mmap_sem, which must be held for read by the caller. Shared policies  require an extra reference count */
static struct mempolicy* get_vma_policy(struct task_struct *task, struct vm_area_struct *vma, unsigned long addr)
/* Returns effective policy for a VMA at specified address. Falls back to @task or system default policy, as necessary. Current or other task's task mempolicy and non-shared vma policies are protected by the task's mmap_sem, which must be held for read by the caller. Shared policies  require an extra reference count */
static struct mempolicy* get_vma_policy(struct task_struct *task, struct vm_area_struct *vma, unsigned long addr)
{
	struct mempolicy *pol = task->mempolicy;
	if (vma) {
		if (vma->vm_ops && vma->vm_ops->get_policy) {
			struct mempolicy *vpol = vma->vm_ops->get_policy(vma,
									addr);
			if (vpol)
				pol = vpol;
		} else if (vma->vm_policy)
			pol = vma->vm_policy;
	}
	if (!pol)
		pol = &default_policy;
	return pol;
}