Hi

I have a program that registers a periodic timer that sends SIGALRM with
1ms interval. If I compile a dummy OpenCL kernel while the signal is
triggered, I get these messages:

"amdgpu: init_user_pages: Failed to register MMU notifier: -4"

Apparently, there needs to be fatal_signal_pending.

Signed-off-by: Mikulas Patocka <[email protected]>
Cc: [email protected]

---
 mm/vma.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6/mm/vma.c
===================================================================
--- linux-2.6.orig/mm/vma.c     2025-10-13 21:42:48.000000000 +0200
+++ linux-2.6/mm/vma.c  2025-11-02 19:54:04.000000000 +0100
@@ -2156,7 +2156,7 @@ static void vm_lock_mapping(struct mm_st
  * mm_take_all_locks() and mm_drop_all_locks are expensive operations
  * that may have to take thousand of locks.
  *
- * mm_take_all_locks() can fail if it's interrupted by signals.
+ * mm_take_all_locks() can fail if it's interrupted by fatal signals.
  */
 int mm_take_all_locks(struct mm_struct *mm)
 {
@@ -2175,14 +2175,14 @@ int mm_take_all_locks(struct mm_struct *
         * is reached.
         */
        for_each_vma(vmi, vma) {
-               if (signal_pending(current))
+               if (fatal_signal_pending(current))
                        goto out_unlock;
                vma_start_write(vma);
        }
 
        vma_iter_init(&vmi, mm, 0);
        for_each_vma(vmi, vma) {
-               if (signal_pending(current))
+               if (fatal_signal_pending(current))
                        goto out_unlock;
                if (vma->vm_file && vma->vm_file->f_mapping &&
                                is_vm_hugetlb_page(vma))
@@ -2191,7 +2191,7 @@ int mm_take_all_locks(struct mm_struct *
 
        vma_iter_init(&vmi, mm, 0);
        for_each_vma(vmi, vma) {
-               if (signal_pending(current))
+               if (fatal_signal_pending(current))
                        goto out_unlock;
                if (vma->vm_file && vma->vm_file->f_mapping &&
                                !is_vm_hugetlb_page(vma))
@@ -2200,7 +2200,7 @@ int mm_take_all_locks(struct mm_struct *
 
        vma_iter_init(&vmi, mm, 0);
        for_each_vma(vmi, vma) {
-               if (signal_pending(current))
+               if (fatal_signal_pending(current))
                        goto out_unlock;
                if (vma->anon_vma)
                        list_for_each_entry(avc, &vma->anon_vma_chain, same_vma)

Reply via email to