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=-13.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 6696EC2BA83 for ; Sat, 15 Feb 2020 14:30:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EFD142086A for ; Sat, 15 Feb 2020 14:30:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="d4/+fPTD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFD142086A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5622A6B0005; Sat, 15 Feb 2020 09:30:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 513516B0006; Sat, 15 Feb 2020 09:30:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 401556B0007; Sat, 15 Feb 2020 09:30:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 24CD06B0005 for ; Sat, 15 Feb 2020 09:30:15 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9CA304DCA for ; Sat, 15 Feb 2020 14:30:14 +0000 (UTC) X-FDA: 76492596348.24.scent72_214459b15e4f X-HE-Tag: scent72_214459b15e4f X-Filterd-Recvd-Size: 4686 Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Sat, 15 Feb 2020 14:30:14 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id r21so14896820edq.0 for ; Sat, 15 Feb 2020 06:30:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4ShrD9ez7moVL0/KalK5SkFzM7anSQi4PH6FlFUNAEA=; b=d4/+fPTDgctzavwCqmuiCCpsgLpn+jIUknYPDSs61cauQl9+FYGv9YzmKn3Wrroo53 F7dNMtXDA59M/xigNzrR/dV6BDUZvDXDQc39qjvJxBZ46kmsoJDFYuje49T6dTndd96l KXFpiNuELLr9x9rKX7zcpkE0LMbZeRM5uHuGI/CF00ur9fSUyDujltY2n0LnrWtzHNC1 mK2FXEOJJZ4PL8ruMGoRgi245CpMlQkIUEMdE5bYPfbIsaHnJazTm2tUFWLm8bF1VHbW 3L7YX2ODo1xoHmZ/ETWFjmEjejsYeJEHQf+AOIL1HRgkBSL2meHKgcbQFsvWY52pItYT W8Vw== 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=4ShrD9ez7moVL0/KalK5SkFzM7anSQi4PH6FlFUNAEA=; b=SL6n9PNz83UqPBQ3RpU3jRlCf6Sl4Sw+Henl8ny7wYSxNU3tJNSFJPkrnnIC6Y8wQ1 Wy3i6pl//GsJZxyA7WCZbNqHViNniONjgYhgFlspdrm/g160ZclvvwIMi3cuoAme1Jta 9LzoBiZNTpb6qQNPqWcl2db5vuVJjn1O9zfL/5oB9zJfnbJ5MCqZ9+Y5+vVIb3MsLMUE 32oZ+yZICLP72y+3vjZmRdkUOcPJyExOxEPK7WpC+OMLF7pqG3+bBBfCEDZViPPNxZco eqpmQKbg6fthTQ6EF1bD8k/Hwovi5tKdaGFGbc42IeIZkAd05phehzD6EBd8vVfsWphC vICQ== X-Gm-Message-State: APjAAAWd9HJRN3/0vMgDl9/xrlt/miJfAEcpm5LP1Krtf7JHoL4x2eIH icccMgnNAEW+AYQvgp+eqmwLpKrHx+D92QZ2zOjM9A== X-Google-Smtp-Source: APXvYqwxM323KPHil1X5yz/uLQsIal7NBKyJgPA1syNh9U9MbZ4PqkU9BAuUeOiWYJWGtnMTY9sCxcsEMQGtS493ka8= X-Received: by 2002:a05:6402:2037:: with SMTP id ay23mr6917583edb.146.1581777012854; Sat, 15 Feb 2020 06:30:12 -0800 (PST) MIME-Version: 1.0 References: <20200214225849.108108-1-bgeffon@google.com> <20200214231954.GA29849@redhat.com> In-Reply-To: <20200214231954.GA29849@redhat.com> From: Brian Geffon Date: Sat, 15 Feb 2020 09:29:46 -0500 Message-ID: Subject: Re: [RFC PATCH] userfaultfd: Address race after fault. To: Andrea Arcangeli Cc: Andrew Morton , linux-mm , LKML , Mike Rapoport , Sonny Rao , "Kirill A . Shutemov" , Peter Xu Content-Type: text/plain; charset="UTF-8" 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: 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, 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 >