mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Mem Policy: add MPOL_F_MEMS_ALLOWED get_mempolicy() flag
Allow an application to query the memories allowed by its context. Updated numa_memory_policy.txt to mention that applications can use this to obtain allowed memories for constructing valid policies. TODO: update out-of-tree libnuma wrapper[s], or maybe add a new wrapper--e.g., numa_get_mems_allowed() ? Also, update numa syscall man pages. Tested with memtoy V>=0.13. Signed-off-by: Lee Schermerhorn <[email protected]> Acked-by: Christoph Lameter <[email protected]> Cc: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
32a4330d41
commit
754af6f5a8
3 changed files with 28 additions and 18 deletions
|
|
@ -526,8 +526,18 @@ long do_get_mempolicy(int *policy, nodemask_t *nmask,
|
|||
struct mempolicy *pol = current->mempolicy;
|
||||
|
||||
cpuset_update_task_memory_state();
|
||||
if (flags & ~(unsigned long)(MPOL_F_NODE|MPOL_F_ADDR))
|
||||
if (flags &
|
||||
~(unsigned long)(MPOL_F_NODE|MPOL_F_ADDR|MPOL_F_MEMS_ALLOWED))
|
||||
return -EINVAL;
|
||||
|
||||
if (flags & MPOL_F_MEMS_ALLOWED) {
|
||||
if (flags & (MPOL_F_NODE|MPOL_F_ADDR))
|
||||
return -EINVAL;
|
||||
*policy = 0; /* just so it's initialized */
|
||||
*nmask = cpuset_current_mems_allowed;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (flags & MPOL_F_ADDR) {
|
||||
down_read(&mm->mmap_sem);
|
||||
vma = find_vma_intersection(mm, addr, addr+1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue