The patch titled Subject: shmem: provide vm_ops when also providing a mem policy has been removed from the -mm tree. Its filename was shmem-provide-vm_ops-when-also-providing-a-mem-policy.patch This patch was dropped because it is obsolete ------------------------------------------------------ From: Nathan Zimmer <nzimmer@xxxxxxx> Subject: shmem: provide vm_ops when also providing a mem policy When tmpfs has the memory policy interleaved it always starts allocating for each file at node 0. When there are many small files the lower nodes fill up disproportionately. This patchset spreads out node usage by starting files at nodes other then 0. The tmpfs superblock grants an offset for each inode as they are created. Each then uses that offset to proved a prefered first node for its interleave in the shmem_interleave. This patch: Update shmem_get_policy() to use the vma_policy if provided. This is to allows us to safely provide shmem_vm_ops to the vma when the vm_file has not been setup which is the case on the pseudo vmas. Signed-off-by: Nathan Zimmer <nzimmer@xxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Nick Piggin <npiggin@xxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Lee Schermerhorn <lee.schermerhorn@xxxxxx> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/shmem.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff -puN mm/shmem.c~shmem-provide-vm_ops-when-also-providing-a-mem-policy mm/shmem.c --- a/mm/shmem.c~shmem-provide-vm_ops-when-also-providing-a-mem-policy +++ a/mm/shmem.c @@ -931,8 +931,11 @@ static struct page *shmem_swapin(swp_ent pvma.vm_start = 0; /* Bias interleave by inode number to distribute better across nodes */ pvma.vm_pgoff = index + info->vfs_inode.i_ino; - pvma.vm_ops = NULL; pvma.vm_policy = spol; + if (pvma.vm_policy) + pvma.vm_ops = &shmem_vm_ops; + else + pvma.vm_ops = NULL; return swapin_readahead(swap, gfp, &pvma, 0); } @@ -945,8 +948,11 @@ static struct page *shmem_alloc_page(gfp pvma.vm_start = 0; /* Bias interleave by inode number to distribute better across nodes */ pvma.vm_pgoff = index + info->vfs_inode.i_ino; - pvma.vm_ops = NULL; pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, index); + if (pvma.vm_policy) + pvma.vm_ops = &shmem_vm_ops; + else + pvma.vm_ops = NULL; /* * alloc_page_vma() will drop the shared policy reference @@ -1313,8 +1319,14 @@ static int shmem_set_policy(struct vm_ar static struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, unsigned long addr) { - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; pgoff_t index; + struct inode *inode; + + /* If the vma knows what policy it wants use that one. */ + if (vma->vm_policy) + return vma->vm_policy; + + inode = vma->vm_file->f_path.dentry->d_inode; index = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; return mpol_shared_policy_lookup(&SHMEM_I(inode)->policy, index); _ Patches currently in -mm which might be from nzimmer@xxxxxxx are tmpfs-distribute-interleave-better-across-nodes.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html