From a33e44a60b7128349043753e53affba8ebc40716 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 11 Jun 2011 13:48:40 -0400 Subject: [PATCH] Revert poll exclusive Signed-off-by: Mathieu Desnoyers --- Makefile | 3 +- lib/Makefile | 1 - lib/ringbuffer/ring_buffer_vfs.c | 2 +- ltt-debugfs-abi.c | 2 +- wrapper/poll.c | 61 -------------------------------- wrapper/poll.h | 10 ++---- 6 files changed, 6 insertions(+), 73 deletions(-) delete mode 100644 wrapper/poll.c diff --git a/Makefile b/Makefile index d6f1a886..dc44fd40 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,7 @@ obj-m += ltt-relay.o ltt-relay-objs := ltt-events.o ltt-debugfs-abi.o \ ltt-probes.o ltt-core.o ltt-context.o \ lttng-context-pid.o lttng-context-comm.o \ - lttng-context-prio.o lttng-context-nice.o \ - wrapper/poll.o + lttng-context-prio.o lttng-context-nice.o ifneq ($(CONFIG_PERF_EVENTS),) ltt-relay-objs += lttng-context-perf-counters.o diff --git a/lib/Makefile b/lib/Makefile index 3fc82edc..e5735eca 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -8,5 +8,4 @@ lib-ring-buffer-objs := \ ringbuffer/ring_buffer_splice.o \ ringbuffer/ring_buffer_mmap.o \ prio_heap/lttng_prio_heap.o \ - ../wrapper/poll.o \ ../wrapper/splice.o diff --git a/lib/ringbuffer/ring_buffer_vfs.c b/lib/ringbuffer/ring_buffer_vfs.c index fecef217..9786d353 100644 --- a/lib/ringbuffer/ring_buffer_vfs.c +++ b/lib/ringbuffer/ring_buffer_vfs.c @@ -89,7 +89,7 @@ unsigned int lib_ring_buffer_poll(struct file *filp, poll_table *wait) int finalized, disabled; if (filp->f_mode & FMODE_READ) { - init_poll_funcptr(wait, wrapper_pollwait_exclusive); + poll_wait_set_exclusive(wait); poll_wait(filp, &buf->read_wait, wait); finalized = lib_ring_buffer_is_finalized(config, buf); diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index f8bee492..e3f5b55d 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -564,7 +564,7 @@ unsigned int lttng_channel_poll(struct file *file, poll_table *wait) unsigned int mask = 0; if (file->f_mode & FMODE_READ) { - init_poll_funcptr(wait, wrapper_pollwait_exclusive); + poll_wait_set_exclusive(wait); poll_wait(file, channel->ops->get_hp_wait_queue(channel->chan), wait); diff --git a/wrapper/poll.c b/wrapper/poll.c deleted file mode 100644 index f3f76fea..00000000 --- a/wrapper/poll.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com) - * - * wrapper around poll __pollwait and poll_get_entry. Using KALLSYMS to get its - * address when available, else we need to have a kernel that exports this - * function to GPL modules. - * - * Dual LGPL v2.1/GPL v2 license. - */ - -#ifdef CONFIG_KALLSYMS - -#include -#include - -struct poll_table_entry; -struct splice_pipe_desc; - -static -void (*__pollwait_sym)(struct file *filp, wait_queue_head_t *wait_address, - poll_table *p); -static -struct poll_table_entry *(*poll_get_entry_sym)(struct poll_wqueues *p); - -void wrapper_pollwait_exclusive(struct file *filp, - wait_queue_head_t *wait_address, - poll_table *p) - -{ - struct poll_wqueues *pwq = container_of(p, struct poll_wqueues, pt); - struct poll_table_entry *entry; - - if (!poll_get_entry_sym) - poll_get_entry_sym = (void *) kallsyms_lookup_name("poll_get_entry"); - if (!poll_get_entry_sym) { - printk(KERN_WARNING "LTTng: poll_get_entry_sym symbol lookup failed.\n"); - return; - } - entry = poll_get_entry_sym(pwq); - - if (!__pollwait_sym) - __pollwait_sym = (void *) kallsyms_lookup_name("__pollwait"); - if (!__pollwait_sym) { - printk(KERN_WARNING "LTTng: __pollwait symbol lookup failed.\n"); - return; - } - return __pollwait_sym(filp, wait_address, p); -} - -#else - -#include - -ssize_t wrapper_pollwait_exclusive(struct file *filp, - wait_queue_head_t *wait_address, - poll_table *p) -{ - return pollwait_exclusive(filp, wait_address, p); -} - -#endif diff --git a/wrapper/poll.h b/wrapper/poll.h index ae524730..080717bd 100644 --- a/wrapper/poll.h +++ b/wrapper/poll.h @@ -4,17 +4,13 @@ /* * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com) * - * wrapper around poll __pollwait and poll_get_entry. Using KALLSYMS to get its - * address when available, else we need to have a kernel that exports this - * function to GPL modules. - * * Dual LGPL v2.1/GPL v2 license. */ #include -void wrapper_pollwait_exclusive(struct file *filp, - wait_queue_head_t *wait_address, - poll_table *p); +#warning "poll_wait_set_exclusive() is defined as no-op. Thundering herd effect can be noticed with large number of consumer threads." + +#define poll_wait_set_exclusive(poll_table) #endif /* _LTTNG_WRAPPER_POLL_H */ -- 2.34.1