Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp602338imw; Mon, 4 Jul 2022 16:02:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uaV5bgwDZTX8rRKTNWe0XSlT+IofDFRvGhHUvg3USnDzDVlaEM32OYL6SaRJbLCccYraQe X-Received: by 2002:a05:6402:c44:b0:431:52cc:f933 with SMTP id cs4-20020a0564020c4400b0043152ccf933mr41650945edb.41.1656975733536; Mon, 04 Jul 2022 16:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656975733; cv=none; d=google.com; s=arc-20160816; b=j+iVsR++17gp7ziCn88FmOs7O7hTowJHSBCDFYytGEyWD163I2QlJk7dU0FZJwdziA 18aB7CKcMKgCm1TO0PryPeiBbBHq5+9y/jxv4gtNE8JXZOeOXRVN8OG8fbWAhxL0dWj9 3v3W48/1dyiEsmt+Fnd7LzALwRORc+BSwIf91eZ0zD0n/AaGyKbcDMWBb++QWd0btYSz 2TrwrvE2uxpD/NJSB2Dlx7jgaDV9ms69/Juym56y78LdQZGi8BzNRqy2aQA64zogovlW 4XXDUurD10nJuhhiMkA8FQF4c0Hf9oKFb9KdCkd+XtdcRbRsNSJhOefcl5Tsg4NGaWBg kN1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tVbYeuMqVTWB9+a2w9YagXruu2c1wBOJ3lmVRIIQvTA=; b=Gs3iWcB9NLQdlXWjs96fXmIm0wv2EfV3U/DF6mPQY2ShkfcqYDjmftQrxbR13bCajJ rP1+rWLElaT+optFoOyNIwIEgfODkSqgcz89qj74VncdQhUiJGXrM4b0GZy2mP44SVcE uAVAlMx2ez6BKMGYRexKsViTe9kc3M7vuAF3dpvq0Asww5MX9HU8+66oQxNYgayrp+Dd EA/gYQLBy4f6pzSp1ck59Dd1iBRZZbhcy9caKWQVYNMKvibpXQbr09TwQ6+DyYLUAjbq ceaM0Y5lri+mLGnRo5cMxBfqG1bx9+44AFcDjT8S7rAwCnGLYCQW8kUI9fVVmf+3DcqF 9TAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JM20klr5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd13-20020a1709069b8d00b0071220aa2140si17819125ejc.790.2022.07.04.16.01.48; Mon, 04 Jul 2022 16:02:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JM20klr5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbiGDWsY (ORCPT + 99 others); Mon, 4 Jul 2022 18:48:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiGDWsW (ORCPT ); Mon, 4 Jul 2022 18:48:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63819C65; Mon, 4 Jul 2022 15:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tVbYeuMqVTWB9+a2w9YagXruu2c1wBOJ3lmVRIIQvTA=; b=JM20klr5daeztXsLkAIPypjiXc hPsm6SIhSFP5fQ86Mso2LQlakk4+El9lKuq9za+WkTrMp3B10VnWxUfx83ViFaLxnZm29m7CBziOQ Uce+U9p/xia1JMhj545L/PI1GqLBr/q3SzUKHYfM6gkY0ZLIfAKo9y/7reOoRPbjiQnpU0YUkug7T j5Djr02CkG5bv9LMDFJrkBSo+Yypb1GtSuiL6DuyPR9yKS1uM9fJbOu+0+96GtmDz7gTVVTWMn5wg 6qT3Cv4BhyZY0vwx6R6fWsKifRfZH3f7O1uh+Tcmqj4KSGTcEdVpXJaXAMYZTub3T8O46YRA17rCR 2OMxWtqw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8Ura-00031u-0w; Mon, 04 Jul 2022 22:48:18 +0000 Date: Mon, 4 Jul 2022 23:48:17 +0100 From: Matthew Wilcox To: Peter Xu Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Andrew Morton , David Hildenbrand , "Dr . David Alan Gilbert" , Andrea Arcangeli , Linux MM Mailing List , Sean Christopherson Subject: Re: [PATCH 1/4] mm/gup: Add FOLL_INTERRUPTIBLE Message-ID: References: <20220622213656.81546-1-peterx@redhat.com> <20220622213656.81546-2-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220622213656.81546-2-peterx@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 22, 2022 at 05:36:53PM -0400, Peter Xu wrote: > +/* > + * GUP always responds to fatal signals. When FOLL_INTERRUPTIBLE is > + * specified, it'll also respond to generic signals. The caller of GUP > + * that has FOLL_INTERRUPTIBLE should take care of the GUP interruption. > + */ > +static bool gup_signal_pending(unsigned int flags) > +{ > + if (fatal_signal_pending(current)) > + return true; > + > + if (!(flags & FOLL_INTERRUPTIBLE)) > + return false; > + > + return signal_pending(current); > +} This should resemble signal_pending_state() more closely, if indeed not be a wrapper of signal_pending_state().