Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp450718ybd; Wed, 26 Jun 2019 00:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQvsBack3D/UGHae6JeX+9CXmSi7pPzU0MlpBf8n4YVI2vd7pw0cuiHc7lzx3mdnvIz4bB X-Received: by 2002:a63:2bc8:: with SMTP id r191mr1545006pgr.398.1561535075475; Wed, 26 Jun 2019 00:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561535075; cv=none; d=google.com; s=arc-20160816; b=o7i4wZGPntAMpXnex4Se9G79NVeG4xKVusP38tNHDwf4eoTsmMEU5fRPH0EwbNtsWa pycnPyNOK8V9fNkWAp6crDH3L2Nwp/603u44EPxCcSKPbQIwyDXs8nhsLmi+7DNqFgx5 QX155tWQuJ9EybyOl/QvzNlNlszdDnYin9KGucx7geqZNqAKN/Tryt54l2/lY6oB1aIN luFLcYTJx4VMDLXsIcI6hSVEYDqILEUzZUZhvv6VUbYj4TRO3BsYbgGjOnKamBQrBuFv b6lhC0l5Y1LF2NVcEYD2jW6hxNwV1Q5wVYC9ayDhY9RENGAsH4QF4rJ2jqeSmJw6Y0b9 SN9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=AYJMbDsTZYynkoysg16sIFZnKDOyQjAo4kujBrr+YvE=; b=eWmMo+s8FVf1By7NIf71HfthePlHbOjKifoEAxdiDcXP063i6Y9hMGSnzW8alLOfQx 7WlOua//HvGNhajXHKLgEU342mY/7MyIH9By9sFFKkrO/+ymAazF7XmW3u9tqroFK4w+ Cy/wiFUNOISswUglr5v6ApBjlZtj/ejWEitbNTl6a0uo9gRTzYZPgllE0tYmNHd5wbPY dB70oQGqVWsxVAtcNrUnoTJ7Lza9ngI3lWiEg9ohWiVAr4h4Zo/1p1SLrOBbvm0T5yVI cpxlODdRIvKp0DmS4rKeosnRTH3oyFZfW2M7MELSepOffWRNk9YPiUqwwwHAR7OnXWsF p6Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si14377841pgv.280.2019.06.26.00.44.19; Wed, 26 Jun 2019 00:44:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfFZHoF (ORCPT + 99 others); Wed, 26 Jun 2019 03:44:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34478 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726416AbfFZHoE (ORCPT ); Wed, 26 Jun 2019 03:44:04 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C4045D672; Wed, 26 Jun 2019 07:43:54 +0000 (UTC) Received: from xz-x1 (ovpn-12-42.pek2.redhat.com [10.72.12.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7FC9C1001B04; Wed, 26 Jun 2019 07:43:36 +0000 (UTC) Date: Wed, 26 Jun 2019 15:43:30 +0800 From: Peter Xu To: Linus Torvalds Cc: Linux-MM , Linux List Kernel Mailing , David Hildenbrand , Hugh Dickins , Maya Gokhale , Jerome Glisse , Pavel Emelyanov , Johannes Weiner , Martin Cracauer , Denis Plotnikov , Shaohua Li , Andrea Arcangeli , Mike Kravetz , Marty McFadden , Mike Rapoport , Mel Gorman , "Kirill A . Shutemov" , "Dr . David Alan Gilbert" Subject: Re: [PATCH v5 02/25] mm: userfault: return VM_FAULT_RETRY on signals Message-ID: <20190626074330.GB24379@xz-x1> References: <20190620022008.19172-1-peterx@redhat.com> <20190620022008.19172-3-peterx@redhat.com> <20190624074250.GF6279@xz-x1> <20190625053047.GC10020@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 26 Jun 2019 07:44:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 09:59:58AM +0800, Linus Torvalds wrote: > On Tue, Jun 25, 2019 at 1:31 PM Peter Xu wrote: > > > > Yes that sounds reasonable to me, and that matches perfectly with > > TASK_INTERRUPTIBLE and TASK_KILLABLE. The only thing that I am a bit > > uncertain is whether we should define FAULT_FLAG_INTERRUPTIBLE as a > > new bit or make it simply a combination of: > > > > FAULT_FLAG_KILLABLE | FAULT_FLAG_USER > > It needs to be a new bit, I think. > > Some things could potentially care about the difference between "can I > abort this thing because the task will *die* and never see the end > result" and "can I abort this thing because it will be retried". > > For a regular page fault, maybe FAULT_FLAG_INTERRUPTBLE will always be > set for the same things that set FAULT_FLAG_KILLABLE when it happens > from user mode, but at least conceptually I think they are different, > and it could make a difference for things like get_user_pages() or > similar. > > Also, I actually don't think we should ever expose FAULT_FLAG_USER to > any fault handlers anyway. It has a very specific meaning for memory > cgroup handling, and no other fault handler should likely ever care > about "was this a user fault". So I'd actually prefer for people to > ignore and forget that hacky flag entirely, rather than give it subtle > semantic meaning together with KILLABLE. OK. > > [ Side note: this is the point where I may soon lose internet access, > so I'll probably not be able to participate in the discussion any more > for a while ] Appreciate for these suggestions. I'll prepare something with that new bit and see whether that could be accepted. I'll also try to split those out of the bigger series. Thanks, -- Peter Xu