diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 22:05:45 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 22:05:45 -0500 |
| commit | df32e43a54d04eda35d2859beaf90e3864d53288 (patch) | |
| tree | 7a61cf658b2949bd426285eb9902be7758ced1ba /include/linux/bootmem.h | |
| parent | fbd918a2026d0464ce9c23f57b7de4bcfccdc2e6 (diff) | |
| parent | 78d5506e82b21a1a1de68c24182db2c2fe521422 (diff) | |
Merge branch 'akpm' (incoming from Andrew)
Merge first patch-bomb from Andrew Morton:
- a couple of misc things
- inotify/fsnotify work from Jan
- ocfs2 updates (partial)
- about half of MM
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (117 commits)
mm/migrate: remove unused function, fail_migrate_page()
mm/migrate: remove putback_lru_pages, fix comment on putback_movable_pages
mm/migrate: correct failure handling if !hugepage_migration_support()
mm/migrate: add comment about permanent failure path
mm, page_alloc: warn for non-blockable __GFP_NOFAIL allocation failure
mm: compaction: reset scanner positions immediately when they meet
mm: compaction: do not mark unmovable pageblocks as skipped in async compaction
mm: compaction: detect when scanners meet in isolate_freepages
mm: compaction: reset cached scanner pfn's before reading them
mm: compaction: encapsulate defer reset logic
mm: compaction: trace compaction begin and end
memcg, oom: lock mem_cgroup_print_oom_info
sched: add tracepoints related to NUMA task migration
mm: numa: do not automatically migrate KSM pages
mm: numa: trace tasks that fail migration due to rate limiting
mm: numa: limit scope of lock for NUMA migrate rate limiting
mm: numa: make NUMA-migrate related functions static
lib/show_mem.c: show num_poisoned_pages when oom
mm/hwpoison: add '#' to hwpoison_inject
mm/memblock: use WARN_ONCE when MAX_NUMNODES passed as input parameter
...
Diffstat (limited to 'include/linux/bootmem.h')
| -rw-r--r-- | include/linux/bootmem.h | 153 |
1 files changed, 152 insertions, 1 deletions
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index f1f07d31a3af..2fae55def608 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #define _LINUX_BOOTMEM_H | 5 | #define _LINUX_BOOTMEM_H |
| 6 | 6 | ||
| 7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
| 8 | #include <linux/mm_types.h> | ||
| 8 | #include <asm/dma.h> | 9 | #include <asm/dma.h> |
| 9 | 10 | ||
| 10 | /* | 11 | /* |
| @@ -52,7 +53,6 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
| 52 | unsigned long size); | 53 | unsigned long size); |
| 53 | extern void free_bootmem(unsigned long physaddr, unsigned long size); | 54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); |
| 54 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); | 55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); |
| 55 | extern void __free_pages_bootmem(struct page *page, unsigned int order); | ||
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
| @@ -142,6 +142,157 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
| 142 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 142 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
| 143 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) | 143 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) |
| 144 | 144 | ||
| 145 | |||
| 146 | #if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) | ||
| 147 | |||
| 148 | /* FIXME: use MEMBLOCK_ALLOC_* variants here */ | ||
| 149 | #define BOOTMEM_ALLOC_ACCESSIBLE 0 | ||
| 150 | #define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0) | ||
| 151 | |||
| 152 | /* FIXME: Move to memblock.h at a point where we remove nobootmem.c */ | ||
| 153 | void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size, | ||
| 154 | phys_addr_t align, phys_addr_t min_addr, | ||
| 155 | phys_addr_t max_addr, int nid); | ||
| 156 | void *memblock_virt_alloc_try_nid(phys_addr_t size, phys_addr_t align, | ||
| 157 | phys_addr_t min_addr, phys_addr_t max_addr, int nid); | ||
| 158 | void __memblock_free_early(phys_addr_t base, phys_addr_t size); | ||
| 159 | void __memblock_free_late(phys_addr_t base, phys_addr_t size); | ||
| 160 | |||
| 161 | static inline void * __init memblock_virt_alloc( | ||
| 162 | phys_addr_t size, phys_addr_t align) | ||
| 163 | { | ||
| 164 | return memblock_virt_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT, | ||
| 165 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 166 | NUMA_NO_NODE); | ||
| 167 | } | ||
| 168 | |||
| 169 | static inline void * __init memblock_virt_alloc_nopanic( | ||
| 170 | phys_addr_t size, phys_addr_t align) | ||
| 171 | { | ||
| 172 | return memblock_virt_alloc_try_nid_nopanic(size, align, | ||
| 173 | BOOTMEM_LOW_LIMIT, | ||
| 174 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 175 | NUMA_NO_NODE); | ||
| 176 | } | ||
| 177 | |||
| 178 | static inline void * __init memblock_virt_alloc_from_nopanic( | ||
| 179 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | ||
| 180 | { | ||
| 181 | return memblock_virt_alloc_try_nid_nopanic(size, align, min_addr, | ||
| 182 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 183 | NUMA_NO_NODE); | ||
| 184 | } | ||
| 185 | |||
| 186 | static inline void * __init memblock_virt_alloc_node( | ||
| 187 | phys_addr_t size, int nid) | ||
| 188 | { | ||
| 189 | return memblock_virt_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT, | ||
| 190 | BOOTMEM_ALLOC_ACCESSIBLE, nid); | ||
| 191 | } | ||
| 192 | |||
| 193 | static inline void * __init memblock_virt_alloc_node_nopanic( | ||
| 194 | phys_addr_t size, int nid) | ||
| 195 | { | ||
| 196 | return memblock_virt_alloc_try_nid_nopanic(size, 0, BOOTMEM_LOW_LIMIT, | ||
| 197 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 198 | nid); | ||
| 199 | } | ||
| 200 | |||
| 201 | static inline void __init memblock_free_early( | ||
| 202 | phys_addr_t base, phys_addr_t size) | ||
| 203 | { | ||
| 204 | __memblock_free_early(base, size); | ||
| 205 | } | ||
| 206 | |||
| 207 | static inline void __init memblock_free_early_nid( | ||
| 208 | phys_addr_t base, phys_addr_t size, int nid) | ||
| 209 | { | ||
| 210 | __memblock_free_early(base, size); | ||
| 211 | } | ||
| 212 | |||
| 213 | static inline void __init memblock_free_late( | ||
| 214 | phys_addr_t base, phys_addr_t size) | ||
| 215 | { | ||
| 216 | __memblock_free_late(base, size); | ||
| 217 | } | ||
| 218 | |||
| 219 | #else | ||
| 220 | |||
| 221 | #define BOOTMEM_ALLOC_ACCESSIBLE 0 | ||
| 222 | |||
| 223 | |||
| 224 | /* Fall back to all the existing bootmem APIs */ | ||
| 225 | static inline void * __init memblock_virt_alloc( | ||
| 226 | phys_addr_t size, phys_addr_t align) | ||
| 227 | { | ||
| 228 | if (!align) | ||
| 229 | align = SMP_CACHE_BYTES; | ||
| 230 | return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT); | ||
| 231 | } | ||
| 232 | |||
| 233 | static inline void * __init memblock_virt_alloc_nopanic( | ||
| 234 | phys_addr_t size, phys_addr_t align) | ||
| 235 | { | ||
| 236 | if (!align) | ||
| 237 | align = SMP_CACHE_BYTES; | ||
| 238 | return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT); | ||
| 239 | } | ||
| 240 | |||
| 241 | static inline void * __init memblock_virt_alloc_from_nopanic( | ||
| 242 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | ||
| 243 | { | ||
| 244 | return __alloc_bootmem_nopanic(size, align, min_addr); | ||
| 245 | } | ||
| 246 | |||
| 247 | static inline void * __init memblock_virt_alloc_node( | ||
| 248 | phys_addr_t size, int nid) | ||
| 249 | { | ||
| 250 | return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES, | ||
| 251 | BOOTMEM_LOW_LIMIT); | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline void * __init memblock_virt_alloc_node_nopanic( | ||
| 255 | phys_addr_t size, int nid) | ||
| 256 | { | ||
| 257 | return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size, | ||
| 258 | SMP_CACHE_BYTES, | ||
| 259 | BOOTMEM_LOW_LIMIT); | ||
| 260 | } | ||
| 261 | |||
| 262 | static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size, | ||
| 263 | phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid) | ||
| 264 | { | ||
| 265 | return __alloc_bootmem_node_high(NODE_DATA(nid), size, align, | ||
| 266 | min_addr); | ||
| 267 | } | ||
| 268 | |||
| 269 | static inline void * __init memblock_virt_alloc_try_nid_nopanic( | ||
| 270 | phys_addr_t size, phys_addr_t align, | ||
| 271 | phys_addr_t min_addr, phys_addr_t max_addr, int nid) | ||
| 272 | { | ||
| 273 | return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align, | ||
| 274 | min_addr, max_addr); | ||
| 275 | } | ||
| 276 | |||
| 277 | static inline void __init memblock_free_early( | ||
| 278 | phys_addr_t base, phys_addr_t size) | ||
| 279 | { | ||
| 280 | free_bootmem(base, size); | ||
| 281 | } | ||
| 282 | |||
| 283 | static inline void __init memblock_free_early_nid( | ||
| 284 | phys_addr_t base, phys_addr_t size, int nid) | ||
| 285 | { | ||
| 286 | free_bootmem_node(NODE_DATA(nid), base, size); | ||
| 287 | } | ||
| 288 | |||
| 289 | static inline void __init memblock_free_late( | ||
| 290 | phys_addr_t base, phys_addr_t size) | ||
| 291 | { | ||
| 292 | free_bootmem_late(base, size); | ||
| 293 | } | ||
| 294 | #endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */ | ||
| 295 | |||
| 145 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 296 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
| 146 | extern void *alloc_remap(int nid, unsigned long size); | 297 | extern void *alloc_remap(int nid, unsigned long size); |
| 147 | #else | 298 | #else |
