aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-27 08:42:53 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-21 09:40:02 -0700
commit4f5e387650ca965426a7b4681120988b4ba0e116 (patch)
treee60a4fb53d19aebe42c7f0d3b2649322cf94a8aa /mm/hugetlb.c
parent21c39e1874caf8f3e023828e5ce3951af5816e7e (diff)
downloadkernel_samsung_smdk4412-4f5e387650ca965426a7b4681120988b4ba0e116.zip
kernel_samsung_smdk4412-4f5e387650ca965426a7b4681120988b4ba0e116.tar.gz
kernel_samsung_smdk4412-4f5e387650ca965426a7b4681120988b4ba0e116.tar.bz2
percpu: pcpu_embed_first_chunk() should free unused parts after all allocs are complete
commit 42b64281453249dac52861f9b97d18552a7ec62b upstream. pcpu_embed_first_chunk() allocates memory for each node, copies percpu data and frees unused portions of it before proceeding to the next group. This assumes that allocations for different nodes doesn't overlap; however, depending on memory topology, the bootmem allocator may end up allocating memory from a different node than the requested one which may overlap with the portion freed from one of the previous percpu areas. This leads to percpu groups for different nodes overlapping which is a serious bug. This patch separates out copy & partial free from the allocation loop such that all allocations are complete before partial frees happen. This also fixes overlapping frees which could happen on allocation failure path - out_free_areas path frees whole groups but the groups could have portions freed at that point. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: "Pavel V. Panteleev" <pp_84@mail.ru> Tested-by: "Pavel V. Panteleev" <pp_84@mail.ru> LKML-Reference: <E1SNhwY-0007ui-V7.pp_84-mail-ru@f220.mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/hugetlb.c')
0 files changed, 0 insertions, 0 deletions