From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Pedro Falcato" <pfalcato@suse.de>,
"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Hildenbrand" <david@redhat.com>,
amd-gfx@lists.freedesktop.org, linux-mm@kvack.org,
"Vlastimil Babka" <vbabka@suse.cz>,
"Jann Horn" <jannh@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v4 1/2] mm_take_all_locks: change -EINTR to -ERESTARTSYS
Date: Thu, 8 Jan 2026 10:33:45 -0500 [thread overview]
Message-ID: <ux2hd37hjli2fxzovezellikqwpe6ep37xayihr2nzw7llnfpm@lvtkp6pw5len> (raw)
In-Reply-To: <20260107203224.969740802@debian4.vm>
* Mikulas Patocka <mpatocka@redhat.com> [260107 15:32]:
> If a process receives a signal while it executes some kernel code that
> calls mm_take_all_locks, we get -EINTR error. The -EINTR is propagated up
> the call stack to userspace and userspace may fail if it gets this
> error.
>
> This commit changes -EINTR to -ERESTARTSYS, so that if the signal handler
> was installed with the SA_RESTART flag, the operation is automatically
> restarted.
>
> For example, this problem happens when using OpenCL on AMDGPU. If some
> signal races with clGetDeviceIDs, clGetDeviceIDs returns an error
> CL_DEVICE_NOT_FOUND (and strace shows that open("/dev/kfd") failed with
> EINTR).
>
> This problem can be reproduced with the following program.
>
> To run this program, you need AMD graphics card and the package
> "rocm-opencl" installed. You must not have the package "mesa-opencl-icd"
> installed, because it redirects the default OpenCL implementation to
> itself.
What about [1]? This reproducer should be fixed in the ROCm userspace
library, as stated by Christian König.
1. https://lore.kernel.org/linux-mm/5c8ccd03-9a3a-47c0-9a89-be0abf6c1fb5@amd.com/
Thanks,
Liam
next prev parent reply other threads:[~2026-01-08 15:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 20:31 [PATCH v4 0/2] Fix failures with signals and AMD OpenCL Mikulas Patocka
2026-01-07 20:31 ` [PATCH v4 1/2] mm_take_all_locks: change -EINTR to -ERESTARTSYS Mikulas Patocka
2026-01-07 20:55 ` Matthew Wilcox
2026-01-07 21:29 ` Mikulas Patocka
2026-01-08 15:25 ` Lorenzo Stoakes
2026-01-08 15:33 ` Liam R. Howlett [this message]
2026-01-07 20:31 ` [PATCH v4 2/2] amdgpu: delete the "Failed to register MMU notifier" message Mikulas Patocka
2026-01-08 15:20 ` Lorenzo Stoakes
2026-01-08 15:30 ` Liam R. Howlett
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=ux2hd37hjli2fxzovezellikqwpe6ep37xayihr2nzw7llnfpm@lvtkp6pw5len \
--to=liam.howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=david@redhat.com \
--cc=jannh@google.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mpatocka@redhat.com \
--cc=pfalcato@suse.de \
--cc=stable@vger.kernel.org \
--cc=vbabka@suse.cz \
/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