History log of /libuv/src/unix/linux.c (Results 1 – 25 of 52)
Revision Date Author Comments
# 18d48bc1 17-Oct-2024 Ben Noordhuis

Revert "linux: eliminate a read on eventfd per wakeup (#4400)" (#4585)

This reverts commit e5cb1d3d3d4ab3178ac567fb6a7f0f4b5eef3083.

Reason: bisecting says it breaks dnstap.

Revert "linux: eliminate a read on eventfd per wakeup (#4400)" (#4585)

This reverts commit e5cb1d3d3d4ab3178ac567fb6a7f0f4b5eef3083.

Reason: bisecting says it breaks dnstap.

Also revert commit 27134547ff ("kqueue: use EVFILT_USER for async if
available") because otherwise the first commit doesn't revert cleanly,
with enough conflicts in src/unix/async.c that I'm not comfortable
fixing those up manually.

Fixes: https://github.com/libuv/libuv/issues/4584

show more ...


# f806be87 30-Sep-2024 Ben Noordhuis

linux: use IORING_OP_FTRUNCATE when available (#4554)

Route ftruncate() system calls through io_uring instead of the thread
pool when the kernel is new enough to support it (linux >= 6.9

linux: use IORING_OP_FTRUNCATE when available (#4554)

Route ftruncate() system calls through io_uring instead of the thread
pool when the kernel is new enough to support it (linux >= 6.9).

This commit harmonizes how libuv checks if the kernel is new enough.
Some ops were checking against `uv__kernel_version()` directly while
others stored the result of the version check as a feature flag.

Because the kernel version is cached, and because it is more direct
than a feature flag, I opted for the former approach.

show more ...


# bcc6d1c1 30-Sep-2024 Ben Noordhuis

linux: use IORING_SETUP_NO_SQARRAY when available (#4553)

Introduced in Linux 6.6, it tells the kernel to omit the sqarray from
the ring buffer.

Libuv initalizes the array once

linux: use IORING_SETUP_NO_SQARRAY when available (#4553)

Introduced in Linux 6.6, it tells the kernel to omit the sqarray from
the ring buffer.

Libuv initalizes the array once to an identity mapping and then forgets
about it, so not only does it save a little memory (ca. 1 KiB per ring)
but it also makes things more efficient kernel-side because it removes
a level of indirection.

show more ...


# e78e29c2 06-Aug-2024 Santiago Gimeno

linux: disable SQPOLL io_uring by default (#4492)

The SQPOLL io_uring instance wasn't providing consistent behaviour to
users depending on kernel versions, load shape, ... creating issue

linux: disable SQPOLL io_uring by default (#4492)

The SQPOLL io_uring instance wasn't providing consistent behaviour to
users depending on kernel versions, load shape, ... creating issues
difficult to track and fix. Don't use this ring by default but allow
enabling it by calling `uv_loop_configure()` with
`UV_LOOP_ENABLE_IO_URING_SQPOLL`.

show more ...


# e5cb1d3d 29-Jul-2024 Andy Pan

linux: eliminate a read on eventfd per wakeup (#4400)

Register the eventfd with EPOLLET to enable edge-triggered notification
where we're able to eliminate the overhead of reading the ev

linux: eliminate a read on eventfd per wakeup (#4400)

Register the eventfd with EPOLLET to enable edge-triggered notification
where we're able to eliminate the overhead of reading the eventfd via
system call on each wakeup event.

When the eventfd counter reaches the maximum value of the unsigned 64-bit,
which may not happen for the entire lifetime of the process, we rewind the
counter and retry.

This optimization saves one system call on each event-loop wakeup,
eliminating the overhead of read(2) as well as the extra latency
for each epoll wakeup.

show more ...


# 7c491bde 11-Jul-2024 Viacheslav Muravyev

unix,win: remove unused req parameter from macros (#4435)

Remove the unused `req` parameter from the uv__req_register and
uv__req_unregister macros.


# 3ecce914 21-Mar-2024 Ben Noordhuis

linux: don't delay EPOLL_CTL_DEL operations (#4328)

Perform EPOLL_CTL_DEL immediately instead of going through
io_uring's submit queue, otherwise the file descriptor may
be closed by

linux: don't delay EPOLL_CTL_DEL operations (#4328)

Perform EPOLL_CTL_DEL immediately instead of going through
io_uring's submit queue, otherwise the file descriptor may
be closed by the time the kernel starts the operation.

Fixes: https://github.com/libuv/libuv/issues/4323

show more ...


# b0816180 14-Mar-2024 Farzin Monsef

linux: fix /proc/self/stat executable name parsing (#4353)

- The filename of the executable may contain both spaces and parentheses
- Use uv__slurp instead of open/read/close


# 6b56200c 28-Feb-2024 Thomas Walter <31201229+waltoss@users.noreply.github.com>

linux: fix uv_available_parallelism using cgroup (#4278)

uv_available_parallelism does not handle container cpu limit
set by systems like Docker or Kubernetes. This patch fixes
this

linux: fix uv_available_parallelism using cgroup (#4278)

uv_available_parallelism does not handle container cpu limit
set by systems like Docker or Kubernetes. This patch fixes
this limitation by comparing the amount of available cpus
returned by syscall with the quota of cpus available defined
in the cgroup.

Fixes: https://github.com/libuv/libuv/issues/4146

show more ...


# 507f3046 14-Feb-2024 Ben Noordhuis

linux: create io_uring sqpoll ring lazily (#4315)

It's been reported that creating many event loops introduces measurable
overhead now that libuv creates an sqpoll-enabled ring.

linux: create io_uring sqpoll ring lazily (#4315)

It's been reported that creating many event loops introduces measurable
overhead now that libuv creates an sqpoll-enabled ring.

I don't really see any change in CPU time with or without this change
but deferring ring creation until it's actually used seems like a good
idea, and comes with no downsides that I can think of, so let's do it.

Fixes: https://github.com/libuv/libuv/issues/4308

show more ...


# 3b6a1a14 13-Jan-2024 Brad King

linux: disable io_uring on ppc64 and ppc64le (#4285)

Since `io_uring` support was added, libuv's signal handler randomly
segfaults on ppc64 when interrupting `epoll_pwait`. Disable it

linux: disable io_uring on ppc64 and ppc64le (#4285)

Since `io_uring` support was added, libuv's signal handler randomly
segfaults on ppc64 when interrupting `epoll_pwait`. Disable it
pending further investigation.

Issue: https://github.com/libuv/libuv/issues/4283

show more ...


# 160cd562 08-Jan-2024 Santiago Gimeno

linux: retry fs op if unsupported by io_uring (#4268)

Fallback to the threadpool if it returns `EOPNOTSUPP`.

Fixes: https://github.com/nodejs/node/issues/50876


# a7d52551 12-Dec-2023 Ben Noordhuis

linux: remove HAVE_IFADDRS_H macro (#4243)

Introduced long ago for old Linux/libc flavors libuv no longer supports.

We include <ifaddrs.h> unconditionally elsewhere so there is no p

linux: remove HAVE_IFADDRS_H macro (#4243)

Introduced long ago for old Linux/libc flavors libuv no longer supports.

We include <ifaddrs.h> unconditionally elsewhere so there is no point in
special-casing it here.

Fixes: https://github.com/libuv/libuv/issues/4242

show more ...


# f1444293 15-Nov-2023 matoro <12038583+matoro@users.noreply.github.com>

linux: disable io_uring on hppa below kernel 6.1.51 (#4224)

First kernel with support is 6.1, was only fully functional from .51
onwards: https://lore.kernel.org/all/cb912694-b1fe-dbb0-4

linux: disable io_uring on hppa below kernel 6.1.51 (#4224)

First kernel with support is 6.1, was only fully functional from .51
onwards: https://lore.kernel.org/all/cb912694-b1fe-dbb0-4d8c-d608f3526905@gmx.de/

Co-authored-by: matoro <matoro@users.noreply.github.com>

show more ...


# a389393f 28-Oct-2023 Ben Noordhuis

linux: disable io_uring on 32 bits arm systems (#4187)

It's been reported that no released kernels are bug-free enough to use
io_uring without causing regressions.

Fixes: https:

linux: disable io_uring on 32 bits arm systems (#4187)

It's been reported that no released kernels are bug-free enough to use
io_uring without causing regressions.

Fixes: https://github.com/libuv/libuv/issues/4158

show more ...


# c811169f 17-Sep-2023 Santiago Gimeno

unix: disable io_uring close on selected kernels (#4141)

Specifically on non-longterm kernels between 5.16.0 (non-longterm) and
6.1.0 (longterm). Starting with longterm 6.1.0, the issue

unix: disable io_uring close on selected kernels (#4141)

Specifically on non-longterm kernels between 5.16.0 (non-longterm) and
6.1.0 (longterm). Starting with longterm 6.1.0, the issue is solved.

show more ...


# 0d78f3c7 31-Aug-2023 Ben Noordhuis

unix: get mainline kernel version in Debian (#4131)

In Debian, the mainline kernel version is reported via the `uname()`
`version` field.


# e2c8fed7 30-Aug-2023 Santiago Gimeno

unix: get mainline kernel version in Ubuntu (#4131)

In Ubuntu, the kernel version reported by `uname()` follows the
versioning format that Ubuntu uses for their kernels which does not ha

unix: get mainline kernel version in Ubuntu (#4131)

In Ubuntu, the kernel version reported by `uname()` follows the
versioning format that Ubuntu uses for their kernels which does not have
a direct correspondence with the mainline kernel version they're based
on. Get that version from `/proc/version_signature` as documented in:

https://wiki.ubuntu.com/Kernel/FAQ#Kernel.2FFAQ.2FGeneralVersionRunning.How_can_we_determine_the_version_of_the_running_kernel.3F

show more ...


# 65dc822d 25-Aug-2023 michalbiesek

linux: add missing riscv syscall numbers (#4127)

Signed-off-by: Michal Biesek <michalbiesek@gmail.com>


# 2f827500 11-Jul-2023 Trevor Norris

unix: match kqueue and epoll code (#4091)

Match the implementation for linux.c to kqueue.c in the code around the
calls to kevent and epoll.

In linux.c the code was made more DR

unix: match kqueue and epoll code (#4091)

Match the implementation for linux.c to kqueue.c in the code around the
calls to kevent and epoll.

In linux.c the code was made more DRY by moving the nfds check up
(including a comment of why it's possible) and combining two if checks
into one.

In kqueue.c the assert to check the timeout when nfds == 0 has been
moved to be called directly after the EINTR check. Since it should
always be true regardless.

Ref: https://github.com/libuv/libuv/pull/3893
Ref: https://github.com/nodejs/node/issues/48490

show more ...


# 30c3ef9f 31-Jul-2023 Ben Noordhuis

linux: handle UNAME26 personality (#4109)


# 50b53cbd 12-Jul-2023 Ben Noordhuis

linux: don't use io_uring on pre-5.10.186 kernels (#4093)

Those kernels have a known resource consumption bug where the sqpoll
thread busy-loops.

Fixes: https://github.com/libuv

linux: don't use io_uring on pre-5.10.186 kernels (#4093)

Those kernels have a known resource consumption bug where the sqpoll
thread busy-loops.

Fixes: https://github.com/libuv/libuv/issues/4089

show more ...


# a939d643 12-Jul-2023 Shuduo Sang

linux: fix harmless warn_unused_result warning (#4056)


# 1752791c 20-Jun-2023 Ben Noordhuis

linux: work around io_uring IORING_OP_CLOSE bug (#4059)

Work around a poorly understood bug in older kernels where closing a
file descriptor pointing to /foo/bar results in ETXTBSY error

linux: work around io_uring IORING_OP_CLOSE bug (#4059)

Work around a poorly understood bug in older kernels where closing a
file descriptor pointing to /foo/bar results in ETXTBSY errors when
trying to execve("/foo/bar") later on.

The bug seems to have been fixed somewhere between 5.15.85 and 5.15.90.
I couldn't pinpoint the responsible commit but good candidates are the
several data race fixes.

Interestingly, it seems to manifest only when running under Docker so
the possibility of a Docker bug can't be completely ruled out either.

This commit moves uv__kernel_version() from fs.c to linux.c because the
latter now uses it more than the former.

Fixes: https://github.com/nodejs/node/issues/48444

show more ...


# 7ada448d 16-Jun-2023 liuxiang88 <94350585+liuxiang88@users.noreply.github.com>

unix: add loongarch support (#4054)

Signed-off-by: liuxiang <liuxiang@loongson.cn>


123