wrapper: remove vmalloc_sync_all
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 15:09:13 +0000 (11:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 16:17:47 +0000 (12:17 -0400)
53 files changed:
lib/prio_heap/lttng_prio_heap.c
lib/ringbuffer/ring_buffer_backend.c
lib/ringbuffer/ring_buffer_frontend.c
lttng-abi.c
lttng-context-callstack.c
lttng-context-cgroup-ns.c
lttng-context-cpu-id.c
lttng-context-egid.c
lttng-context-euid.c
lttng-context-gid.c
lttng-context-hostname.c
lttng-context-interruptible.c
lttng-context-ipc-ns.c
lttng-context-migratable.c
lttng-context-mnt-ns.c
lttng-context-need-reschedule.c
lttng-context-net-ns.c
lttng-context-nice.c
lttng-context-perf-counters.c
lttng-context-pid-ns.c
lttng-context-pid.c
lttng-context-ppid.c
lttng-context-preemptible.c
lttng-context-prio.c
lttng-context-procname.c
lttng-context-sgid.c
lttng-context-suid.c
lttng-context-tid.c
lttng-context-uid.c
lttng-context-user-ns.c
lttng-context-uts-ns.c
lttng-context-vegid.c
lttng-context-veuid.c
lttng-context-vgid.c
lttng-context-vpid.c
lttng-context-vppid.c
lttng-context-vsgid.c
lttng-context-vsuid.c
lttng-context-vtid.c
lttng-context-vuid.c
lttng-context.c
lttng-events.c
lttng-ring-buffer-client.h
lttng-ring-buffer-metadata-client.h
lttng-syscalls.c
lttng-tracer.h
probes/lttng-kprobes.c
probes/lttng-kretprobes.c
probes/lttng-tracepoint-event-impl.h
probes/lttng-uprobes.c
probes/lttng.c
tests/probes/lttng-test.c
wrapper/vmalloc.h [deleted file]

index 04438bbfec52951c8b7a2b62f9ef56a24583e02d..4c62782f36552eb9905264193d0e4309ff4e82e3 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <linux/slab.h>
 #include <lib/prio_heap/lttng_prio_heap.h>
-#include <wrapper/vmalloc.h>
+#include <linux/mm.h>
 
 #ifdef DEBUG_HEAP
 void lttng_check_heap(const struct lttng_ptr_heap *heap)
@@ -54,12 +54,13 @@ int heap_grow(struct lttng_ptr_heap *heap, size_t new_len)
                return 0;
 
        heap->alloc_len = max_t(size_t, new_len, heap->alloc_len << 1);
-       new_ptrs = lttng_kvmalloc(heap->alloc_len * sizeof(void *), heap->gfpmask);
+       new_ptrs = kvmalloc_node(heap->alloc_len * sizeof(void *), heap->gfpmask,
+                                NUMA_NO_NODE);
        if (!new_ptrs)
                return -ENOMEM;
        if (heap->ptrs)
                memcpy(new_ptrs, heap->ptrs, heap->len * sizeof(void *));
-       lttng_kvfree(heap->ptrs);
+       kvfree(heap->ptrs);
        heap->ptrs = new_ptrs;
        return 0;
 }
