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=-5.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 E2124C34022 for ; Mon, 17 Feb 2020 16:07:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A148820718 for ; Mon, 17 Feb 2020 16:07:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KtsNurcL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A148820718 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 360AA6B0005; Mon, 17 Feb 2020 11:07:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 311726B0006; Mon, 17 Feb 2020 11:07:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D9406B0007; Mon, 17 Feb 2020 11:07:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 034F56B0005 for ; Mon, 17 Feb 2020 11:07:50 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8E5DD4428 for ; Mon, 17 Feb 2020 16:07:50 +0000 (UTC) X-FDA: 76500099900.01.guide23_6169efabb5a2e X-HE-Tag: guide23_6169efabb5a2e X-Filterd-Recvd-Size: 5981 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Feb 2020 16:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581955668; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m5ej/J75jXWXc/Zx40E+MBOFzQyWZf5MOfgqcNJMdQA=; b=KtsNurcLuF0hgVKVsSdnzHbnW0uiV0Zrb0NZ5OwwM1TlTIMKFGoQWF6ZS5hkyA0ksfOcJE 2BgYGLScalFUJ+ADi0yuZdaonuOqm9qDWwMogMArDvPKAtGtqg29CNz0TznmhBjpghQoxr /iMMsL9wQrWZbKEeWUjdqQh83BLfSUw= 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-20-krJWn0IHMxGkODYLtU6ODQ-1; Mon, 17 Feb 2020 11:07:42 -0500 Received: by mail-qv1-f71.google.com with SMTP id l1so10569095qvu.13 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=q++G78W1U1LNmr31qF8AXPQXRnfao4zLIvgTtOzXvlmP/PyzfA+mPh+eEM9lmVdeJR XemGQPE/yEFEE1GnO3/XYa/8iCbHnV3iP4aapLcAX32kktesKMGZ6VlmVOKz0dVOUVTj Xl/xFO8lKZwDvgsLVqPE9um3cs2qbBxmbsmD98vkicNFF7PK2ojBBjc8Kp6B+WAfiU7z gmeEB1LJxBQ3lF+FyLjV4R9n5QOcQqEM9HdOjQ9B7u2X3O99yqBVYZFCHLAk1d31E/Zb IXPH0iWV4N/FgfsJOs6Tjb/M/iiLTy4XNdQR0sdPDGA/GU/kUFaMQvRSKQ3Cq015JOHB Tp1g== X-Gm-Message-State: APjAAAXdMWEjsjpF5QQnHYpqs80S/wFAGwTOj9UMyg7tR19CVOaJKtHa aF/31jfGY/Z2JnUNFWBws7jQWqio0Sz//S71W6NQJxq17xCdB71arVNtFJv3+POk4160WnVzwo9 W6EA0IJn63SQ= X-Received: by 2002:a05:620a:247:: with SMTP id q7mr14627042qkn.199.1581955661924; Mon, 17 Feb 2020 08:07:41 -0800 (PST) X-Google-Smtp-Source: APXvYqx2VRNMX8abWk3f0ggJhIMzMa5PLM2pRAIizOOJFe1xnKGfAwZMSeV2nnkRkbwQMMhdEA/y6A== 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 In-Reply-To: X-MC-Unique: krJWn0IHMxGkODYLtU6ODQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 >=20 > 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, >=20 > Thanks, > Brian >=20 > On Fri, Feb 14, 2020 at 6:20 PM Andrea Arcangeli wr= ote: > > > > 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 > > >=20 --=20 Peter Xu