Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6013540ybv; Tue, 18 Feb 2020 08:13:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxCqp7Xd0O2VwY+/r65IxskoORYCI3aIDkYI8wWJyIjWbbDgeD6BLRk52mRUwNzCG3+TxSv X-Received: by 2002:a54:4f14:: with SMTP id e20mr1665690oiy.84.1582042391355; Tue, 18 Feb 2020 08:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582042391; cv=none; d=google.com; s=arc-20160816; b=xgZFLCH3qktefhUGXc+NWXrTMSrP+Imo0AxodGYTokp7/D0qc7r5Ws6fa3dRD8tV2y V1grhdrjQkplUl5rzd9w7tr48AmoLqLhpkimnADEJGcmd+Duy/m5ZUW9jjp/BzDcJrmB LEV7LPdRvMhzKgw6Sy5zCJLvw7qRorKo/3PkrsFOvkt/LeiNAkJP3jJMSBieIEWnUa/m HMMHSaY2oPL1GSU1iOYQ56DpumEP2bWHJXaoQGBvYMU95Tvsj5dCVNvuiFfabyiOJib9 B4I0+9FcgtX0nBfbcoHEfePxUZeJ2ZmYPwztLBRzYmGb1Irnuj0w79hwB0hX1Pi3fKlF 6Nxg== 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=xtVxSnLQhBRQi9E46Vg+UFDvswVXyAHUtw4gNVo9AWU=; b=om6a5/o5OI6dzN1TujEWMQswuy7ZPj+bx1r4A9GD6Rb3FDXdlH19dK4kBb0RbroPMN IfxZPALatMcQFeT6/B9Y/IZ9tdSebP/1yXeNkz82XT7HqEV4tE1NrxvlMoTTS8rM2uLq jh59qT2CTYaeg5FLOWdDdEfwe0OhF0Sgq9PaH1Q6HZRMKrNxmoYabkTWtoOl3/2b1v/0 3qYeHMii3tnPkLi4KF9CEU5mjIZisNSmwI7AoHVL3sizv3wOt7LBMSpfb73NGD61Et2P 5uWPMUMYMt8LXPHfk4Z4pdKXkQiRQkZzIo7OWk8XyBMYOsHiLd6A7lWQ4gnl/GFhTxdz n62A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nbl5NQ2C; 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 e23si8166363oie.105.2020.02.18.08.12.59; Tue, 18 Feb 2020 08:13:11 -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=Nbl5NQ2C; 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 S1726610AbgBRQLY (ORCPT + 99 others); Tue, 18 Feb 2020 11:11:24 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24649 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726360AbgBRQLY (ORCPT ); Tue, 18 Feb 2020 11:11:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582042281; 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=xtVxSnLQhBRQi9E46Vg+UFDvswVXyAHUtw4gNVo9AWU=; b=Nbl5NQ2CQpfCnkM4+3mdtccT/XwWGnTSHT3M3yptzXkKAskC6LQpl8lXOgFEVNzXl/MU4h 7MloLqgg5cJ5t/zvetFLjeHbxAN+e252YF4rAochi5732lLihEOTRlekmQKoLplbhow3Xw IR4ZHSjJYYH897eoIzW0mWwZuwyT+V8= 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-434-5gykuEayP_-1ynYUJN7k6A-1; Tue, 18 Feb 2020 11:11:16 -0500 X-MC-Unique: 5gykuEayP_-1ynYUJN7k6A-1 Received: by mail-qv1-f71.google.com with SMTP id r9so12682688qvs.19 for ; Tue, 18 Feb 2020 08:11:16 -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=xtVxSnLQhBRQi9E46Vg+UFDvswVXyAHUtw4gNVo9AWU=; b=gzY6B+TcMom1sOngMWZbM0e9c/PSRo1jhokVPwiYLHbNm9gXpgPnVj4KQzZm9vZHtL h3l3oEdG2MIt5A7cpY1w3oN1zNFXZJck5coOJVWqNHL8Bj9C/LXvB8PhBSGGSJaA0vSd dvozfPC4qGgihnzMHzJ430+RBo4xRwLpEYYrz0m1+i9dTCROXHtEIgiRGwVzC76ANOPm Upat9bbCxe4qOXbr/41eLvXSbzltd6zwSp6wau2R2KM1Yw7uv9cO6nNfiPFvdjmI9gZc k3I7ad4W0KgX3mihK4peukqAVpb7VJK/1Jit5Rlcu1rw4OvLyBYJvziyPqvQfxg9ZT+x dOaQ== X-Gm-Message-State: APjAAAUO5OFW1Ay1EqrddV67gHl7CsS0uSio8YxETvNUXCGtvBec9l0B pCdyOU8pLa8VAu5VcOhAs1iBFUnFpS6JyRrNlQwYze5WgeUOBajJSN1eGVfLxknU1FJzxYSA7n+ HRPOR4U1M+OstRJF0t4fdnRPq X-Received: by 2002:ad4:4d85:: with SMTP id cv5mr16879803qvb.171.1582042276099; Tue, 18 Feb 2020 08:11:16 -0800 (PST) X-Received: by 2002:ad4:4d85:: with SMTP id cv5mr16879778qvb.171.1582042275771; Tue, 18 Feb 2020 08:11:15 -0800 (PST) Received: from xz-x1 ([104.156.64.74]) by smtp.gmail.com with ESMTPSA id 65sm2013694qtf.95.2020.02.18.08.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 08:11:14 -0800 (PST) Date: Tue, 18 Feb 2020 11:11:13 -0500 From: Peter Xu To: Bobby Powers Cc: linux-mm@kvack.org, Kernel development list , 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" Subject: Re: [PATCH v5 00/25] userfaultfd: write protection support Message-ID: <20200218161113.GA1408806@xz-x1> References: <20190620022008.19172-1-peterx@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 Mon, Feb 17, 2020 at 07:59:12PM -0800, Bobby Powers wrote: > On Wed, Jun 19, 2019 at 7:20 PM Peter Xu wrote: > > This series implements initial write protection support for > > userfaultfd. Currently both shmem and hugetlbfs are not supported > > yet, but only anonymous memory. This is the 4nd version of it. > > > > The latest code can also be found at: > > > > https://github.com/xzpeter/linux/tree/uffd-wp-merged > > Hi Peter - I ported the branch you had above on top of v5.4.20 (what I > happened to be running locally), and fixed one issue that was causing > crashes for me: > https://github.com/bpowers/linux/commit/61086b5a0fa4aeb494e86d999926551a4323b84f Hi, Bobby, Thanks for playing with the branch! Yes, this should be needed if you have 7d0325749a6c ("userfaultfd: untag user pointers", 2019-09-25) in your base branch where the address is replaced by its pointer. > I wrote a small test program here: > https://github.com/plasma-umass/Mesh/blob/master/src/test/userfaultfd-kernel-copy.cc Just FYI that there's some other tests/libraries over there [1,2]. Also the series has the uffd selftest for write-protection as well. > and write protection support for userfaultfd (with eventual shmem > support) would be _hugely_ helpful for a userspace memory allocator > I'm working on. Is there anything I can do to help get this > considered for mainline? We have some time before the 5.7 merge > window opens up. Tested-by: Bobby Powers Thanks for the tag! Yes it would be great if we can continue to work on those, but for now let's see whether we can move on what we have first (it's already two series without much certainty on whether it could get merged soon). Considering that we've got quite a few pings again for either the mm retry series and the write-protect work, I'll rebase the two series, test & post soon this week. I'll keep you in the loop. Thanks, [1] https://github.com/LLNL/umap [2] https://github.com/xzpeter/clibs/blob/master/gpl/userspace/uffd-test/uffd-test.c -- Peter Xu