linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Peter Xu <peterx@redhat.com>, Linux-MM <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hillf Danton <hdanton@sina.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	syzbot+3be1a33f04dc782e9fd5@syzkaller.appspotmail.com,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH] mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal
Date: Wed, 8 Apr 2020 10:32:16 -0700	[thread overview]
Message-ID: <CAHk-=wjYpkgECNNk0O6+TyoUgJCB0Ny19HOSHZfDyHR4ms5TyA@mail.gmail.com> (raw)
In-Reply-To: <20200408172723.GR20730@hirez.programming.kicks-ass.net>

On Wed, Apr 8, 2020 at 10:27 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > -             if (fatal_signal_pending(current))
> > +             if (fatal_signal_pending(current)) {
> > +                     if (!pages_done)
> > +                             pages_done = -EINTR;
>
> Why -EINTR here and -ERESTARTSYS at the other site?

I'd prefer EINTR for all fatal signals.

Not because it should matter (it's fatal, after all, the thread should
die before it ever sees it), but because I think it's less confusing.

If something is fatal, it sure as hell isn't going to restart any system calls.

But interrupting things because of fatal signals sounds sane (even if
the error code makes it to user space it's interrupting the flow of
code).

So I'd say that the other place should probably be EINTR too. But it
would obviously be a good idea to verify that no caller cares..

           Linus

              Linus

      reply	other threads:[~2020-04-08 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 15:59 [PATCH] mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal Peter Xu
2020-04-08 16:20 ` Linus Torvalds
2020-04-08 17:13   ` Michal Hocko
2020-04-08 17:27 ` Peter Zijlstra
2020-04-08 17:32   ` Linus Torvalds [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='CAHk-=wjYpkgECNNk0O6+TyoUgJCB0Ny19HOSHZfDyHR4ms5TyA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=peterx@redhat.com \
    --cc=peterz@infradead.org \
    --cc=syzbot+3be1a33f04dc782e9fd5@syzkaller.appspotmail.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).