@@ -93,7 +94,7 @@ int lttng_heap_init(struct lttng_ptr_heap *heap, size_t alloc_len,
 
 void lttng_heap_free(struct lttng_ptr_heap *heap)
 {
-       lttng_kvfree(heap->ptrs);
+       kvfree(heap->ptrs);
 }
 
 static void heapify(struct lttng_ptr_heap *heap, size_t i)
index 468b0e9b86715809dbb7876c64a246a00f401cf0..435129cf9372e9f43247a87a496d4d5968ef09ba 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/vmalloc.h>
 
 #include <wrapper/mm.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <wrapper/ringbuffer/config.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/ringbuffer/frontend.h>
@@ -78,14 +77,13 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config
        if (unlikely(!pages))
                goto pages_error;
 
-       bufb->array = lttng_kvmalloc_node(ALIGN(sizeof(*bufb->array)
-                                        * num_subbuf_alloc,
-                                 1 << INTERNODE_CACHE_SHIFT),
+       bufb->array = kvmalloc_node(ALIGN(sizeof(*bufb->array)
+                                   * num_subbuf_alloc,
+                                   1 << INTERNODE_CACHE_SHIFT),
                        GFP_KERNEL | __GFP_NOWARN,
                        cpu_to_node(max(bufb->cpu, 0)));
        if (unlikely(!bufb->array))
                goto array_error;
-
        for (i = 0; i < num_pages; i++) {
                pages[i] = alloc_pages_node(cpu_to_node(max(bufb->cpu, 0)),
                                GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, 0);
@@ -97,7 +95,7 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config
        /* Allocate backend pages array elements */
        for (i = 0; i < num_subbuf_alloc; i++) {
                bufb->array[i] =
-                       lttng_kvzalloc_node(ALIGN(
+                       kvzalloc_node(ALIGN(
                                sizeof(struct lib_ring_buffer_backend_pages) +
                                sizeof(struct lib_ring_buffer_backend_page)
                                * num_pages_per_subbuf,
@@ -109,7 +107,7 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config
        }
 
        /* Allocate write-side subbuffer table */
-       bufb->buf_wsb = lttng_kvzalloc_node(ALIGN(
+       bufb->buf_wsb = kvzalloc_node(ALIGN(
                                sizeof(struct lib_ring_buffer_backend_subbuffer)
                                * num_subbuf,
                                1 << INTERNODE_CACHE_SHIFT),
@@ -129,7 +127,7 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config
                bufb->buf_rsb.id = subbuffer_id(config, 0, 1, 0);
 
        /* Allocate subbuffer packet counter table */
-       bufb->buf_cnt = lttng_kvzalloc_node(ALIGN(
+       bufb->buf_cnt = kvzalloc_node(ALIGN(
                                sizeof(struct lib_ring_buffer_backend_counts)
                                * num_subbuf,
                                1 << INTERNODE_CACHE_SHIFT),
@@ -152,25 +150,20 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config
                }
        }
 
-       /*
-        * If kmalloc ever uses vmalloc underneath, make sure the buffer pages
-        * will not fault.
-        */
-       wrapper_vmalloc_sync_all();
        wrapper_clear_current_oom_origin();
        vfree(pages);
        return 0;
 
 free_wsb:
-       lttng_kvfree(bufb->buf_wsb);
+       kvfree(bufb->buf_wsb);
 free_array:
        for (i = 0; (i < num_subbuf_alloc && bufb->array[i]); i++)
-               lttng_kvfree(bufb->array[i]);
+               kvfree(bufb->array[i]);
 depopulate:
        /* Free all allocated pages */
        for (i = 0; (i < num_pages && pages[i]); i++)
                __free_page(pages[i]);
-       lttng_kvfree(bufb->array);
+       kvfree(bufb->array);
 array_error:
        vfree(pages);
 pages_error:
@@ -201,14 +194,14 @@ void lib_ring_buffer_backend_free(struct lib_ring_buffer_backend *bufb)
        if (chanb->extra_reader_sb)
                num_subbuf_alloc++;
 
-       lttng_kvfree(bufb->buf_wsb);
-       lttng_kvfree(bufb->buf_cnt);
+       kvfree(bufb->buf_wsb);
+       kvfree(bufb->buf_cnt);
        for (i = 0; i < num_subbuf_alloc; i++) {
                for (j = 0; j < bufb->num_pages_per_subbuf; j++)
                        __free_page(pfn_to_page(bufb->array[i]->p[j].pfn));
-               lttng_kvfree(bufb->array[i]);
+               kvfree(bufb->array[i]);
        }
-       lttng_kvfree(bufb->array);
+       kvfree(bufb->array);
        bufb->allocated = 0;
 }
 
index 91cf0ae5ee0042e4cc920d3652242cbf6a5b89f1..f939787837c6fbb46ab501fcf75ff6c7d81c586a 100644 (file)
@@ -51,7 +51,6 @@
 #include <wrapper/kref.h>
 #include <wrapper/percpu-defs.h>
 #include <wrapper/timer.h>
-#include <wrapper/vmalloc.h>
 
 /*
  * Internal structure representing offsets to use at a sub-buffer switch.
@@ -134,9 +133,9 @@ void lib_ring_buffer_free(struct lib_ring_buffer *buf)
        struct channel *chan = buf->backend.chan;
 
        lib_ring_buffer_print_errors(chan, buf, buf->backend.cpu);
-       lttng_kvfree(buf->commit_hot);
-       lttng_kvfree(buf->commit_cold);
-       lttng_kvfree(buf->ts_end);
+       kvfree(buf->commit_hot);
+       kvfree(buf->commit_cold);
+       kvfree(buf->ts_end);
 
        lib_ring_buffer_backend_free(&buf->backend);
 }
@@ -234,7 +233,7 @@ int lib_ring_buffer_create(struct lib_ring_buffer *buf,
                return ret;
 
        buf->commit_hot =
-               lttng_kvzalloc_node(ALIGN(sizeof(*buf->commit_hot)
+               kvzalloc_node(ALIGN(sizeof(*buf->commit_hot)
                                   * chan->backend.num_subbuf,
                                   1 << INTERNODE_CACHE_SHIFT),
                        GFP_KERNEL | __GFP_NOWARN,
@@ -245,7 +244,7 @@ int lib_ring_buffer_create(struct lib_ring_buffer *buf,
        }
 
        buf->commit_cold =
-               lttng_kvzalloc_node(ALIGN(sizeof(*buf->commit_cold)
+               kvzalloc_node(ALIGN(sizeof(*buf->commit_cold)
                                   * chan->backend.num_subbuf,
                                   1 << INTERNODE_CACHE_SHIFT),
                        GFP_KERNEL | __GFP_NOWARN,
@@ -256,7 +255,7 @@ int lib_ring_buffer_create(struct lib_ring_buffer *buf,
        }
 
        buf->ts_end =
-               lttng_kvzalloc_node(ALIGN(sizeof(*buf->ts_end)
+               kvzalloc_node(ALIGN(sizeof(*buf->ts_end)
                                   * chan->backend.num_subbuf,
                                   1 << INTERNODE_CACHE_SHIFT),
                        GFP_KERNEL | __GFP_NOWARN,
@@ -300,16 +299,15 @@ int lib_ring_buffer_create(struct lib_ring_buffer *buf,
                             chan->backend.cpumask));
                cpumask_set_cpu(cpu, chan->backend.cpumask);
        }
-
        return 0;
 
        /* Error handling */
 free_init:
-       lttng_kvfree(buf->ts_end);
+       kvfree(buf->ts_end);
 free_commit_cold:
-       lttng_kvfree(buf->commit_cold);
+       kvfree(buf->commit_cold);
 free_commit:
-       lttng_kvfree(buf->commit_hot);
+       kvfree(buf->commit_hot);
 free_chanbuf:
        lib_ring_buffer_backend_free(&buf->backend);
        return ret;
index 590945c4e8ee146dd52184b0413e6cdd1a326ee1..baaf34d31952a2b0db6b732fc0c580891a059b35 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/uaccess.h>
 #include <linux/slab.h>
 #include <linux/err.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <wrapper/ringbuffer/vfs.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/ringbuffer/frontend.h>
@@ -1938,7 +1937,6 @@ int __init lttng_abi_init(void)
 {
        int ret = 0;
 
-       wrapper_vmalloc_sync_all();
        lttng_clock_ref();
 
        ret = lttng_tp_mempool_init();
index 317efdf4f7eeb9b438f0679e8f46f2610fe6e8c3..9db3471dac421f4a8aec49b1adbcc2bd43bdde2e 100644 (file)
@@ -46,7 +46,6 @@
 #include "lttng-events.h"
 #include "wrapper/ringbuffer/backend.h"
 #include "wrapper/ringbuffer/frontend.h"
-#include "wrapper/vmalloc.h"
 #include "lttng-tracer.h"
 #include "lttng-endian.h"
 
@@ -152,7 +151,6 @@ int __lttng_add_callstack_generic(struct lttng_ctx **ctx,
        sequence_field->priv = fdata;
        sequence_field->destroy = lttng_callstack_sequence_destroy;
 
-       wrapper_vmalloc_sync_all();
        return 0;
 
 error_create:
index a7f4e80f6565068b824efc0a526a7864a81689b5..0c284966bcb97607e9997b835d6848484d1e2bf9 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/cgroup.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/namespace.h>
 #include <lttng-tracer.h>
 
@@ -97,7 +96,6 @@ int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = cgroup_ns_record;
        field->get_value = cgroup_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_cgroup_ns_to_ctx);
index d3d55b8891a8516eccc670bd125541e8216563ae..18e0508a60f9d018098bf5c912eff1fa9d1dc448 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -68,7 +67,6 @@ int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx)
        field->record = cpu_id_record;
        field->get_value = cpu_id_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_cpu_id_to_ctx);
index fcd01461fdbacf5aa21aaf89fb8c7f2ece377617..5dd581eab21f2c8506ce2c001fbe470923236096 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_egid_to_ctx(struct lttng_ctx **ctx)
        field->record = egid_record;
        field->get_value = egid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_egid_to_ctx);
index b4b72184ea18c3a9b50fb42c3c2607f2b6010065..d14f310e52f5d92a736f808b0dbfd90a9f3bb127 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_euid_to_ctx(struct lttng_ctx **ctx)
        field->record = euid_record;
        field->get_value = euid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_euid_to_ctx);
index 586934ed5b960a1b57cb7478c1621170f5cae4d1..195efbb09667db5cbe323d10dafd2ad8b109ada2 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_gid_to_ctx(struct lttng_ctx **ctx)
        field->record = gid_record;
        field->get_value = gid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_gid_to_ctx);
index 0bbb1c78d78f3479000d1672585187408e3dbccf..8462da4199f207fbdb2346255fb1ba42b57b86f1 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/utsname.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 #define LTTNG_HOSTNAME_CTX_LEN (__NEW_UTS_LEN + 1)
@@ -100,7 +99,6 @@ int lttng_add_hostname_to_ctx(struct lttng_ctx **ctx)
        field->record = hostname_record;
        field->get_value = hostname_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_hostname_to_ctx);
index c07cba18f984ce30cc5e23c57fbb2928269940b1..67081db42e1362fbec4c87baf56b6282dd9af903 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/irqflags.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 /*
@@ -75,7 +74,6 @@ int lttng_add_interruptible_to_ctx(struct lttng_ctx **ctx)
        field->record = interruptible_record;
        field->get_value = interruptible_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_interruptible_to_ctx);
index cccd976602b7ec97118d50d959eae28731aa878d..09d8f2e3c2fb70439b5d9e3e9a2ee586593a51e0 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/ipc_namespace.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/namespace.h>
 #include <lttng-tracer.h>
 
@@ -96,7 +95,6 @@ int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = ipc_ns_record;
        field->get_value = ipc_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_ipc_ns_to_ctx);
index 1a0dc4a13bd15d7de53a7bdee8e58ead9dd9bc48..c8147dd864dae7d1d61dca8de97f17ad0ccd996c 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/irqflags.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -68,7 +67,6 @@ int lttng_add_migratable_to_ctx(struct lttng_ctx **ctx)
        field->record = migratable_record;
        field->get_value = migratable_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_migratable_to_ctx);
index 029401396cf24a73122be447a549e31b078caefc..72e8efa1ffcf101464e3229afc5a04ea639b0c84 100644 (file)
@@ -15,7 +15,6 @@
 #include <lttng-events.h>
 #include <linux/nsproxy.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/namespace.h>
 #include <lttng-tracer.h>
 
@@ -98,7 +97,6 @@ int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = mnt_ns_record;
        field->get_value = mnt_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_mnt_ns_to_ctx);
index 9a51f0c60714df4a47f05dd1b56be406f6c17a06..ba30261e95da0cfc56e7a5be9224872413768590 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/irqflags.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -68,7 +67,6 @@ int lttng_add_need_reschedule_to_ctx(struct lttng_ctx **ctx)
        field->record = need_reschedule_record;
        field->get_value = need_reschedule_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_need_reschedule_to_ctx);
index 4584991f2e0b582e077f2769e9976d09c43f2325..6cdd622a5518785a5ded4d86c470ee54bba326a9 100644 (file)
@@ -16,7 +16,6 @@
 #include <net/net_namespace.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/namespace.h>
 #include <lttng-tracer.h>
 
@@ -97,7 +96,6 @@ int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = net_ns_record;
        field->get_value = net_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_net_ns_to_ctx);
index 89283d0f82472f4434ddaff91df029ed30ce4186..2eefec34568117506e9a8b3cb457c28c89a38885 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -68,7 +67,6 @@ int lttng_add_nice_to_ctx(struct lttng_ctx **ctx)
        field->record = nice_record;
        field->get_value = nice_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_nice_to_ctx);
index 1c5ab9fbc99e67b6a455aad9c1cf19693b3eadde..8625842cd171158aba762061fbca4853c8e7a9f7 100644 (file)
@@ -13,9 +13,9 @@
 #include <linux/list.h>
 #include <linux/string.h>
 #include <linux/cpu.h>
+#include <linux/mm.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/perf.h>
 #include <lttng-tracer.h>
 
@@ -106,7 +106,7 @@ void lttng_destroy_perf_counter_field(struct lttng_ctx_field *field)
 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
        kfree(field->event_field.name);
        kfree(field->u.perf_counter->attr);
-       lttng_kvfree(events);
+       kvfree(events);
        kfree(field->u.perf_counter);
 }
 
@@ -224,7 +224,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
        int ret;
        char *name_alloc;
 
-       events = lttng_kvzalloc(num_possible_cpus() * sizeof(*events), GFP_KERNEL);
+       events = kvzalloc(num_possible_cpus() * sizeof(*events), GFP_KERNEL);
        if (!events)
                return -ENOMEM;
 
@@ -321,7 +321,6 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
        field->u.perf_counter = perf_field;
        lttng_context_update(*ctx);
 
-       wrapper_vmalloc_sync_all();
        return 0;
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
@@ -359,6 +358,6 @@ name_alloc_error:
 error_alloc_perf_field:
        kfree(attr);
 error_attr:
-       lttng_kvfree(events);
+       kvfree(events);
        return ret;
 }
index e4d3a3a3a5331840a15b7bad6392390cb9e20613..cb1ee0d4d3b9eb6cb5996a442a11e2d9ea1676f8 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/pid_namespace.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/namespace.h>
 #include <lttng-tracer.h>
 
@@ -98,7 +97,6 @@ int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = pid_ns_record;
        field->get_value = pid_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_pid_ns_to_ctx);
index 3cdc51284588994a164c38bbdc72b7dfe5d4ed6d..fc7cf255ecda52508d7e88c019e6417b0fd09366 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -68,7 +67,6 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx)
        field->record = pid_record;
        field->get_value = pid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_pid_to_ctx);
index 8935fad019256b5aeef441a6fcec2afeeee2c1cc..bba8f6577efcf33e7462855b27b7b20fae97e23c 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/syscalls.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -90,7 +89,6 @@ int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx)
        field->record = ppid_record;
        field->get_value = ppid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_ppid_to_ctx);
index 6a40f03a266bf44d66fa474c8ef84db26ec9a515..40b2205ef48df52b61eea09f6d3e0d685b050835 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/irqflags.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 /*
@@ -86,7 +85,6 @@ int lttng_add_preemptible_to_ctx(struct lttng_ctx **ctx)
        field->record = preemptible_record;
        field->get_value = preemptible_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_preemptible_to_ctx);
index 9cd843d5437e45af1a2afe9fd924cff247dcc254..23fa9d3a0b38e0ccce945bf881d6d5c50cc3b95c 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/kallsyms.h>
 #include <lttng-tracer.h>
 
@@ -89,7 +88,6 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx)
        field->record = prio_record;
        field->get_value = prio_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_prio_to_ctx);
index 8e4bbf97b52bb8485cc2f7b99c252a247bdb0f5a..40b23dbfa37f651bbee2c682e0ea8a980c1c9d62 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 #include <lttng-endian.h>
 
@@ -71,7 +70,6 @@ int lttng_add_procname_to_ctx(struct lttng_ctx **ctx)
        field->record = procname_record;
        field->get_value = procname_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_procname_to_ctx);
index 4f58a14f680e4332d33420529a52c1a5f942bf62..fae736da9cd9217dca4d3b1ca9a6139302bb63d7 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_sgid_to_ctx(struct lttng_ctx **ctx)
        field->record = sgid_record;
        field->get_value = sgid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_sgid_to_ctx);
index 4b8477e50a9655613daf664ebe488d988d4e083f..60b08c43f9ab93f39ee5aa89c45fea86ea217b31 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_suid_to_ctx(struct lttng_ctx **ctx)
        field->record = suid_record;
        field->get_value = suid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_suid_to_ctx);
index 5f8e68fac7e6fa4386fce87fc2006923e7973ff6..48c307b09fadb134fb97b96a47152d28c021d658 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -71,7 +70,6 @@ int lttng_add_tid_to_ctx(struct lttng_ctx **ctx)
        field->record = tid_record;
        field->get_value = tid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_tid_to_ctx);
index c7a2bb180bad663b60737e346e04059dcee4b28b..0baa2d633034a99b0cce9af15c2535be1db412dd 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_uid_to_ctx(struct lttng_ctx **ctx)
        field->record = uid_record;
        field->get_value = uid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_uid_to_ctx);
index ff56f551ae5e1ac4aaccabeccbdc45f8863e0b47..bb08f8c18cbba6d69ec4ed2235416603b2908d92 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/user_namespace.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/namespace.h>
 #include <lttng-tracer.h>
 
@@ -82,7 +81,6 @@ int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = user_ns_record;
        field->get_value = user_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_user_ns_to_ctx);
index 67c42764fcc84cce391050639e120d495657a7dc..c6c6d072ba6dfbb619046bab2970484fed6702bd 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/utsname.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/namespace.h>
 #include <lttng-tracer.h>
 
@@ -96,7 +95,6 @@ int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = uts_ns_record;
        field->get_value = uts_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_uts_ns_to_ctx);
index 501b01e6eb425411e5924e24dd7d6c0db06f3e75..1330a4f60fabba9391aee9fdc9e8e6397f051882 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx)
        field->record = vegid_record;
        field->get_value = vegid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vegid_to_ctx);
index a8810a770f7c0fda9b0d94f71cd6175bab0e1a61..28b7d3b24d743fd0b65edccacd0aeae720b5d46b 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx)
        field->record = veuid_record;
        field->get_value = veuid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_veuid_to_ctx);
index 92ac567b828b1a8f8ec615252d647696e400c5a7..6f35e8408ed6dc51c3767dacbc26dca5d7e0ad7e 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx)
        field->record = vgid_record;
        field->get_value = vgid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vgid_to_ctx);
index 31a2c15e48dee190e08ca1120205521d01b5c89b..4093675e5589478a2de36391175deca8f980bbbf 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -83,7 +82,6 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
        field->record = vpid_record;
        field->get_value = vpid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vpid_to_ctx);
index 43bfcc1249e10d8901ed7e264ffbbd24d659aad7..f8d66c917deec417ef329831368c7c67670f85f7 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/syscalls.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -112,7 +111,6 @@ int lttng_add_vppid_to_ctx(struct lttng_ctx **ctx)
        field->record = vppid_record;
        field->get_value = vppid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vppid_to_ctx);
index 20987ddec5fc1dec255f7a83dd91636bb91177e2..25221ca6616547fe834a57265235c22ba7698334 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx)
        field->record = vsgid_record;
        field->get_value = vsgid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vsgid_to_ctx);
index 7cefd53532f95387e574ec15b8f69f25f11ce0fc..d5677ba92a6afded951958a22b7b9fcb02b71cca 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx)
        field->record = vsuid_record;
        field->get_value = vsuid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vsuid_to_ctx);
index a7da7d2efa320e23c70a1871aa70e6a867efd90c..dc0e99b99bfb7517c200d5de97c144850f1eee89 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/sched.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer.h>
 
 static
@@ -83,7 +82,6 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx)
        field->record = vtid_record;
        field->get_value = vtid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vtid_to_ctx);
index 427ada715c1f9db437d5e538084f85c7feed570b..f62964ed15c607b6b84195a4a10b7364f2394ecb 100644 (file)
@@ -14,7 +14,6 @@
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/user_namespace.h>
 
 static
@@ -70,7 +69,6 @@ int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx)
        field->record = vuid_record;
        field->get_value = vuid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vuid_to_ctx);
index 54fa447848177770d47e309d6eb52e60477cabb5..9f84172799c99f171f292ec00228a34393869fba 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 
@@ -82,12 +81,13 @@ struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p)
                struct lttng_ctx_field *new_fields;
 
                ctx->allocated_fields = max_t(size_t, 1, 2 * ctx->allocated_fields);
-               new_fields = lttng_kvzalloc(ctx->allocated_fields * sizeof(struct lttng_ctx_field), GFP_KERNEL);
+               new_fields = kvzalloc_node(ctx->allocated_fields * sizeof(struct lttng_ctx_field),
+                                          GFP_KERNEL, NUMA_NO_NODE);
                if (!new_fields)
                        return NULL;
                if (ctx->fields)
                        memcpy(new_fields, ctx->fields, sizeof(*ctx->fields) * ctx->nr_fields);
-               lttng_kvfree(ctx->fields);
+               kvfree(ctx->fields);
                ctx->fields = new_fields;
        }
        field = &ctx->fields[ctx->nr_fields];
@@ -205,7 +205,7 @@ void lttng_destroy_context(struct lttng_ctx *ctx)
                if (ctx->fields[i].destroy)
                        ctx->fields[i].destroy(&ctx->fields[i]);
        }
-       lttng_kvfree(ctx->fields);
+       kvfree(ctx->fields);
        kfree(ctx);
 }
 
index 1ca4d519b817730ea03b5c88da307ee40a36c10d..aa0f2e2abc3fa9632f16353f374d5aa5bb2ad8dd 100644 (file)
 #include <wrapper/file.h>
 #include <linux/jhash.h>
 #include <linux/uaccess.h>
-#include <linux/vmalloc.h>
 #include <linux/uuid.h>
 #include <linux/dmi.h>
+#include <linux/vmalloc.h>
 
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <wrapper/random.h>
 #include <wrapper/tracepoint.h>
 #include <wrapper/list.h>
@@ -129,7 +128,8 @@ struct lttng_session *lttng_session_create(void)
        int i;
 
        mutex_lock(&sessions_mutex);
-       session = lttng_kvzalloc(sizeof(struct lttng_session), GFP_KERNEL);
+       session = kvzalloc_node(sizeof(struct lttng_session), GFP_KERNEL,
+                               NUMA_NO_NODE);
        if (!session)
                goto err;
        INIT_LIST_HEAD(&session->chan);
@@ -172,7 +172,7 @@ struct lttng_session *lttng_session_create(void)
 err_free_cache:
        kfree(metadata_cache);
 err_free_session:
-       lttng_kvfree(session);
+       kvfree(session);
 err:
        mutex_unlock(&sessions_mutex);
        return NULL;
@@ -225,7 +225,7 @@ void lttng_session_destroy(struct lttng_session *session)
        kref_put(&session->metadata_cache->refcount, metadata_cache_destroy);
        list_del(&session->list);
        mutex_unlock(&sessions_mutex);
-       lttng_kvfree(session);
+       kvfree(session);
 }
 
 int lttng_session_statedump(struct lttng_session *session)
@@ -2793,22 +2793,10 @@ end:
  * @transport: transport structure
  *
  * Registers a transport which can be used as output to extract the data out of
- * LTTng. The module calling this registration function must ensure that no
- * trap-inducing code will be executed by the transport functions. E.g.
- * vmalloc_sync_all() must be called between a vmalloc and the moment the memory
- * is made visible to the transport function. This registration acts as a
- * vmalloc_sync_all. Therefore, only if the module allocates virtual memory
- * after its registration must it synchronize the TLBs.
+ * LTTng.
  */
 void lttng_transport_register(struct lttng_transport *transport)
 {
-       /*
-        * Make sure no page fault can be triggered by the module about to be
-        * registered. We deal with this here so we don't have to call
-        * vmalloc_sync_all() in each module's init.
-        */
-       wrapper_vmalloc_sync_all();
-
        mutex_lock(&sessions_mutex);
        list_add_tail(&transport->node, &lttng_transport_list);
        mutex_unlock(&sessions_mutex);
index f11c606b4eb07a5e24da081df8dda718278419d0..05cab588b987b1d571c7f48aaaee500a1f638846 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <lib/bitfield.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <wrapper/trace-clock.h>
 #include <lttng-events.h>
 #include <lttng-tracer.h>
@@ -762,11 +761,6 @@ static struct lttng_transport lttng_relay_transport = {
 
 static int __init lttng_ring_buffer_client_init(void)
 {
-       /*
-        * This vmalloc sync all also takes care of the lib ring buffer
-        * vmalloc'd module pages when it is built as a module into LTTng.
-        */
-       wrapper_vmalloc_sync_all();
        lttng_transport_register(&lttng_relay_transport);
        return 0;
 }
index 4c10297509d13fe11e49dff8e618c050b36f95c3..aef77806d8f997d2f934a0d9f14d4df12ea6573f 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/module.h>
 #include <linux/types.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 
@@ -423,11 +422,6 @@ static struct lttng_transport lttng_relay_transport = {
 
 static int __init lttng_ring_buffer_client_init(void)
 {
-       /*
-        * This vmalloc sync all also takes care of the lib ring buffer
-        * vmalloc'd module pages when it is built as a module into LTTng.
-        */
-       wrapper_vmalloc_sync_all();
        lttng_transport_register(&lttng_relay_transport);
        return 0;
 }
index a43c475e7b7f1f744018fd77f6ea179177ac7290..3d2025eb35525f9a2f601e7379e7899aaf24179a 100644 (file)
@@ -761,8 +761,6 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
        struct lttng_kernel_event ev;
        int ret;
 
-       wrapper_vmalloc_sync_all();
-
        if (!chan->sc_table) {
                /* create syscall table mapping syscall to events */
                chan->sc_table = kzalloc(sizeof(struct lttng_event *)
index 197e28af762c8527bf7dc060bade28fb46223b69..5490d52c664c23fb57c9c84521affadddb8f7ed9 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <wrapper/trace-clock.h>
 #include <wrapper/compiler.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-tracer-core.h>
 #include <lttng-events.h>
 
index 40fe0f68d54e41e8d032ece226ef117cbf06a416..e3f82ad354f4dbc2787ee6b03af146218c246796 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/slab.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/irqflags.h>
 #include <lttng-tracer.h>
 #include <blacklist/kprobes.h>
@@ -127,13 +126,6 @@ int lttng_kprobes_register(const char *name,
        event->u.kprobe.kp.offset = offset;
        event->u.kprobe.kp.addr = (void *) (unsigned long) addr;
 
-       /*
-        * Ensure the memory we just allocated don't trigger page faults.
-        * Well.. kprobes itself puts the page fault handler on the blacklist,
-        * but we can never be too careful.
-        */
-       wrapper_vmalloc_sync_all();
-
        ret = register_kprobe(&event->u.kprobe.kp);
        if (ret)
                goto register_error;
index 40938f2b7110bd5506862d982ee8deca997bc614..d208292622135ec5a36ae11166c395bbeb149062 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/kref.h>
 #include <lttng-events.h>
 #include <wrapper/ringbuffer/frontend_types.h>
-#include <wrapper/vmalloc.h>
 #include <wrapper/irqflags.h>
 #include <lttng-tracer.h>
 #include <blacklist/kprobes.h>
@@ -216,13 +215,6 @@ int lttng_kretprobes_register(const char *name,
        kref_init(&lttng_krp->kref_register);
        kref_get(&lttng_krp->kref_register);    /* inc refcount to 2, no overflow. */
 
-       /*
-        * Ensure the memory we just allocated don't trigger page faults.
-        * Well.. kprobes itself puts the page fault handler on the blacklist,
-        * but we can never be too careful.
-        */
-       wrapper_vmalloc_sync_all();
-
        ret = register_kretprobe(&lttng_krp->krp);
        if (ret)
                goto register_error;
index 5f77bf4d5405f6c8c50bc06f99e5a166869f4765..cbb9cbae78f9007029fcdac4f92f8be33d0d545d 100644 (file)
@@ -15,7 +15,6 @@
 #include <probes/lttng.h>
 #include <probes/lttng-types.h>
 #include <probes/lttng-probe-user.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
 #include <wrapper/ringbuffer/frontend_types.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/rcu.h>
@@ -1414,7 +1413,6 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
 #ifndef TP_MODULE_NOINIT
 static int TP_ID(__lttng_events_init__, TRACE_SYSTEM)(void)
 {
-       wrapper_vmalloc_sync_all();
        return lttng_probe_register(&TP_ID(__probe_desc___, TRACE_SYSTEM));
 }
 
index 175c0dd9d5993ddcfb63865a6971715b6f94e504..330fae8ab827ca3fe3b3c83db7b94441eea64333 100644 (file)
@@ -20,7 +20,6 @@
 #include <wrapper/irqflags.h>
 #include <wrapper/ringbuffer/frontend_types.h>
 #include <wrapper/uprobes.h>
-#include <wrapper/vmalloc.h>
 
 static
 int lttng_uprobes_handler_pre(struct uprobe_consumer *uc, struct pt_regs *regs)
@@ -160,9 +159,6 @@ int lttng_uprobes_add_callsite(struct lttng_event *event,
                goto end;
        }
 
-       /* Ensure the memory we just allocated don't trigger page faults. */
-       wrapper_vmalloc_sync_all();
-
        uprobe_handler->event = event;
        uprobe_handler->up_consumer.handler = lttng_uprobes_handler_pre;
 
index 160e0bcdfcd8f0bea737b17fbe40f5d08250126c..7a2a74a1e8a36cf481e9bb95d49d24c4aa229a1f 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/miscdevice.h>
-#include <wrapper/vmalloc.h>
 #include <lttng-events.h>
 
 #define TP_MODULE_NOAUTOLOAD
@@ -116,8 +115,6 @@ int __init lttng_logger_init(void)
 {
        int ret = 0;
 
-       wrapper_vmalloc_sync_all();
-
        /* /dev/lttng-logger */
        ret = misc_register(&logger_dev);
        if (ret) {
index cfdacc9404df9428541348edc7b6418abb5ff9ce..2219f86d399b8e395fefe126dac02923a9d03445 100644 (file)
@@ -97,7 +97,6 @@ int __init lttng_test_init(void)
        int ret = 0;
 
        (void) wrapper_lttng_fixup_sig(THIS_MODULE);
-       wrapper_vmalloc_sync_all();
        lttng_test_filter_event_dentry =
                        proc_create_data(LTTNG_TEST_FILTER_EVENT_FILE,
                                S_IRUGO | S_IWUGO, NULL,
diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h
deleted file mode 100644 (file)
index 80deacf..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/vmalloc.h
- *
- * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when
- * available, else we need to have a kernel that exports this function to GPL
- * modules.
- *
- * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_VMALLOC_H
-#define _LTTNG_WRAPPER_VMALLOC_H
-
-#include <linux/version.h>
-#include <linux/vmalloc.h>
-#include <linux/mm.h>
-
-#ifdef CONFIG_KALLSYMS
-
-#include <linux/kallsyms.h>
-#include <wrapper/kallsyms.h>
-
-static inline
-void wrapper_vmalloc_sync_all(void)
-{
-       void (*vmalloc_sync_all_sym)(void);
-
-       vmalloc_sync_all_sym = (void *) kallsyms_lookup_funcptr("vmalloc_sync_all");
-       if (vmalloc_sync_all_sym) {
-               vmalloc_sync_all_sym();
-       } else {
-#ifdef CONFIG_X86
-               /*
-                * Only x86 needs vmalloc_sync_all to make sure LTTng does not
-                * trigger recursive page faults.
-                */
-               printk_once(KERN_WARNING "LTTng: vmalloc_sync_all symbol lookup failed.\n");
-               printk_once(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n");
-#endif
-       }
-}
-#else
-
-static inline
-void wrapper_vmalloc_sync_all(void)
-{
-       return vmalloc_sync_all();
-}
-#endif
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
-static inline
-void *lttng_kvmalloc_node(unsigned long size, gfp_t flags, int node)
-{
-       void *ret;
-
-       ret = kvmalloc_node(size, flags, node);
-       if (is_vmalloc_addr(ret)) {
-               /*
-                * Make sure we don't trigger recursive page faults in the
-                * tracing fast path.
-                */
-               wrapper_vmalloc_sync_all();
-       }
-       return ret;
-}
-
-static inline
-void *lttng_kvzalloc_node(unsigned long size, gfp_t flags, int node)
-{
-       return lttng_kvmalloc_node(size, flags | __GFP_ZERO, node);
-}
-
-static inline
-void *lttng_kvmalloc(unsigned long size, gfp_t flags)
-{
-       return lttng_kvmalloc_node(size, flags, NUMA_NO_NODE);
-}
-
-static inline
-void *lttng_kvzalloc(unsigned long size, gfp_t flags)
-{
-       return lttng_kvzalloc_node(size, flags, NUMA_NO_NODE);
-}
-
-static inline
-void lttng_kvfree(const void *addr)
-{
-       kvfree(addr);
-}
-
-#else
-
-#include <linux/slab.h>
-
-static inline
-void print_vmalloc_node_range_warning(void)
-{
-       printk_once(KERN_WARNING "LTTng: __vmalloc_node_range symbol lookup failed.\n");
-       printk_once(KERN_WARNING "Tracer performance will be degraded on NUMA systems.\n");
-       printk_once(KERN_WARNING "Please rebuild your kernel with CONFIG_KALLSYMS enabled.\n");
-}
-
-/*
- * kallsyms wrapper of __vmalloc_node with a fallback to kmalloc_node.
- */
-static inline
-void *__lttng_vmalloc_node_range(unsigned long size, unsigned long align,
-                       unsigned long start, unsigned long end, gfp_t gfp_mask,
-                       pgprot_t prot, unsigned long vm_flags, int node,
-                       const void *caller)
-{
-#ifdef CONFIG_KALLSYMS
-       /*
-        * If we have KALLSYMS, get * __vmalloc_node_range which is not exported.
-        */
-       void *(*lttng__vmalloc_node_range)(unsigned long size, unsigned long align,
-                       unsigned long start, unsigned long end, gfp_t gfp_mask,
-                       pgprot_t prot, unsigned long vm_flags, int node,
-                       const void *caller);
-
-       lttng__vmalloc_node_range = (void *) kallsyms_lookup_funcptr("__vmalloc_node_range");
-       if (lttng__vmalloc_node_range)
-               return lttng__vmalloc_node_range(size, align, start, end, gfp_mask, prot,
-                               vm_flags, node, caller);
-#endif
-       if (node != NUMA_NO_NODE)
-               print_vmalloc_node_range_warning();
-       return __vmalloc(size, gfp_mask, prot);
-}
-
-/**
- * lttng_kvmalloc_node - attempt to allocate physically contiguous memory, but upon
- * failure, fall back to non-contiguous (vmalloc) allocation.
- * @size: size of the request.
- * @flags: gfp mask for the allocation - must be compatible with GFP_KERNEL.
- *
- * Uses kmalloc to get the memory but if the allocation fails then falls back
- * to the vmalloc allocator. Use lttng_kvfree to free the memory.
- *
- * Reclaim modifiers - __GFP_NORETRY, __GFP_REPEAT and __GFP_NOFAIL are not supported
- */
-static inline
-void *lttng_kvmalloc_node(unsigned long size, gfp_t flags, int node)
-{
-       void *ret;
-
-       /*
-        * vmalloc uses GFP_KERNEL for some internal allocations (e.g page tables)
-        * so the given set of flags has to be compatible.
-        */
-       WARN_ON_ONCE((flags & GFP_KERNEL) != GFP_KERNEL);
-
-       /*
-        * If the allocation fits in a single page, do not fallback.
-        */
-       if (size <= PAGE_SIZE) {
-               return kmalloc_node(size, flags, node);
-       }
-
-       /*
-        * Make sure that larger requests are not too disruptive - no OOM
-        * killer and no allocation failure warnings as we have a fallback
-        */
-       ret = kmalloc_node(size, flags | __GFP_NOWARN | __GFP_NORETRY, node);
-       if (!ret) {
-               ret = __lttng_vmalloc_node_range(size, 1,
-                               VMALLOC_START, VMALLOC_END,
-                               flags | __GFP_HIGHMEM, PAGE_KERNEL, 0,
-                               node, __builtin_return_address(0));
-               /*
-                * Make sure we don't trigger recursive page faults in the
-                * tracing fast path.
-                */
-               wrapper_vmalloc_sync_all();
-       }
-       return ret;
-}
-
-static inline
-void *lttng_kvzalloc_node(unsigned long size, gfp_t flags, int node)
-{
-       return lttng_kvmalloc_node(size, flags | __GFP_ZERO, node);
-}
-
-static inline
-void *lttng_kvmalloc(unsigned long size, gfp_t flags)
-{
-       return lttng_kvmalloc_node(size, flags, NUMA_NO_NODE);
-}
-
-static inline
-void *lttng_kvzalloc(unsigned long size, gfp_t flags)
-{
-       return lttng_kvzalloc_node(size, flags, NUMA_NO_NODE);
-}
-
-static inline
-void lttng_kvfree(const void *addr)
-{
-       if (is_vmalloc_addr(addr)) {
-               vfree(addr);
-       } else {
-               kfree(addr);
-       }
-}
-#endif
-
-#endif /* _LTTNG_WRAPPER_VMALLOC_H */
This page took 0.055079 seconds and 4 git commands to generate.