From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65F26C2BA2B for ; Thu, 9 Apr 2020 02:28:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E387820787 for ; Thu, 9 Apr 2020 02:28:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E387820787 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 511B88E000D; Wed, 8 Apr 2020 22:28:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C2248E0006; Wed, 8 Apr 2020 22:28:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FF098E000D; Wed, 8 Apr 2020 22:28:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id 344CE8E0006 for ; Wed, 8 Apr 2020 22:28:01 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 08550181AEF09 for ; Thu, 9 Apr 2020 02:28:01 +0000 (UTC) X-FDA: 76686731562.10.pipe64_28abd14811b4f X-HE-Tag: pipe64_28abd14811b4f X-Filterd-Recvd-Size: 1741 Received: from mail3-166.sinamail.sina.com.cn (mail3-166.sinamail.sina.com.cn [202.108.3.166]) by imf50.hostedemail.com (Postfix) with SMTP for ; Thu, 9 Apr 2020 02:27:59 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.246.227.120]) by sina.com with ESMTP id 5E8E882A00004109; Thu, 9 Apr 2020 10:27:55 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 86629154919884 From: Hillf Danton To: Peter Zijlstra Cc: Peter Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, syzbot+3be1a33f04dc782e9fd5@syzkaller.appspotmail.com Subject: Re: [PATCH] mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal Date: Thu, 9 Apr 2020 10:27:45 +0800 Message-Id: <20200409022745.8400-1-hdanton@sina.com> In-Reply-To: <20200408155924.107722-1-peterx@redhat.com> References: <20200408155924.107722-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.005588, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Peter On Wed, 8 Apr 2020 19:27:23 +0200 Peter Zijlstra wrote: >=20 > > --- a/mm/gup.c > > +++ b/mm/gup.c > > @@ -1326,8 +1326,11 @@ static __always_inline long __get_user_pages_l= ocked(struct task_struct *tsk, > > * start trying again otherwise it can loop forever. > > */ > > =20 > > - if (fatal_signal_pending(current)) > > + if (fatal_signal_pending(current)) { > > + if (!pages_done) > > + pages_done =3D -EINTR; >=20 > Why -EINTR here and -ERESTARTSYS at the other site? EINTR was selected because it goes in the direction of mutex_lock_killable() and down_read_killable() as well. Be open to s/ERESTARTSYS/EINTR/ in gup if it makes a sense to you. Thanks Hillf