linux/mm
Vlastimil Babka be97a41b29 mm/mempolicy.c: merge alloc_hugepage_vma to alloc_pages_vma
The previous commit ("mm/thp: Allocate transparent hugepages on local
node") introduced alloc_hugepage_vma() to mm/mempolicy.c to perform a
special policy for THP allocations.  The function has the same interface
as alloc_pages_vma(), shares a lot of boilerplate code and a long
comment.

This patch merges the hugepage special case into alloc_pages_vma.  The
extra if condition should be cheap enough price to pay.  We also prevent
a (however unlikely) race with parallel mems_allowed update, which could
make hugepage allocation restart only within the fallback call to
alloc_hugepage_vma() and not reconsider the special rule in
alloc_hugepage_vma().

Also by making sure mpol_cond_put(pol) is always called before actual
allocation attempt, we can use a single exit path within the function.

Also update the comment for missing node parameter and obsolete reference
to mm_sem.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-11 17:06:04 -08:00
..
Kconfig
Kconfig.debug mm/debug_pagealloc: remove obsolete Kconfig options 2015-01-08 15:10:52 -08:00
Makefile mm: replace remap_file_pages() syscall with emulation 2015-02-10 14:30:30 -08:00
backing-dev.c
balloon_compaction.c
bootmem.c
cleancache.c mm: fix cleancache debugfs directory path 2015-01-20 14:08:31 +01:00
cma.c mm: cma: fix totalcma_pages to include DT defined CMA regions 2015-02-11 17:06:03 -08:00
compaction.c mm/compaction: add tracepoint to observe behaviour of compaction defer 2015-02-11 17:06:04 -08:00
debug-pagealloc.c
debug.c mm: account pmd page tables to the process 2015-02-11 17:06:04 -08:00
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c mm: drop vm_ops->remap_pages and generic_file_remap_pages() stub 2015-02-10 14:30:30 -08:00
filemap_xip.c mm: drop vm_ops->remap_pages and generic_file_remap_pages() stub 2015-02-10 14:30:30 -08:00
frontswap.c
gup.c mm/hugetlb: take page table lock in follow_huge_pmd() 2015-02-11 17:06:01 -08:00
highmem.c
huge_memory.c mm/thp: allocate transparent hugepages on local node 2015-02-11 17:06:04 -08:00
hugetlb.c mm: account pmd page tables to the process 2015-02-11 17:06:04 -08:00
hugetlb_cgroup.c mm: page_counter: pull "-1" handling out of page_counter_memparse() 2015-02-11 17:06:02 -08:00
hwpoison-inject.c
init-mm.c
internal.h mm: reduce try_to_compact_pages parameters 2015-02-11 17:06:02 -08:00
interval_tree.c mm: replace vma->sharead.linear with vma->shared 2015-02-10 14:30:31 -08:00
iov_iter.c
kmemcheck.c
kmemleak-test.c
kmemleak.c
ksm.c mm: remove rest usage of VM_NONLINEAR and pte_file() 2015-02-10 14:30:31 -08:00
list_lru.c
maccess.c
madvise.c mm: remove rest usage of VM_NONLINEAR and pte_file() 2015-02-10 14:30:31 -08:00
memblock.c
memcontrol.c mm: memcontrol: consolidate swap controller code 2015-02-11 17:06:03 -08:00
memory-failure.c
memory.c mm: account pmd page tables to the process 2015-02-11 17:06:04 -08:00
memory_hotplug.c
mempolicy.c mm/mempolicy.c: merge alloc_hugepage_vma to alloc_pages_vma 2015-02-11 17:06:04 -08:00
mempool.c
migrate.c mm/hugetlb: take page table lock in follow_huge_pmd() 2015-02-11 17:06:01 -08:00
mincore.c mm: remove rest usage of VM_NONLINEAR and pte_file() 2015-02-10 14:30:31 -08:00
mlock.c
mm_init.c
mmap.c mm: fix false-positive warning on exit due mm_nr_pmds(mm) 2015-02-11 17:06:04 -08:00
mmu_context.c
mmu_notifier.c
mmzone.c mm: microoptimize zonelist operations 2015-02-11 17:06:02 -08:00
mprotect.c mm: remove rest usage of VM_NONLINEAR and pte_file() 2015-02-10 14:30:31 -08:00
mremap.c mm: remove rest usage of VM_NONLINEAR and pte_file() 2015-02-10 14:30:31 -08:00
msync.c mm: remove rest usage of VM_NONLINEAR and pte_file() 2015-02-10 14:30:31 -08:00
nobootmem.c
nommu.c mm: replace remap_file_pages() syscall with emulation 2015-02-10 14:30:30 -08:00
oom_kill.c mm: account pmd page tables to the process 2015-02-11 17:06:04 -08:00
page-writeback.c page_writeback: put account_page_redirty() after set_page_dirty() 2015-02-11 17:06:04 -08:00
page_alloc.c oom, PM: make OOM detection in the freezer path raceless 2015-02-11 17:06:03 -08:00
page_counter.c mm: page_counter: pull "-1" handling out of page_counter_memparse() 2015-02-11 17:06:02 -08:00
page_ext.c
page_io.c
page_isolation.c
page_owner.c
pagewalk.c mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range 2015-02-05 13:35:29 -08:00
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
process_vm_access.c
quicklist.c
readahead.c
rmap.c mm: memcontrol: track move_lock state internally 2015-02-11 17:06:00 -08:00
shmem.c swap: remove unused mem_cgroup_uncharge_swapcache declaration 2015-02-11 17:06:00 -08:00
slab.c
slab.h memcg: zap __memcg_{charge,uncharge}_slab 2015-02-10 14:30:34 -08:00
slab_common.c memcg: zap memcg_slab_caches and memcg_slab_mutex 2015-02-10 14:30:34 -08:00
slob.c
slub.c mm/slub.c: fix typo in comment 2015-02-10 14:30:30 -08:00
sparse-vmemmap.c
sparse.c
swap.c rmap: drop support of non-linear mappings 2015-02-10 14:30:31 -08:00
swap_cgroup.c
swap_state.c
swapfile.c
truncate.c
util.c
vmacache.c
vmalloc.c
vmpressure.c
vmscan.c mm: memcontrol: default hierarchy interface for memory 2015-02-11 17:06:02 -08:00
vmstat.c mm/vmstat.c: fix/cleanup ifdefs 2015-02-10 14:30:30 -08:00
workingset.c
zbud.c
zpool.c
zsmalloc.c
zswap.c