From: Peter Xu <peterx@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>
Subject: Re: [PATCH] mm/userfaultfd: prevent busy looping for tasks with signals pending
Date: Fri, 25 Apr 2025 11:44:58 -0400 [thread overview]
Message-ID: <aAut-ohM5Lt2uH4I@x1.local> (raw)
In-Reply-To: <aAsVBIIUvXJ6KQ5d@casper.infradead.org>
On Fri, Apr 25, 2025 at 05:52:20AM +0100, Matthew Wilcox wrote:
> Because "interruptible" means it can be interrupted by inane stuff like
> SIGWINCH and SIGALRM. And then we return from a page fault prematurely
> and can't actually handle the situation, so we end up going back into the
> page fault handler anyway having accomplished nothing other than burn CPU.
>
> At least it's better than interruptible system calls which just gets
> you short reads, corrupted data and crashing programs.
I see where it came from now, thanks.
IIUC it'll be a major spinning issue only if the fault is generated from
the sighandler itself which spins on its own. The hope is that sighandler
should almost always be suggested to be as tiny as possible, to make it
unlikely to happen. Said that, it's a valid point indeed.
Maybe we should make FAULT_FLAG_INTERRUPTIBLE a hint rather than a request
to handle_mm_fault(), so the internal of page resolution can decide whether
to respect the hint.
Thanks,
--
Peter Xu
prev parent reply other threads:[~2025-04-25 15:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 23:37 Jens Axboe
2025-04-24 14:03 ` Johannes Weiner
2025-04-24 14:54 ` Jens Axboe
2025-04-24 15:11 ` Johannes Weiner
2025-04-24 15:22 ` Jens Axboe
2025-04-24 18:26 ` Peter Xu
2025-04-24 18:40 ` Jens Axboe
2025-04-24 19:13 ` Peter Xu
2025-04-24 19:20 ` Jens Axboe
2025-04-24 19:57 ` Peter Xu
2025-05-01 16:18 ` Peter Xu
2025-05-01 16:28 ` Peter Xu
2025-04-24 19:42 ` Matthew Wilcox
2025-04-24 21:45 ` Peter Xu
2025-04-25 4:52 ` Matthew Wilcox
2025-04-25 15:44 ` Peter Xu [this message]
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=aAut-ohM5Lt2uH4I@x1.local \
--to=peterx@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=hannes@cmpxchg.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.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