History log of /freebsd-13.1/sys/compat/linux/linux_event.c (Results 1 – 25 of 38)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0
# a95b0595 03-Feb-2021 shu <[email protected]>

linux: remove locks around callout_drain in timerfd_close()

The lock around callout_drain() is unnecessary and may cause
deadlock when one closes a timer descriptor during timer execution.

Reviewed

linux: remove locks around callout_drain in timerfd_close()

The lock around callout_drain() is unnecessary and may cause
deadlock when one closes a timer descriptor during timer execution.

Reviewed By: delphij
Submitted By: ankohuu_outlook.com (Shunchao Hu)
Differential Revision: https://reviews.freebsd.org/D28148

(cherry picked from commit 14c40d2c292deff44be5591add7fdad5f9b371aa)

show more ...


# fd140c52 07-Feb-2021 Vladimir Kondratyev <[email protected]>

epoll: Store epoll_event udata member in ext member of kevent.

Current epoll implementation stores udata fields of epoll_event
structure in special dynamically-sized table rather than in udata field

epoll: Store epoll_event udata member in ext member of kevent.

Current epoll implementation stores udata fields of epoll_event
structure in special dynamically-sized table rather than in udata field
of backing kevent structure because of 2 reasons:
1. Kevent's udata size is smaller than epoll's on 32-bit archs.
2. Kevent's udata can be clobbered on execution EPOLL_CTL_ADD as kqueue
modifies existing event while epoll returns error in this case.

After r320043 has introduced four new 64bit user data members (ext[]),
we can store epoll udata in one of them and drop aforementioned table.
According to kqueue_register() source code ext members are not updated
when existing kevent is modified that fixes p.2.

As a side effect the patch fixes PR/252582.

Reviewed by: trasz
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D28169

(cherry picked from commit b3c6fe663bb90240f8bda6b5ba9c6a761f09f078)

show more ...


# 0cb6fa6a 03-Feb-2021 shu <[email protected]>

linux: make timerfd_settime(2) set expirations count to zero

On Linux, read(2) from a timerfd file descriptor returns an unsigned
8-byte integer (uint64_t) containing the number of expirations
that

linux: make timerfd_settime(2) set expirations count to zero

On Linux, read(2) from a timerfd file descriptor returns an unsigned
8-byte integer (uint64_t) containing the number of expirations
that have occurred, if the timer has already expired one or more
times since its settings were last modified using timerfd_settime(),
or since the last successful read(2). That's to say, once we do
a read or call timerfd_settime(), timer fd's expiration count should
be zero. Some Linux applications create timerfd and add it to epoll
with LT mode, when event comes, they do timerfd_settime instead
of read to stop event source from trigger. On FreeBSD,
timerfd_settime(2) didn't set the count to zero, which caused high
CPU utilization.

Submitted by: ankohuu_outlook.com (Shunchao Hu)
Differential Revision: https://reviews.freebsd.org/D28231

(cherry picked from commit ae71b794cbed19e5e25effc3438720ad452ab87c)

show more ...


# 6b3a9a0f 12-Jan-2021 Mateusz Guzik <[email protected]>

Convert remaining cap_rights_init users to cap_rights_init_one

semantic patch:

@@

expression rights, r;

@@

- cap_rights_init(&rights, r)
+ cap_rights_init_one(&rights, r)


# 7a202823 23-Dec-2020 Konstantin Belousov <[email protected]>

Expose eventfd in the native API/ABI using a new __specialfd syscall

eventfd is a Linux system call that produces special file descriptors
for event notification. When porting Linux software, it is

Expose eventfd in the native API/ABI using a new __specialfd syscall

eventfd is a Linux system call that produces special file descriptors
for event notification. When porting Linux software, it is currently
usually emulated by epoll-shim on top of kqueues. Unfortunately, kqueues
are not passable between processes. And, as noted by the author of
epoll-shim, even if they were, the library state would also have to be
passed somehow. This came up when debugging strange HW video decode
failures in Firefox. A native implementation would avoid these problems
and help with porting Linux software.

Since we now already have an eventfd implementation in the kernel (for
the Linuxulator), it's pretty easy to expose it natively, which is what
this patch does.

