diff options
author | ddomingo <ddomingo@redhat.com> | 2009-03-09 18:49:41 +1000 |
---|---|---|
committer | ddomingo <ddomingo@redhat.com> | 2009-03-09 18:49:41 +1000 |
commit | 7516b286e0909504bd958ad2b8050d5d8afbd508 (patch) | |
tree | 72b7ecd89f80c278f3489119fa3bd26282e6e66a /runtime/alloc.c | |
parent | 2e802851f3c72d841fe436ec1e178d858bb37f6d (diff) | |
parent | f9355a6c0645c7efa0b7bc7894231b51b9f7e91c (diff) | |
download | systemtap-steved-7516b286e0909504bd958ad2b8050d5d8afbd508.tar.gz systemtap-steved-7516b286e0909504bd958ad2b8050d5d8afbd508.tar.xz systemtap-steved-7516b286e0909504bd958ad2b8050d5d8afbd508.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/alloc.c')
-rw-r--r-- | runtime/alloc.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/runtime/alloc.c b/runtime/alloc.c index 89d16612..439e8a7e 100644 --- a/runtime/alloc.c +++ b/runtime/alloc.c @@ -233,30 +233,14 @@ static void *_stp_vmalloc(unsigned long size) } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) static void *_stp_alloc_percpu(size_t size) { -#ifdef DEBUG_MEM +#ifdef STAPCONF_ALLOC_PERCPU_ALIGN void *ret = __alloc_percpu(size, 8); - if (likely(ret)) { - struct _stp_mem_entry *m = kmalloc(sizeof(struct _stp_mem_entry), STP_ALLOC_FLAGS); - if (unlikely(m == NULL)) { - free_percpu(ret); - return NULL; - } - _stp_mem_debug_percpu(m, ret, size); - _stp_allocated_memory += size * num_online_cpus(); - } - return ret; #else - return __alloc_percpu(size, 8); + void *ret = __alloc_percpu(size); #endif -} -#else -static void *_stp_alloc_percpu(size_t size) -{ #ifdef DEBUG_MEM - void *ret = __alloc_percpu(size); if (likely(ret)) { struct _stp_mem_entry *m = kmalloc(sizeof(struct _stp_mem_entry), STP_ALLOC_FLAGS); if (unlikely(m == NULL)) { @@ -266,12 +250,9 @@ static void *_stp_alloc_percpu(size_t size) _stp_mem_debug_percpu(m, ret, size); _stp_allocated_memory += size * num_online_cpus(); } - return ret; -#else - return __alloc_percpu(size); #endif + return ret; } -#endif /* LINUX_VERSION_CODE */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) #define _stp_kmalloc_node(size,node) _stp_kmalloc(size) |