From: David Hildenbrand <david@redhat.com>
To: Guoyu Yin <y04609127@gmail.com>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, x86@kernel.org, hpa@zytor.com
Subject: Re: [BUG] RCU Detected Stall in sys_process_vm_writev
Date: Mon, 19 May 2025 09:36:55 +0200 [thread overview]
Message-ID: <14bbdbd4-fa86-4317-a051-8e1defc7192e@redhat.com> (raw)
In-Reply-To: <CAJNGr6v1GL=ZzgGar7NCjCGVBaAO7YVYU7bBhUt3T4T-DAnUAw@mail.gmail.com>
On 19.05.25 07:19, Guoyu Yin wrote:
> Hi,
>
> I discovered a kernel crash using the Syzkaller framework, described
> as "INFO: rcu detected stall in sys_process_vm_writev". This issue
> occurs during the execution of the sys_process_vm_writev system call,
> where RCU detects a stall on CPU 0.
>
> From the dmesg log, CPU 3 is stuck trying to acquire a spinlock in the
> pgd_free function (arch/x86/mm/pgtable.c:490), leading to the RCU
> stall. This is likely caused by spinlock contention triggered by the
> page pinning and unpinning logic in sys_process_vm_writev under high
> load or abnormal conditions.
pgd_free() calls pgd_dtor() where we should be taking the pgd_lock.
Apart from that, only the buddy allocator might be taking locks when
freeing the page.
>
> I recommend reviewing the page pinning (pin_user_pages_remote) and
> unpinning (unpin_user_pages_dirty_lock) logic in
> process_vm_rw_single_vec (mm/process_vm_access.c) to ensure it does
> not cause prolonged spinlock blocking due to scheduling delays or
> resource contention.
This almost reads like AI generated content.
Anyhow, unpin_user_pages_dirty_lock() should only be taking the folio
lock, and pin_user_pages_remote() should only be taking page table locks.
As I am sure you wouldn't bother us with AI generated slop, what makes
you think that the pgd_lock is relevant in the context of GUP?
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-05-19 7:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 5:19 [BUG] RCU Detected Stall in sys_process_vm_writev Guoyu Yin
2025-05-19 7:36 ` David Hildenbrand [this message]
2025-05-19 15:42 ` Dave Hansen
2025-05-23 17:34 ` Dave Hansen
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=14bbdbd4-fa86-4317-a051-8e1defc7192e@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=y04609127@gmail.com \
/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