linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Peter Xu <peterx@redhat.com>
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 05:52:20 +0100	[thread overview]
Message-ID: <aAsVBIIUvXJ6KQ5d@casper.infradead.org> (raw)
In-Reply-To: <aAqxAX2PimC2uZds@x1.local>

On Thu, Apr 24, 2025 at 05:45:37PM -0400, Peter Xu wrote:
> On Thu, Apr 24, 2025 at 08:42:00PM +0100, Matthew Wilcox wrote:
> > On Thu, Apr 24, 2025 at 02:26:37PM -0400, Peter Xu wrote:
> > > Secondly, userfaultfd is indeed the only consumer of
> > > FAULT_FLAG_INTERRUPTIBLE but not necessary always in the future.  While
> > > this patch resolves it for userfaultfd, it might get caught again later if
> > > something else in the kernel starts to respects the _INTERRUPTIBLE flag
> > > request.  For example, __folio_lock_or_retry() ignores that flag so far,
> > > but logically it should obey too (with a folio_wait_locked_interruptible)..
> > 
> > No.  Hell, no.  We don't want non-fatal signals being able to interrupt
> > that.  There's a reason we introduced killable as a concept in the first
> > place.
> 
> Not really proposing that as I don't have a use caes.  Just curious, could
> you explain a bit why having it interruptible is against the killable
> concept if (IIUC) it is still killable?

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.


  reply	other threads:[~2025-04-25  4:52 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 [this message]
2025-04-25 15:44           ` Peter Xu

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=aAsVBIIUvXJ6KQ5d@casper.infradead.org \
    --to=willy@infradead.org \
    --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=peterx@redhat.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