Searched refs:eventfd (Results 1 - 40 of 40) sorted by relevance

/linux-4.1.27/fs/
H A Deventfd.c2 * fs/eventfd.c
21 #include <linux/eventfd.h>
29 * Every time that a write(2) is performed on an eventfd, the
41 * eventfd_signal - Adds @n to the eventfd counter.
42 * @ctx: [in] Pointer to the eventfd context.
43 * @n: [in] Value of the counter to be added to the eventfd internal counter.
83 * eventfd_ctx_get - Acquires a reference to the internal eventfd context.
84 * @ctx: [in] Pointer to the eventfd context.
86 * Returns: In case of success, returns a pointer to the eventfd context.
96 * eventfd_ctx_put - Releases a reference to the internal eventfd context.
97 * @ctx: [in] Pointer to eventfd context.
99 * The eventfd context reference must have been previously acquired either
145 * @ctx: [in] Pointer to eventfd context.
153 * This is used to atomically remove a wait queue entry from the eventfd wait
173 * eventfd_ctx_read - Reads the eventfd counter or wait if it is zero.
174 * @ctx: [in] Pointer to eventfd context.
183 * If @no_wait is zero, the function might sleep until the eventfd internal
295 seq_printf(m, "eventfd-count: %16llx\n", eventfd_show_fdinfo()
313 * eventfd_fget - Acquire a reference of an eventfd file descriptor.
316 * Returns a pointer to the eventfd file structure in case of success, or the
320 * -EINVAL : The @fd file descriptor is not an eventfd file.
339 * eventfd_ctx_fdget - Acquires a reference to the internal eventfd context.
342 * Returns a pointer to the internal eventfd context, otherwise the error
360 * eventfd_ctx_fileget - Acquires a reference to the internal eventfd context.
363 * Returns a pointer to the internal eventfd context, otherwise the error
366 * -EINVAL : The @fd file descriptor is not an eventfd file.
378 * eventfd_file_create - Creates an eventfd file pointer.
379 * @count: Initial eventfd counter value.
380 * @flags: Flags for the eventfd file.
382 * This function creates an eventfd file pointer, w/out installing it into
383 * the fd table. This is useful when the eventfd file is used during the
384 * initialization of data structures that require extra setup after the eventfd
385 * creation. So the eventfd creation is split into the file pointer creation
389 * Returns an eventfd file pointer, or a proper error pointer.
412 file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, eventfd_file_create()
445 SYSCALL_DEFINE1(eventfd, unsigned int, count) SYSCALL_DEFINE1()
H A DMakefile29 obj-$(CONFIG_EVENTFD) += eventfd.o
H A Daio.c36 #include <linux/eventfd.h>
186 * this is the underlying eventfd context to deliver events to.
1126 * eventfd. The eventfd_signal() function is safe to be called aio_complete()
1526 * an eventfd() fd, and will be signaled for each completed io_submit_one()
/linux-4.1.27/virt/kvm/
H A Deventfd.c2 * kvm eventfd support - use eventfd objects to signal various KVM events
32 #include <linux/eventfd.h>
52 * level triggered interrupts. The interrupt is asserted on eventfd
92 struct eventfd_ctx *eventfd; member in struct:_irqfd
178 eventfd_ctx_remove_wait_queue(irqfd->eventfd, &irqfd->wait, &cnt); irqfd_shutdown()
194 eventfd_ctx_put(irqfd->eventfd); irqfd_shutdown()
250 /* The eventfd is closing, detach from KVM */ irqfd_wakeup()
309 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL; kvm_irqfd_assign() local
334 eventfd = eventfd_ctx_fileget(f.file); kvm_irqfd_assign()
335 if (IS_ERR(eventfd)) { kvm_irqfd_assign()
336 ret = PTR_ERR(eventfd); kvm_irqfd_assign()
340 irqfd->eventfd = eventfd; kvm_irqfd_assign()
392 * a callback whenever someone signals the underlying eventfd kvm_irqfd_assign()
401 if (irqfd->eventfd != tmp->eventfd) kvm_irqfd_assign()
418 * Check if there was an event already pending on the eventfd kvm_irqfd_assign()
441 if (eventfd && !IS_ERR(eventfd)) kvm_irqfd_assign()
442 eventfd_ctx_put(eventfd); kvm_irqfd_assign()
529 struct eventfd_ctx *eventfd; kvm_irqfd_deassign() local
531 eventfd = eventfd_ctx_fdget(args->fd); kvm_irqfd_deassign()
532 if (IS_ERR(eventfd)) kvm_irqfd_deassign()
533 return PTR_ERR(eventfd); kvm_irqfd_deassign()
538 if (irqfd->eventfd == eventfd && irqfd->gsi == args->gsi) { kvm_irqfd_deassign()
553 eventfd_ctx_put(eventfd); kvm_irqfd_deassign()
639 * ioeventfd: translate a PIO/MMIO memory write to an eventfd signal.
641 * userspace can register a PIO/MMIO address with an eventfd for receiving
650 struct eventfd_ctx *eventfd; member in struct:_ioeventfd
666 eventfd_ctx_put(p->eventfd); ioeventfd_release()
726 eventfd_signal(p->eventfd, 1); ioeventfd_write()
779 struct eventfd_ctx *eventfd; kvm_assign_ioeventfd_idx() local
783 eventfd = eventfd_ctx_fdget(args->fd); kvm_assign_ioeventfd_idx()
784 if (IS_ERR(eventfd)) kvm_assign_ioeventfd_idx()
785 return PTR_ERR(eventfd); kvm_assign_ioeventfd_idx()
797 p->eventfd = eventfd; kvm_assign_ioeventfd_idx()
832 eventfd_ctx_put(eventfd); kvm_assign_ioeventfd_idx()
842 struct eventfd_ctx *eventfd; kvm_deassign_ioeventfd_idx() local
845 eventfd = eventfd_ctx_fdget(args->fd); kvm_deassign_ioeventfd_idx()
846 if (IS_ERR(eventfd)) kvm_deassign_ioeventfd_idx()
847 return PTR_ERR(eventfd); kvm_deassign_ioeventfd_idx()
855 p->eventfd != eventfd || kvm_deassign_ioeventfd_idx()
873 eventfd_ctx_put(eventfd); kvm_deassign_ioeventfd_idx()
/linux-4.1.27/arch/x86/kvm/
H A DMakefile11 $(KVM)/eventfd.o $(KVM)/irqchip.o $(KVM)/vfio.o
/linux-4.1.27/tools/cgroup/
H A Dcgroup_event_listener.c17 #include <sys/eventfd.h>
46 efd = eventfd(0, 0); main()
48 err(1, "eventfd() failed"); main()
65 err(1, "Cannot read from eventfd"); main()
/linux-4.1.27/drivers/vfio/
H A Dvirqfd.c2 * VFIO generic eventfd code for IRQFD support.
14 #include <linux/eventfd.h>
64 * The eventfd is closing, if the virqfd has not yet been virqfd_wakeup()
93 eventfd_ctx_remove_wait_queue(virqfd->eventfd, &virqfd->wait, &cnt); virqfd_shutdown()
95 eventfd_ctx_put(virqfd->eventfd); virqfd_shutdown()
143 virqfd->eventfd = ctx; vfio_virqfd_enable()
146 * virqfds can be released by closing the eventfd or directly vfio_virqfd_enable()
164 * a callback whenever someone signals the underlying eventfd. vfio_virqfd_enable()
172 * Check if there was an event already pending on the eventfd vfio_virqfd_enable()
/linux-4.1.27/arch/s390/kvm/
H A DMakefile10 common-objs = $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/async_pf.o $(KVM)/irqchip.o
/linux-4.1.27/include/linux/
H A Dvmpressure.h10 #include <linux/eventfd.h>
38 struct eventfd_ctx *eventfd,
41 struct eventfd_ctx *eventfd);
H A Deventfd.h2 * include/linux/eventfd.h
18 * from eventfd, in order to leave a free define-space for
46 * Ugly ugly ugly error layer to support modules that uses eventfd but
H A Dtimerfd.h21 * from eventfd, in order to leave a free define-space for
H A Dvfio.h121 struct eventfd_ctx *eventfd; member in struct:virqfd
H A Dvringh.h167 /* Do we need to fire the eventfd to notify the other side? */
/linux-4.1.27/mm/
H A Dvmpressure.c21 #include <linux/eventfd.h>
283 * vmpressure_register_event() - Bind vmpressure notifications to an eventfd
285 * @eventfd: eventfd context to link notifications with
288 * This function associates eventfd context with the vmpressure
290 * @eventfd. The @args parameter is a string that denotes pressure level
297 struct eventfd_ctx *eventfd, const char *args) vmpressure_register_event()
315 ev->efd = eventfd; vmpressure_register_event()
326 * vmpressure_unregister_event() - Unbind eventfd from vmpressure
328 * @eventfd: eventfd context that was used to link vmpressure with the @cg
330 * This function does internal manipulations to detach the @eventfd from
332 * associated with the @eventfd (but the @eventfd itself is not freed).
337 struct eventfd_ctx *eventfd) vmpressure_unregister_event()
344 if (ev->efd != eventfd) vmpressure_unregister_event()
378 * Make sure there is no pending work before eventfd infrastructure vmpressure_cleanup()
296 vmpressure_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) vmpressure_register_event() argument
336 vmpressure_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) vmpressure_unregister_event() argument
H A Dmemcontrol.c53 #include <linux/eventfd.h>
183 struct eventfd_ctx *eventfd; member in struct:mem_cgroup_threshold
211 struct eventfd_ctx *eventfd; member in struct:mem_cgroup_eventfd_list
223 * eventfd to signal userspace about the event.
225 struct eventfd_ctx *eventfd; member in struct:mem_cgroup_event
233 * on eventfd to send notification to userspace.
236 struct eventfd_ctx *eventfd, const char *args);
239 * the eventfd or on cgroup removing. This callback must be set,
243 struct eventfd_ctx *eventfd);
246 * userspace closes eventfd.
3602 eventfd_signal(t->entries[i].eventfd, 1); __mem_cgroup_threshold()
3614 eventfd_signal(t->entries[i].eventfd, 1); __mem_cgroup_threshold()
3654 eventfd_signal(ev->eventfd, 1); mem_cgroup_oom_notify_cb()
3669 struct eventfd_ctx *eventfd, const char *args, enum res_type type) __mem_cgroup_usage_register_event()
3715 new->entries[size - 1].eventfd = eventfd; __mem_cgroup_usage_register_event()
3752 struct eventfd_ctx *eventfd, const char *args) mem_cgroup_usage_register_event()
3754 return __mem_cgroup_usage_register_event(memcg, eventfd, args, _MEM); mem_cgroup_usage_register_event()
3758 struct eventfd_ctx *eventfd, const char *args) memsw_cgroup_usage_register_event()
3760 return __mem_cgroup_usage_register_event(memcg, eventfd, args, _MEMSWAP); memsw_cgroup_usage_register_event()
3764 struct eventfd_ctx *eventfd, enum res_type type) __mem_cgroup_usage_unregister_event()
3791 if (thresholds->primary->entries[i].eventfd != eventfd) __mem_cgroup_usage_unregister_event()
3809 if (thresholds->primary->entries[i].eventfd == eventfd) __mem_cgroup_usage_unregister_event()
3843 struct eventfd_ctx *eventfd) mem_cgroup_usage_unregister_event()
3845 return __mem_cgroup_usage_unregister_event(memcg, eventfd, _MEM); mem_cgroup_usage_unregister_event()
3849 struct eventfd_ctx *eventfd) memsw_cgroup_usage_unregister_event()
3851 return __mem_cgroup_usage_unregister_event(memcg, eventfd, _MEMSWAP); memsw_cgroup_usage_unregister_event()
3855 struct eventfd_ctx *eventfd, const char *args) mem_cgroup_oom_register_event()
3865 event->eventfd = eventfd; mem_cgroup_oom_register_event()
3870 eventfd_signal(eventfd, 1); mem_cgroup_oom_register_event()
3877 struct eventfd_ctx *eventfd) mem_cgroup_oom_unregister_event()
3884 if (ev->eventfd == eventfd) { mem_cgroup_oom_unregister_event()
4026 event->unregister_event(memcg, event->eventfd); memcg_event_remove()
4029 eventfd_signal(event->eventfd, 1); memcg_event_remove()
4031 eventfd_ctx_put(event->eventfd); memcg_event_remove()
4037 * Gets called on POLLHUP on eventfd when user closes it.
4134 event->eventfd = eventfd_ctx_fileget(efile.file); memcg_write_event_control()
4135 if (IS_ERR(event->eventfd)) { memcg_write_event_control()
4136 ret = PTR_ERR(event->eventfd); memcg_write_event_control()
4194 ret = event->register_event(memcg, event->eventfd, buf); memcg_write_event_control()
4214 eventfd_ctx_put(event->eventfd); memcg_write_event_control()
3668 __mem_cgroup_usage_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args, enum res_type type) __mem_cgroup_usage_register_event() argument
3751 mem_cgroup_usage_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) mem_cgroup_usage_register_event() argument
3757 memsw_cgroup_usage_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) memsw_cgroup_usage_register_event() argument
3763 __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, enum res_type type) __mem_cgroup_usage_unregister_event() argument
3842 mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) mem_cgroup_usage_unregister_event() argument
3848 memsw_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) memsw_cgroup_usage_unregister_event() argument
3854 mem_cgroup_oom_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) mem_cgroup_oom_register_event() argument
3876 mem_cgroup_oom_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) mem_cgroup_oom_unregister_event() argument
/linux-4.1.27/arch/arm64/kvm/
H A DMakefile14 kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o
/linux-4.1.27/arch/arm/kvm/
H A DMakefile18 kvm-arm-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o
/linux-4.1.27/arch/powerpc/kvm/
H A DMakefile11 $(KVM)/eventfd.o
92 $(KVM)/eventfd.o \
/linux-4.1.27/include/uapi/linux/
H A Dvhost.h92 /* Specify an eventfd file descriptor to signal on log write. */
106 /* The following ioctls use eventfd file descriptors to signal and poll
109 /* Set eventfd to poll for added buffers */
111 /* Set eventfd to signal when buffers have beed used */
113 /* Set eventfd to signal an error */
H A Daio_abi.h102 * eventfd to signal AIO readiness to
H A Dvfio.h206 * The EVENTFD flag indicates the interrupt index supports eventfd based
256 * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
258 * assigned or skip un-assigned interrupts. For example, to set an eventfd
282 #define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */
/linux-4.1.27/tools/usb/ffs-aio-example/multibuff/device_app/
H A Daio_multibuff.c43 #include <sys/eventfd.h>
293 evfd = eventfd(0, 0); main()
295 perror("unable to open eventfd"); main()
335 /* enable eventfd notification */ main()
355 perror("unable to read eventfd"); main()
/linux-4.1.27/tools/usb/ffs-aio-example/simple/device_app/
H A Daio_simple.c43 #include <sys/eventfd.h>
267 evfd = eventfd(0, 0); main()
269 perror("unable to open eventfd"); main()
305 perror("unable to read eventfd"); main()
327 /* enable eventfd notification */ main()
/linux-4.1.27/drivers/vhost/
H A Dvhost.h4 #include <linux/eventfd.h>
27 /* Poll a file (eventfd or socket) */
H A Dtest.c10 #include <linux/eventfd.h>
63 /* Nothing new? Wait for eventfd to tell us they refilled. */ handle_vq()
H A Dvhost.c14 #include <linux/eventfd.h>
1357 * want to notify the guest, using eventfd. */ vhost_add_used()
1413 * want to notify the guest, using eventfd. */ vhost_add_used_n()
1485 /* This actually signals the guest, using eventfd. */ vhost_signal()
H A Dnet.c10 #include <linux/eventfd.h>
342 /* Nothing new? Wait for eventfd to tell us they refilled. */ handle_tx()
582 /* Nothing new? Wait for eventfd to tell us handle_rx()
H A Dscsi.c36 #include <linux/eventfd.h>
1043 /* Nothing new? Wait for eventfd to tell us they refilled. */ vhost_scsi_handle_vq()
/linux-4.1.27/tools/virtio/
H A Dvirtio_test.c5 #include <sys/eventfd.h>
95 info->kick = eventfd(0, EFD_NONBLOCK); vq_info_add()
96 info->call = eventfd(0, EFD_NONBLOCK); vq_info_add()
/linux-4.1.27/drivers/vfio/pci/
H A Dvfio_pci_intrs.c18 #include <linux/eventfd.h>
72 * If this is triggered by an eventfd, we can't call eventfd_signal
73 * or else we'll deadlock on the eventfd wait queue. Return >0 when
H A Dvfio_pci.c17 #include <linux/eventfd.h>
/linux-4.1.27/drivers/vfio/platform/
H A Dvfio_platform_irq.c17 #include <linux/eventfd.h>
/linux-4.1.27/arch/powerpc/include/asm/
H A Dsystbl.h314 SYSCALL_SPU(eventfd)
/linux-4.1.27/tools/lguest/
H A Dlguest.c21 #include <sys/eventfd.h>
220 int eventfd; member in struct:virtqueue
775 /* Nothing new? Wait for eventfd to tell us they refilled. */ wait_for_vq_desc()
776 if (read(vq->eventfd, &event, sizeof(event)) != sizeof(event)) wait_for_vq_desc()
1850 /* Create a zero-initialized eventfd. */ start_virtqueue()
1851 vq->eventfd = eventfd(0, 0); start_virtqueue()
1852 if (vq->eventfd < 0) start_virtqueue()
1853 err(1, "Creating eventfd"); start_virtqueue()
2111 /* Notify the process handling this vq by adding 1 to eventfd */
2112 write(vq->eventfd, "\1\0\0\0\0\0\0\0", 8);
/linux-4.1.27/arch/s390/kernel/
H A Dcompat_wrapper.c195 COMPAT_SYSCALL_WRAP1(eventfd, unsigned int, count);
/linux-4.1.27/arch/parisc/kernel/
H A Dsyscall_table.S402 ENTRY_SAME(eventfd)
/linux-4.1.27/include/uapi/asm-generic/
H A Dunistd.h77 /* fs/eventfd.c */
/linux-4.1.27/drivers/powercap/
H A Dintel_rapl.c900 * to userspace via eventfd. once we have a usecase, this is simple
/linux-4.1.27/drivers/usb/gadget/function/
H A Df_fs.c35 #include <linux/eventfd.h>
/linux-4.1.27/tools/perf/
H A Dbuiltin-trace.c19 #include <sys/eventfd.h>

Completed in 1028 milliseconds