public inbox for linux-parisc@vger.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Vidra.Jonas@seznam.cz, linux-parisc@vger.kernel.org
Subject: Re: Possible io_uring bug in PA-RISC kernel 6.1.46
Date: Sun, 27 Aug 2023 17:09:40 +0200	[thread overview]
Message-ID: <c36e52b0-fe79-5c50-cb58-450a04e64698@gmx.de> (raw)
In-Reply-To: <520.NvTX.6mXZpmfh4Ju.1awpAS@seznam.cz>

Hello Vidra,

On 8/27/23 13:25, Vidra.Jonas@seznam.cz wrote:
> on my C8000 workstation, I'm getting libuv aborts connected to io_uring
> usage. I'm not sure whether this is a libuv bug or a kernel one, but
> since libuv is pretty well tested on other archs, it's probably a
> PA-RISC issue.

I'd assume it's a problem in libuv.
I'm not saying libuv is doing stuff wrong, but probably not the way
it needs to be to fulfill cache requirements on parisc.

> I've encountered the problem in kernel versions 6.1.41
> and 6.1.46. 6.1.4 seemed fine, but I updated other system packages in
> the meantime, so I can't be sure.

Maybe you could try kernel git head (or 6.4.stable) too?
Those have some more io_uring and parisc patches...

> The issue is that a call to
> `io_uring_enter(fd, 2, 2, IORING_ENTER_GETEVENTS)`
> returns 0, and libuv reacts to that by aborting, probably on this line:
> https://github.com/libuv/libuv/blob/65dc822d6c20a9130fa100c7b46d751f8cf4d233/src/unix/linux.c#L1252
> (I'm saying probably, because gdb seems to be buggy on my machine and I
> don't really trust its output, so I rely on strace instead, but that
> doesn't support backtraces on the PA-RISC.)

I have not yet looked into this problem, but if the io_uring
syscalls return 0, it's often an issue that the kernel doesn't
see the same memory (due to cache aliasing) as the userspace.
The memory regions allocated with mmap() need to be done by the
kernel. The  https://github.com/axboe/liburing library should
do it right, but it seems libuv does everything itself.

> Since min_complete is 2 here and IORING_SETUP_IOPOLL was not specified
> during setup (the only flags that can be passed to io_uring_setup are 0
> and IORING_SETUP_SQPOLL), the call should (if I understand the docs
> correctly) block instead of returning.
>
> The bug manifests as aborts in CMake when compiling KDE packages, as any
> call of `cmake -E cmake_autogen ...` fails.
>
> Is this a known issue? I've seen a number of io_uring patches on the ML,
> but none seem relevant.

The best thing would be to have a small reproducer.
Do you think you can come up with something?

Helge

  reply	other threads:[~2023-08-27 15:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27 11:25 Possible io_uring bug in PA-RISC kernel 6.1.46 Vidra.Jonas
2023-08-27 15:09 ` Helge Deller [this message]
2023-08-27 20:35 ` John David Anglin
2023-08-27 20:41   ` Helge Deller
2023-08-27 21:01     ` John David Anglin
2023-08-27 21:31       ` John David Anglin
2023-08-27 21:41         ` Helge Deller
     [not found]           ` <1wd.NvQz.Gj}B593TXc.1azrF9@seznam.cz>
     [not found]             ` <1xN.NvP9.1{VV8Csbz0.1azrZI@seznam.cz>
2023-09-05 17:12               ` Vidra.Jonas
     [not found]                 ` <1M4b1y-1qfpu42R6s-001mPw@mail.gmx.net>
2023-09-09  6:11                   ` Vidra.Jonas
2023-08-28  1:45     ` Sam James
2023-08-27 21:23 ` Sam James
2023-08-31 13:38 ` Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c36e52b0-fe79-5c50-cb58-450a04e64698@gmx.de \
    --to=deller@gmx.de \
    --cc=Vidra.Jonas@seznam.cz \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox