Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - a few misc things - ocfs2 updates - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (159 commits) tools/testing/selftests/proc/proc-self-syscall.c: remove duplicate include proc: more robust bulk read test proc: test /proc/*/maps, smaps, smaps_rollup, statm proc: use seq_puts() everywhere proc: read kernel cpu stat pointer once proc: remove unused argument in proc_pid_lookup() fs/proc/thread_self.c: code cleanup for proc_setup_thread_self() fs/proc/self.c: code cleanup for proc_setup_self() proc: return exit code 4 for skipped tests mm,mremap: bail out earlier in mremap_to under map pressure mm/sparse: fix a bad comparison mm/memory.c: do_fault: avoid usage of stale vm_area_struct writeback: fix inode cgroup switching comment mm/huge_memory.c: fix "orig_pud" set but not used mm/hotplug: fix an imbalance with DEBUG_PAGEALLOC mm/memcontrol.c: fix bad line in comment mm/cma.c: cma_declare_contiguous: correct err handling mm/page_ext.c: fix an imbalance with kmemleak mm/compaction: pass pgdat to too_many_isolated() instead of zone mm: remove zone_lru_lock() function, access ->lru_lock directly ...
This commit is contained in:
@@ -74,7 +74,7 @@ void __init build_cpu_to_node_map(void)
|
||||
cpumask_clear(&node_to_cpu_mask[node]);
|
||||
|
||||
for_each_possible_early_cpu(cpu) {
|
||||
node = -1;
|
||||
node = NUMA_NO_NODE;
|
||||
for (i = 0; i < NR_CPUS; ++i)
|
||||
if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
|
||||
node = node_cpuid[i].nid;
|
||||
|
@@ -583,17 +583,6 @@ pfm_put_task(struct task_struct *task)
|
||||
if (task != current) put_task_struct(task);
|
||||
}
|
||||
|
||||
static inline void
|
||||
pfm_reserve_page(unsigned long a)
|
||||
{
|
||||
SetPageReserved(vmalloc_to_page((void *)a));
|
||||
}
|
||||
static inline void
|
||||
pfm_unreserve_page(unsigned long a)
|
||||
{
|
||||
ClearPageReserved(vmalloc_to_page((void*)a));
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
pfm_protect_ctx_ctxsw(pfm_context_t *x)
|
||||
{
|
||||
@@ -816,44 +805,6 @@ pfm_reset_msgq(pfm_context_t *ctx)
|
||||
DPRINT(("ctx=%p msgq reset\n", ctx));
|
||||
}
|
||||
|
||||
static void *
|
||||
pfm_rvmalloc(unsigned long size)
|
||||
{
|
||||
void *mem;
|
||||
unsigned long addr;
|
||||
|
||||
size = PAGE_ALIGN(size);
|
||||
mem = vzalloc(size);
|
||||
if (mem) {
|
||||
//printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem);
|
||||
addr = (unsigned long)mem;
|
||||
while (size > 0) {
|
||||
pfm_reserve_page(addr);
|
||||
addr+=PAGE_SIZE;
|
||||
size-=PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
return mem;
|
||||
}
|
||||
|
||||
static void
|
||||
pfm_rvfree(void *mem, unsigned long size)
|
||||
{
|
||||
unsigned long addr;
|
||||
|
||||
if (mem) {
|
||||
DPRINT(("freeing physical buffer @%p size=%lu\n", mem, size));
|
||||
addr = (unsigned long) mem;
|
||||
while ((long) size > 0) {
|
||||
pfm_unreserve_page(addr);
|
||||
addr+=PAGE_SIZE;
|
||||
size-=PAGE_SIZE;
|
||||
}
|
||||
vfree(mem);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static pfm_context_t *
|
||||
pfm_context_alloc(int ctx_flags)
|
||||
{
|
||||
@@ -1498,7 +1449,7 @@ pfm_free_smpl_buffer(pfm_context_t *ctx)
|
||||
/*
|
||||
* free the buffer
|
||||
*/
|
||||
pfm_rvfree(ctx->ctx_smpl_hdr, ctx->ctx_smpl_size);
|
||||
vfree(ctx->ctx_smpl_hdr);
|
||||
|
||||
ctx->ctx_smpl_hdr = NULL;
|
||||
ctx->ctx_smpl_size = 0UL;
|
||||
@@ -2137,7 +2088,7 @@ doit:
|
||||
* All memory free operations (especially for vmalloc'ed memory)
|
||||
* MUST be done with interrupts ENABLED.
|
||||
*/
|
||||
if (smpl_buf_addr) pfm_rvfree(smpl_buf_addr, smpl_buf_size);
|
||||
vfree(smpl_buf_addr);
|
||||
|
||||
/*
|
||||
* return the memory used by the context
|
||||
@@ -2266,10 +2217,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
|
||||
|
||||
/*
|
||||
* We do the easy to undo allocations first.
|
||||
*
|
||||
* pfm_rvmalloc(), clears the buffer, so there is no leak
|
||||
*/
|
||||
smpl_buf = pfm_rvmalloc(size);
|
||||
smpl_buf = vzalloc(size);
|
||||
if (smpl_buf == NULL) {
|
||||
DPRINT(("Can't allocate sampling buffer\n"));
|
||||
return -ENOMEM;
|
||||
@@ -2346,7 +2295,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
|
||||
error:
|
||||
vm_area_free(vma);
|
||||
error_kmem:
|
||||
pfm_rvfree(smpl_buf, size);
|
||||
vfree(smpl_buf);
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@@ -227,7 +227,7 @@ void __init setup_per_cpu_areas(void)
|
||||
* CPUs are put into groups according to node. Walk cpu_map
|
||||
* and create new groups at node boundaries.
|
||||
*/
|
||||
prev_node = -1;
|
||||
prev_node = NUMA_NO_NODE;
|
||||
ai->nr_groups = 0;
|
||||
for (unit = 0; unit < nr_units; unit++) {
|
||||
cpu = cpu_map[unit];
|
||||
@@ -435,7 +435,7 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
u8 best = 0xff;
|
||||
int bestnode = -1, node, anynode = 0;
|
||||
int bestnode = NUMA_NO_NODE, node, anynode = 0;
|
||||
|
||||
for_each_online_node(node) {
|
||||
if (node_isset(node, memory_less_mask))
|
||||
@@ -447,7 +447,7 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)
|
||||
anynode = node;
|
||||
}
|
||||
|
||||
if (bestnode == -1)
|
||||
if (bestnode == NUMA_NO_NODE)
|
||||
bestnode = anynode;
|
||||
|
||||
ptr = memblock_alloc_try_nid(pernodesize, PERCPU_PAGE_SIZE,
|
||||
|
Reference in New Issue
Block a user