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=-7.4 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,USER_AGENT_SANE_1 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 974F2C35242 for ; Fri, 14 Feb 2020 23:20:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D9942168B for ; Fri, 14 Feb 2020 23:20:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gILVn13l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D9942168B 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 E9B736B0006; Fri, 14 Feb 2020 18:20:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E4C996B0007; Fri, 14 Feb 2020 18:20:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3B636B0008; Fri, 14 Feb 2020 18:20:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id BDFF26B0006 for ; Fri, 14 Feb 2020 18:20:07 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 666815010 for ; Fri, 14 Feb 2020 23:20:07 +0000 (UTC) X-FDA: 76490302854.02.fang98_3b2f6e3680109 X-HE-Tag: fang98_3b2f6e3680109 X-Filterd-Recvd-Size: 3515 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Feb 2020 23:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581722406; 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=Z34VtLc1BYtNZqTBh3fQkOhafmRPIz9ekzq0qoyZ9B8=; b=gILVn13lxK206MViNSvZbx7UtcwzvH4ctDqcUtI7FJVx+M/I6BevDPwkBNYjvg2KkfhTC5 h+bs7uzpiHb4GTjAtur3BVzd5xo81zCusWaNxtC4veXZLr1+4FlYcqymgz1JLERySVaaJq 1S7MItv34uROM8AopcCxMseQ9NOdOQY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-o2pCaLhFOHaTGurnNWKV2g-1; Fri, 14 Feb 2020 18:20:00 -0500 X-MC-Unique: o2pCaLhFOHaTGurnNWKV2g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B96578017CC; Fri, 14 Feb 2020 23:19:58 +0000 (UTC) Received: from mail (ovpn-120-118.rdu2.redhat.com [10.10.120.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1174A60BE1; Fri, 14 Feb 2020 23:19:56 +0000 (UTC) Date: Fri, 14 Feb 2020 18:19:54 -0500 From: Andrea Arcangeli To: Brian Geffon Cc: Andrew Morton , linux-mm , linux-kernel@vger.kernel.org, Mike Rapoport , Sonny Rao , "Kirill A . Shutemov" , Peter Xu Subject: Re: [RFC PATCH] userfaultfd: Address race after fault. Message-ID: <20200214231954.GA29849@redhat.com> References: <20200214225849.108108-1-bgeffon@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200214225849.108108-1-bgeffon@google.com> User-Agent: Mutt/1.13.1 (2019-12-14) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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: 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