Re: [PATCH v3 3/3] mm: use vma_start_write_killable() in process_vma_walk_lock()

From: Claudio Imbrenda

Date: Fri Feb 27 2026 - 03:58:30 EST


On Thu, 26 Feb 2026 10:24:49 -0800
Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:

> On Thu, Feb 26, 2026 at 10:10 AM Claudio Imbrenda
> <imbrenda@xxxxxxxxxxxxx> wrote:
> >
> > On Wed, 25 Feb 2026 23:06:09 -0800
> > Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:
> >
> > > Replace vma_start_write() with vma_start_write_killable() when
> > > process_vma_walk_lock() is used with PGWALK_WRLOCK option.
> > > Adjust its direct and indirect users to check for a possible error
> > > and handle it. Ensure users handle EINTR correctly and do not ignore
> > > it.
> > >
> > > Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> > > ---
> > > arch/s390/kvm/kvm-s390.c | 2 +-
> > > fs/proc/task_mmu.c | 5 ++++-
> > > mm/mempolicy.c | 14 +++++++++++---
> > > mm/pagewalk.c | 20 ++++++++++++++------
> > > mm/vma.c | 22 ++++++++++++++--------
> > > mm/vma.h | 6 ++++++
> > > 6 files changed, 50 insertions(+), 19 deletions(-)
> > >
> > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> > > index 7a175d86cef0..337e4f7db63a 100644
> > > --- a/arch/s390/kvm/kvm-s390.c
> > > +++ b/arch/s390/kvm/kvm-s390.c
> > > @@ -2948,7 +2948,7 @@ int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
> > > }
> > > /* must be called without kvm->lock */
> > > r = kvm_s390_handle_pv(kvm, &args);
> > > - if (copy_to_user(argp, &args, sizeof(args))) {
> > > + if (r != -EINTR && copy_to_user(argp, &args, sizeof(args))) {
> > > r = -EFAULT;
> > > break;
> > > }
> >
> > can you very briefly explain how we can end up with -EINTR here?
> >
> > do I understand correctly that -EINTR is possible here only if the
> > process is being killed?
>
> Correct, it would happen if the process has a pending fatal signal
> (like SIGKILL) in its signal queue.
>
> >
> > [...]

Acked-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>