Re: [PATCH v5 02/25] mm: userfault: return VM_FAULT_RETRY on signals

From: Linus Torvalds
Date: Mon Jun 24 2019 - 09:32:04 EST


On Mon, Jun 24, 2019 at 3:43 PM Peter Xu <peterx@xxxxxxxxxx> wrote:
>
> Should we still be able to react on signal_pending() as part of fault
> handling (because that's what this patch wants to do, at least for an
> user-mode page fault)? Please kindly correct me if I misunderstood...

I think that with this patch (modulo possible fix-ups) then yes, as
long as we're returning to user mode we can do signal_pending() and
return RETRY.

But I think we really want to add a new FAULT_FLAG_INTERRUPTIBLE bit
for that (the same way we already have FAULT_FLAG_KILLABLE for things
that can react to fatal signals), and only do it when that is set.
Then the page fault handler can set that flag when it's doing a
user-mode page fault.

Does that sound reasonable?

Linus