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@sgi.com> Cc: Christoph Lameter <cl@linux.com> Cc: Nick Piggin <npiggin@gmail.com> Cc: Hugh Dickins <hughd@google.com> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>