Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp167969ybd; Tue, 25 Jun 2019 19:00:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSkVtRERwRYqZKS3xb61o+6qBW7hcIoEei537iabh/sRsBYwmQ4jecVrkPIrt0M4bO+ODj X-Received: by 2002:a17:902:a5c5:: with SMTP id t5mr2093025plq.288.1561514439299; Tue, 25 Jun 2019 19:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561514439; cv=none; d=google.com; s=arc-20160816; b=ZOCT41srw1feMEwJmNTgLcuel1SCx01KZH6Meq7uJCBj4PVycHy53KCg9SyJvY1Bdo itPOBHs01kVykj6gZ6H/eiMQDGKC1tSrdnFFiT1WFeGCCP1ezixSOXTFkh3m3wP91vdD V9L6F8I/lnQj+jcN61DPLYKNxe8pCoiDBKkduMZOQkJmnUhtVacTKrnuzxLR2g5IXbHO 7GEK2Rq89DJwWwDz/yp4ILrCvrdrl0TPXiABd4h16ZXID1iqXbo9396lgUnB7AL2J53I Bk9NQjO5zbmpbGSN3clxBz6PT2hzZL04EJK9Cf4FJ5NWF9wqw41Fay6O/05G8+YpggUx LHkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZsgDSI95KqePAPPmaFBiHY1206TOaDNoZExEWQf1Sgo=; b=BHDf6ryxJ+cHjbUym//O+XYPmKiR+dQYS77K85wABQlpRVaD0opPSpX7MwoeGv1GIs APaRts0nma1dGSAEgZ3aMfvqLAqJMQvJ7E307E02MT5bNM4mCHiZw6JINEAcuzAdoGmQ 69KNy9ramq08ael2lmt536+s5Ompjx7/OlJTAfBFOYHd2fSxzH1ZtWGX5hbMUvMT/5jh a4TcintCIgEExJtyCUAwbX91FSGkN6UnwRiQBn9jaHdswDIhBKwtsZSjJq0kl1Z3uVc6 QCpQodcEEjgwD5m4jxSMimTJtIajvoxeqv75CaiMC1iOxwXAnm3CAF3SrjJRwvjKieJY GYkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=VwxNwghj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si1824794pla.432.2019.06.25.19.00.22; Tue, 25 Jun 2019 19:00:39 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=VwxNwghj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbfFZCAT (ORCPT + 99 others); Tue, 25 Jun 2019 22:00:19 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38147 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbfFZCAR (ORCPT ); Tue, 25 Jun 2019 22:00:17 -0400 Received: by mail-lf1-f66.google.com with SMTP id b11so396424lfa.5 for ; Tue, 25 Jun 2019 19:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZsgDSI95KqePAPPmaFBiHY1206TOaDNoZExEWQf1Sgo=; b=VwxNwghjBlw6GDL//RFARFoXaDXKpoQaUs6zJSY4ZWsCZaI26bo7Npqkcj1+QDQtcx GVs1+ScO8o6NledD1rJbu3+AA5VOwqzSvHJzkC9ABBvPoIuMq+feRogzt1wHTnXJbjmu We4/fXRgj5n6LY0T1QL70h/w/6qH6xvQq668w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZsgDSI95KqePAPPmaFBiHY1206TOaDNoZExEWQf1Sgo=; b=kPSztUpooAKhsWvsd/ry7txyS7oxKvUtwbs0helgFnisaE9gqTRNGyiIQ/mmS1fpID aAlGgJwjvqu6IqZwL2WxXTOFUyMCQDRIx+Mrj/gnslf12FZOAcBirfnIN+SAQSrWgVtk ZR7Kk2uNSDVB95YIDGD4S/P3jagteUXs+3PMuaZ2iQzuKhlXzVN4HFA4ngTuMHbg0nK8 jVRikGRYLWh5NZuFn95CMsLBoc42r8zXqRW2IGIMJMgllkPyM95xDxY8jM0wI1L41cNh SeUVand0MXaqabFBmF//lrE8dJes6qZ4g0Wry/65rqwuxLiRgUK5ewNgGwv4ZiMIPxAU 1y/Q== X-Gm-Message-State: APjAAAUSd0sbyxnYzZb+qpaOF7oKwA5FzOCJMRqEppfXB4vrSM0Neltm TV7xx5nLtSA+tN1TiHxzXv6ry2VZKGqU3A== X-Received: by 2002:ac2:41d3:: with SMTP id d19mr939981lfi.127.1561514415702; Tue, 25 Jun 2019 19:00:15 -0700 (PDT) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id 199sm2559127ljf.44.2019.06.25.19.00.14 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 19:00:14 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id y198so408715lfa.1 for ; Tue, 25 Jun 2019 19:00:14 -0700 (PDT) X-Received: by 2002:ac2:44c5:: with SMTP id d5mr993375lfm.134.1561514414187; Tue, 25 Jun 2019 19:00:14 -0700 (PDT) MIME-Version: 1.0 References: <20190620022008.19172-1-peterx@redhat.com> <20190620022008.19172-3-peterx@redhat.com> <20190624074250.GF6279@xz-x1> <20190625053047.GC10020@xz-x1> In-Reply-To: <20190625053047.GC10020@xz-x1> From: Linus Torvalds Date: Wed, 26 Jun 2019 09:59:58 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 02/25] mm: userfault: return VM_FAULT_RETRY on signals To: Peter Xu 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" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. [ 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 ] Linus