Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4909555ybv; Mon, 17 Feb 2020 08:15:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwK6+b3kv88QEABcJg30Ud6Y9pzj0BxvZrueUAEj4aW68dIz77c57DY7s3g9WinbC3C57xm X-Received: by 2002:aca:ebc3:: with SMTP id j186mr10089761oih.15.1581956120898; Mon, 17 Feb 2020 08:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581956120; cv=none; d=google.com; s=arc-20160816; b=F5hk9asvltmMPRGyeFf95/Y9ripUF5uhzhu4N3vA2so2UsePJcaeSmuz1rchSDQIXD aabcO62OUIVAu3sM9hDuAH0qL+CkocanDthQybhOW5DFwczQIfCMk1jYv5RuqS+k7lDq AJYnj0jE5xfqBb+2pXHHZzNwBSPrBo66R2jSbW9vYApKLvqGm5ghx+I0wA5r1CZlsgAM rzWNuFENiuvdRU6prxc71H8gTzhK+ILObhdteTwhD3GHymyxJdg700wgivLWboPLySma EZMvQtudPqpZ17mDp2UQQJn98/kQVEXOp2QJtFuetVh0+QI9ovMdYY21nhVSqUlO+O4B Y8Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kbx9I3JxwrUQZkW+ffvblVzm+qjbx3whOPslU+AU5xI=; b=J3CThN785l8eUZugrz1E6hj6XxHsZVr2JcrGPw1Cu+S9/3cpIuke5VYn0Iv1ISLtom ETOODSiqdI0Ujh8DtgqAC6SnfRsxbXhaiKW9kUKwMf0rICK7aF8bZRA3WzGlpRjh0hBO 6+wN9rsvgLeL2Du8pjoo+KZIOYyUtaLj8vpb6wOMYKZtiO0zdSCVZMG4YFwlXpSTJ1Bq ObqaZAxyROsO3XDwIs3ebGdR6utUmDD5sDivE5m5O8gmrhZwDSD/i+dJ9Itr20E8D3ro 9gqIA+cakdxeJIAZslkIhAwXQty3dDC0PTuSPOneFxuNqyuZBnEsH5UF8vOS6DUzNKdU WILQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WIvzAmLz; 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=pass (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 u8si388014otq.262.2020.02.17.08.15.08; Mon, 17 Feb 2020 08:15:20 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=WIvzAmLz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728958AbgBQQHu (ORCPT + 99 others); Mon, 17 Feb 2020 11:07:50 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:48107 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726420AbgBQQHu (ORCPT ); Mon, 17 Feb 2020 11:07:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581955670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kbx9I3JxwrUQZkW+ffvblVzm+qjbx3whOPslU+AU5xI=; b=WIvzAmLzC8bZFgCKNVqpG1nYchkIwwuvZQMKHYEmyJ0NWgKc4p+AgdAiDp0FjRmYm8LCKX vH4kIUi+J4Tf+xZXNNHs3tz1+6xwSKY6sUOwX+rSr9dSHrUuEBBbSNz3KUNu3dIXbwSjcM lQH10KivcHs62QCPZnqOjP0F53ivb6c= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-419-pL5prqWANX6AmsPpPcw9jw-1; Mon, 17 Feb 2020 11:07:42 -0500 X-MC-Unique: pL5prqWANX6AmsPpPcw9jw-1 Received: by mail-qv1-f71.google.com with SMTP id z9so10539649qvo.10 for ; Mon, 17 Feb 2020 08:07:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kbx9I3JxwrUQZkW+ffvblVzm+qjbx3whOPslU+AU5xI=; b=dFUHzSS5P0Dxt/U7w9iwmKmnmbyAjDDrs1wnth6aon9P2X5ERQ0LPKzw2t+hblznGY AS0/KHF5GnvrMwMlgwHnhGwqE7bdvmDl5oRY/j9uuoRKOS2sQpu1sDznLO2rkFAkkbj4 ZLN4HzZANOh5YC6W8sjyxIahooeWQPxg3qi8qHU/xD5N/FzrQLsyRDH0IYjOAJBhzJkx Qi5HkYnwefCKR6vPDO5SLWQpXHyzl8v0o645X+yvy/T7aJt6jkDhehNfBlywvtofdJar hyzP2zaiWHM6J7LbSzMlUSUX85Oe2wYKhkmNLEO499AxKrpUo1XzJP5mBbJjoOtVaHR2 c3gg== X-Gm-Message-State: APjAAAUIthw7M/ibRUIertfhrELg6Kj68a9tSwIMujbSZiy1Tj3rqsw0 3MKWyxKwptFW0gCBzWQGeDrgXlYochDBt1rZPnGuU1Puy1SaYh1sMHq57O88uYDAxwBDCA5mgJA Wq7wpuqItjqTSu4mfk5ydJfOF X-Received: by 2002:a05:620a:247:: with SMTP id q7mr14627040qkn.199.1581955661923; Mon, 17 Feb 2020 08:07:41 -0800 (PST) X-Received: by 2002:a05:620a:247:: with SMTP id q7mr14627018qkn.199.1581955661687; Mon, 17 Feb 2020 08:07:41 -0800 (PST) Received: from xz-x1 (CPEf81d0fb19163-CMf81d0fb19160.cpe.net.fido.ca. [72.137.123.47]) by smtp.gmail.com with ESMTPSA id z6sm436668qka.34.2020.02.17.08.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 08:07:41 -0800 (PST) Date: Mon, 17 Feb 2020 11:07:39 -0500 From: Peter Xu To: Brian Geffon Cc: Andrea Arcangeli , Andrew Morton , linux-mm , LKML , Mike Rapoport , Sonny Rao , "Kirill A . Shutemov" Subject: Re: [RFC PATCH] userfaultfd: Address race after fault. Message-ID: <20200217160739.GB1309280@xz-x1> References: <20200214225849.108108-1-bgeffon@google.com> <20200214231954.GA29849@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 15, 2020 at 09:29:46AM -0500, Brian Geffon wrote: > Hi Andrea, > Thanks for the quick reply. That's great to hear that Peter has been > working on those improvements. I didn't try the entire patchset but I > did confirm that patch 13, not surprisingly, also resolves that issue > on at least on x86: > https://lkml.org/lkml/2019/9/26/179 > > Given that seems pretty low risk and it definitely resolves a pretty > big issue for the non-cooperative userfaultfd case, any chance it > could be landed ahead of the rest of the series? Thanks Andrea & Brian! Yes it would be great if the series (or some of the patches) could be moved forward. Please just let me know if there's still anything I can do from my side. Thanks, > > Thanks, > Brian > > On Fri, Feb 14, 2020 at 6:20 PM Andrea Arcangeli wrote: > > > > Hello, > > > > this and other enhancements have already implemented by Peter (CC'ed) > > and in the right way, by altering the retry logic in the page fault > > code. This is a requirement for other kind of usages too, notably the > > UFFD_WRITEPROTECT ioctl after which multiple consecutive faults can > > happen and must be handled. > > > > IIRC Kirill asked at last LSF-MM uffd-wp talk if there's any > > particular reason the fault couldn't be retried currently. I had no > > sure answer other than there's apparently no strong reason why > > VM_FAULT_RETRY is only allowed 1 time currently, so there should be no > > issue in lifting that artificial restriction. > > > > I'm running with this patchset applied in my systems since Nov with no > > regression at all. I got sidetracked by various other issues, so > > unfortunately I didn' post a proper reviewed-by on the last submit yet > > (pending), but I did at least test it and it was rock solid so far. > > > > https://lore.kernel.org/lkml/20190926093904.5090-1-peterx@redhat.com/ > > > > Can you test and verify it too if it solves your use case? > > > > Also note the complete uffd-WP support submit also from Peter: > > > > https://lore.kernel.org/lkml/20190620022008.19172-1-peterx@redhat.com/ > > > > https://github.com/xzpeter/linux/tree/uffd-wp-merged > > > > Thanks, > > Andrea > > > -- Peter Xu