aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-28 00:17:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-28 00:17:55 -0500
commit54c0a4b46150db1571d955d598cd342c9f1d9657 (patch)
treefb5968daa68092779e7db3eb1ccd96829783dfc3 /mm
parent1b17366d695c8ab03f98d0155357e97a427e1dce (diff)
parentc2218e26c0d03c368fff825a6f15b7bb3418dbde (diff)
Merge branch 'akpm' (incoming from Andrew)
Merge misc updates from Andrew Morton: - a few hotfixes - dynamic-debug updates - ipc updates - various other sweepings off the factory floor * akpm: (31 commits) firmware/google: drop 'select EFI' to avoid recursive dependency compat: fix sys_fanotify_mark checkpatch.pl: check for function declarations without arguments mm/migrate.c: fix setting of cpupid on page migration twice against normal page softirq: use const char * const for softirq_to_name, whitespace neatening softirq: convert printks to pr_<level> softirq: use ffs() in __do_softirq() kernel/kexec.c: use vscnprintf() instead of vsnprintf() in vmcoreinfo_append_str() splice: fix unexpected size truncation ipc: fix compat msgrcv with negative msgtyp ipc,msg: document barriers ipc: delete seq_max field in struct ipc_ids ipc: simplify sysvipc_proc_open() return ipc: remove useless return statement ipc: remove braces for single statements ipc: standardize code comments ipc: whitespace cleanup ipc: change kern_ipc_perm.deleted type to bool ipc: introduce ipc_valid_object() helper to sort out IPC_RMID races ipc/sem.c: avoid overflow of semop undo (semadj) value ...
Diffstat (limited to 'mm')
-rw-r--r--mm/memblock.c6
-rw-r--r--mm/migrate.c2
-rw-r--r--mm/mm_init.c2
-rw-r--r--mm/vmalloc.c20
4 files changed, 11 insertions, 19 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 9c0aeef19440..87d21a6ff63c 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -984,9 +984,6 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
984 if (!align) 984 if (!align)
985 align = SMP_CACHE_BYTES; 985 align = SMP_CACHE_BYTES;
986 986
987 /* align @size to avoid excessive fragmentation on reserved array */
988 size = round_up(size, align);
989
990 found = memblock_find_in_range_node(size, align, 0, max_addr, nid); 987 found = memblock_find_in_range_node(size, align, 0, max_addr, nid);
991 if (found && !memblock_reserve(found, size)) 988 if (found && !memblock_reserve(found, size))
992 return found; 989 return found;
@@ -1080,9 +1077,6 @@ static void * __init memblock_virt_alloc_internal(
1080 if (!align) 1077 if (!align)
1081 align = SMP_CACHE_BYTES; 1078 align = SMP_CACHE_BYTES;
1082 1079
1083 /* align @size to avoid excessive fragmentation on reserved array */
1084 size = round_up(size, align);
1085
1086again: 1080again:
1087 alloc = memblock_find_in_range_node(size, align, min_addr, max_addr, 1081 alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
1088 nid); 1082 nid);
diff --git a/mm/migrate.c b/mm/migrate.c
index 734704f6f29b..482a33d89134 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1548,8 +1548,6 @@ static struct page *alloc_misplaced_dst_page(struct page *page,
1548 __GFP_NOMEMALLOC | __GFP_NORETRY | 1548 __GFP_NOMEMALLOC | __GFP_NORETRY |
1549 __GFP_NOWARN) & 1549 __GFP_NOWARN) &
1550 ~GFP_IOFS, 0); 1550 ~GFP_IOFS, 0);
1551 if (newpage)
1552 page_cpupid_xchg_last(newpage, page_cpupid_last(page));
1553 1551
1554 return newpage; 1552 return newpage;
1555} 1553}
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 857a6434e3a5..4074caf9936b 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -202,4 +202,4 @@ static int __init mm_sysfs_init(void)
202 202
203 return 0; 203 return 0;
204} 204}
205pure_initcall(mm_sysfs_init); 205postcore_initcall(mm_sysfs_init);
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index e4f0db2a3eae..0fdf96803c5b 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -220,12 +220,12 @@ int is_vmalloc_or_module_addr(const void *x)
220} 220}
221 221
222/* 222/*
223 * Walk a vmap address to the physical pfn it maps to. 223 * Walk a vmap address to the struct page it maps.
224 */ 224 */
225unsigned long vmalloc_to_pfn(const void *vmalloc_addr) 225struct page *vmalloc_to_page(const void *vmalloc_addr)
226{ 226{
227 unsigned long addr = (unsigned long) vmalloc_addr; 227 unsigned long addr = (unsigned long) vmalloc_addr;
228 unsigned long pfn = 0; 228 struct page *page = NULL;
229 pgd_t *pgd = pgd_offset_k(addr); 229 pgd_t *pgd = pgd_offset_k(addr);
230 230
231 /* 231 /*
@@ -244,23 +244,23 @@ unsigned long vmalloc_to_pfn(const void *vmalloc_addr)
244 ptep = pte_offset_map(pmd, addr); 244 ptep = pte_offset_map(pmd, addr);
245 pte = *ptep; 245 pte = *ptep;
246 if (pte_present(pte)) 246 if (pte_present(pte))
247 pfn = pte_pfn(pte); 247 page = pte_page(pte);
248 pte_unmap(ptep); 248 pte_unmap(ptep);
249 } 249 }
250 } 250 }
251 } 251 }
252 return pfn; 252 return page;
253} 253}
254EXPORT_SYMBOL(vmalloc_to_pfn); 254EXPORT_SYMBOL(vmalloc_to_page);
255 255
256/* 256/*
257 * Map a vmalloc()-space virtual address to the struct page. 257 * Map a vmalloc()-space virtual address to the physical page frame number.
258 */ 258 */
259struct page *vmalloc_to_page(const void *vmalloc_addr) 259unsigned long vmalloc_to_pfn(const void *vmalloc_addr)
260{ 260{
261 return pfn_to_page(vmalloc_to_pfn(vmalloc_addr)); 261 return page_to_pfn(vmalloc_to_page(vmalloc_addr));
262} 262}
263EXPORT_SYMBOL(vmalloc_to_page); 263EXPORT_SYMBOL(vmalloc_to_pfn);
264 264
265 265
266/*** Global kva allocator ***/ 266/*** Global kva allocator ***/