Submitted by: [email protected]
Reviewed by: markj (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26668

show more ...


# 7cb901bf 23-Dec-2020 Konstantin Belousov <[email protected]>

Remove useless ARGUSED annotations.

Submitted by: [email protected]


# 11c9f2ff 23-Dec-2020 Konstantin Belousov <[email protected]>

Add SPDX tag.

Submitted by: [email protected]


Revision tags: release/12.2.0
# 1a180032 01-Sep-2020 Mateusz Guzik <[email protected]>

compat: clean up empty lines in .c and .h files


Revision tags: release/11.4.0
# 86e794eb 11-Jun-2020 Edward Tomasz Napierala <[email protected]>

Don't use newlines with linux_msg(). No functional changes.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 71b8e362 24-Nov-2019 Vladimir Kondratyev <[email protected]>

Linux epoll: Allow passing of any negative timeout value to epoll_wait

Linux epoll allow passing of any negative timeout value to epoll_wait()
to cause unbound blocking

Reviewed by: emaste
MFC afte

Linux epoll: Allow passing of any negative timeout value to epoll_wait

Linux epoll allow passing of any negative timeout value to epoll_wait()
to cause unbound blocking

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22517

show more ...


# 335fe0af 24-Nov-2019 Vladimir Kondratyev <[email protected]>

Linux epoll: Register events with zero event mask

Such an events are legal and should be interpreted as EPOLLERR | EPOLLHUP.
Register a disabled kqueue event in that case as we do not support EPOLLH

Linux epoll: Register events with zero event mask

Such an events are legal and should be interpreted as EPOLLERR | EPOLLHUP.
Register a disabled kqueue event in that case as we do not support EPOLLHUP yet.

Required by Linux Steam client.

PR: 240590
Reported by: Alex S <[email protected]>
Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22516

show more ...


# 461120b8 24-Nov-2019 Vladimir Kondratyev <[email protected]>

Linux epoll: Check both read and write kqueue events existence in EPOLL_CTL_ADD

Linux epoll EPOLL_CTL_ADD op handler should always check registration
of both EVFILT_READ and EVFILT_WRITE kevents to

Linux epoll: Check both read and write kqueue events existence in EPOLL_CTL_ADD

Linux epoll EPOLL_CTL_ADD op handler should always check registration
of both EVFILT_READ and EVFILT_WRITE kevents to deceide if supplied
file descriptor fd is already registered with epoll instance.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22515

show more ...


# 896a4c27 24-Nov-2019 Vladimir Kondratyev <[email protected]>

Linux epoll: Don't deregister file descriptor after EPOLLONESHOT is fired

Linux epoll does not remove descriptor after one-shot event has been triggered.
Set EV_DISPATCH kqueue flag rather then EV_O

Linux epoll: Don't deregister file descriptor after EPOLLONESHOT is fired

Linux epoll does not remove descriptor after one-shot event has been triggered.
Set EV_DISPATCH kqueue flag rather then EV_ONESHOT to get the same behavior.

Required by Linux Steam client.

PR: 240590
Reported by: Alex S <[email protected]>
Reviewed by: emaste, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22513

show more ...


Revision tags: release/12.1.0, release/11.3.0, release/12.0.0
# 792843c3 24-Nov-2018 Mark Johnston <[email protected]>

Pass malloc flags directly through kevent(2) subroutines.

Some kevent functions have a boolean "waitok" parameter for use when
calling malloc(9). Replace them with the corresponding malloc() flags:

Pass malloc flags directly through kevent(2) subroutines.

Some kevent functions have a boolean "waitok" parameter for use when
calling malloc(9). Replace them with the corresponding malloc() flags:
the desired behaviour is known at compile-time, so this eliminates a
couple of conditional branches, and makes the code easier to read.

No functional change intended.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18318

show more ...


# 6040822c 30-Jul-2018 Alan Somers <[email protected]>

Make timespecadd(3) and friends public

The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have

Make timespecadd(3) and friends public

The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have grown at least 28 syscalls that use timespecs in some
way, leading many programs both inside and outside of the base system to
redefine those macros. It's better just to make the definitions public.

Our kernel currently defines two-argument versions of timespecadd and
timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define
three-argument versions. Solaris also defines a three-argument version, but
only in its kernel. This revision changes our definition to match the
common three-argument version.

Bump _FreeBSD_version due to the breaking KPI change.

Discussed with: cem, jilles, ian, bde
Differential Revision: https://reviews.freebsd.org/D14725

show more ...


Revision tags: release/11.2.0
# 931e2a1a 15-Jun-2018 Ed Maste <[email protected]>

linuxulator: do not include legacy syscalls on arm64

Existing linuxulator platforms (i386, amd64) support legacy syscalls,
such as non-*at ones like open, but arm64 and other new platforms do
not.

linuxulator: do not include legacy syscalls on arm64

Existing linuxulator platforms (i386, amd64) support legacy syscalls,
such as non-*at ones like open, but arm64 and other new platforms do
not.

Wrap these in #ifdef LINUX_LEGACY_SYSCALLS, #defined in the MD linux.h
files. We may need finer grained control in the future but this is
sufficient for now.

Reviewed by: andrew
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D15237

show more ...


# cbd92ce6 09-May-2018 Matt Macy <[email protected]>

Eliminate the overhead of gratuitous repeated reinitialization of cap_rights

- Add macros to allow preinitialization of cap_rights_t.

- Convert most commonly used code paths to use preinitialized c

Eliminate the overhead of gratuitous repeated reinitialization of cap_rights

- Add macros to allow preinitialization of cap_rights_t.

- Convert most commonly used code paths to use preinitialized cap_rights_t.
A 3.6% speedup in fstat was measured with this change.

Reported by: mjg
Reviewed by: oshogbo
Approved by: sbruno
MFC after: 1 month

show more ...


# 132f90c6 05-Feb-2018 Ed Maste <[email protected]>

Linuxolator whitespace cleanup

A version of each of the MD files by necessity exists for each CPU
architecture supported by the Linuxolator. Clean these up so that new
architectures do not inherit

Linuxolator whitespace cleanup

A version of each of the MD files by necessity exists for each CPU
architecture supported by the Linuxolator. Clean these up so that new
architectures do not inherit whitespace issues.

Clean up shared Linuxolator files while here.

Sponsored by: Turing Robotic Industries Inc.

show more ...


Revision tags: release/10.4.0, release/11.1.0
# 0633df29 28-Feb-2017 Dmitry Chagin <[email protected]>

Linux epoll return EEXIST on case when op is EPOLL_CTL_ADD, and the supplied
file descriptor fd is already registered with this epoll instance.

MFC after: 1 month


# 8bc4edfd 28-Feb-2017 Dmitry Chagin <[email protected]>

Linux epoll return ENOENT error in case when op is EPOLL_CTL_MOD or
EPOLL_CTL_DEL, and fd is not registered with this epoll instance.

MFC after: 1 month


# 29b1ecbe 28-Feb-2017 Dmitry Chagin <[email protected]>

FreeBSD does not have analgue for epill EPOLLPRI event type.
So, do not set EPOLLPRI event acidently.
Also, do not set EPOLLWRNORM and EPOLLRDNORM events as epoll
do not set this events.

MFC after:

FreeBSD does not have analgue for epill EPOLLPRI event type.
So, do not set EPOLLPRI event acidently.
Also, do not set EPOLLWRNORM and EPOLLRDNORM events as epoll
do not set this events.

MFC after: 1 month

show more ...


# 281afc59 27-Feb-2017 Dmitry Chagin <[email protected]>

Return EINVAL when an invalid file descriptor specified.

MFC after: 1 month


# ed211c40 27-Feb-2017 Dmitry Chagin <[email protected]>

Unify eventfd ioctl method and use it for other similar interfaces.

MFC after: 1 month


# 2fa6d2fe 26-Feb-2017 Dmitry Chagin <[email protected]>

Return EINVAL in case when an invalid size of signal mask specified.

MFC after: 1 month


# 80c7315d 26-Feb-2017 Dmitry Chagin <[email protected]>

Restore signal mask in epoll_pwait.

MFC after: 1 month


12