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=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 109F6C433E0 for ; Thu, 21 Jan 2021 22:37:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8E66F23A61 for ; Thu, 21 Jan 2021 22:37:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E66F23A61 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 F3B8B6B0006; Thu, 21 Jan 2021 17:37:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EEB5F6B0007; Thu, 21 Jan 2021 17:37:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB4B26B0008; Thu, 21 Jan 2021 17:37:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id C0F136B0006 for ; Thu, 21 Jan 2021 17:37:10 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7ED3D181AF5D0 for ; Thu, 21 Jan 2021 22:37:10 +0000 (UTC) X-FDA: 77731244220.01.rifle66_5c04b0027566 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 57CCF100581D1 for ; Thu, 21 Jan 2021 22:37:10 +0000 (UTC) X-HE-Tag: rifle66_5c04b0027566 X-Filterd-Recvd-Size: 5672 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 22:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611268629; 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=9F4FJm6CxPIzCDPXLeRl1F1UfXVZJLDgPR0BedATtNQ=; b=geY+3kSb+DDRzIZK7zovLDPJNaNwQ1stqVsIBClv51cwLDjRIrBROCaP4JrvcWbvPAwHx2 7ZqwDXITdByl0xjwCVSI5xGrm8BsPKPGiBGFNloMIGoNjvDW816CJsLY10by6ZOK3vQrVe 5KCH19lIW58LUMHQjMR5nt8PYV8dlDQ= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-65-rrJGGya-NGmdD-FIvFaTKQ-1; Thu, 21 Jan 2021 17:37:07 -0500 X-MC-Unique: rrJGGya-NGmdD-FIvFaTKQ-1 Received: by mail-qt1-f199.google.com with SMTP id t7so2439163qtn.19 for ; Thu, 21 Jan 2021 14:37:07 -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=9F4FJm6CxPIzCDPXLeRl1F1UfXVZJLDgPR0BedATtNQ=; b=mpR/11IzYt1q5xa47nbaj/fP7mD/Oegs9oARgrSYaeno83YVfYTikqoCSSYn0eEd6o yuHkUr8WeiPqBB82/1CPDQtsiLCzGPQKd7M24b1PV+OgsDVwJB7NNI/DeHjn9BHmJ9w3 EnJP2ECZrcMZE9vv1hYOdbLCY5InReLpgCRNJt6x3otsuFFHJz/9pNAh+lRs7OG//SF6 fMVlv/Zdraz8oDjHg1wJ/lrNhzrKsocCMFhJrZ3bsvZz2+nGER6PKdFHkAdpmn4+e7m4 uVkbpjN7hNSxIZ8iIhB1xgm89VeRPCBZRyef6lljB6ncxC5Avw44ANB+HzTDH7On98OW 80Wg== X-Gm-Message-State: AOAM530g3OF4iSvgU6d1U4Fx6PXnMhSib04N1i74Pr0gT0EF2fTgeVOz QePwHXyvphCzcKRI2o+zXLWRwhQD/BCwCqDho3Ul9xuYfmCTGe6xuUNFnr0RM4eMVMEypOfD5Pb 5ZNKmOsSok3c= X-Received: by 2002:ac8:7a82:: with SMTP id x2mr1902808qtr.20.1611268626716; Thu, 21 Jan 2021 14:37:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF3+w++uI/FnvKRDlQcHOvwzcsjyp5Q8slh4ec0gAIH6IQXOf+SKAUhSC7Vg50ypEzJuOuDQ== X-Received: by 2002:ac8:7a82:: with SMTP id x2mr1902784qtr.20.1611268626438; Thu, 21 Jan 2021 14:37:06 -0800 (PST) Received: from xz-x1 ([142.126.83.202]) by smtp.gmail.com with ESMTPSA id 203sm4955384qkd.81.2021.01.21.14.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 14:37:05 -0800 (PST) Date: Thu, 21 Jan 2021 17:37:03 -0500 From: Peter Xu To: Axel Rasmussen Cc: Alexander Viro , Alexey Dobriyan , Andrea Arcangeli , Andrew Morton , Anshuman Khandual , Catalin Marinas , Chinwen Chang , Huang Ying , Ingo Molnar , Jann Horn , Jerome Glisse , Lokesh Gidra , "Matthew Wilcox (Oracle)" , Michael Ellerman , Michal =?utf-8?Q?Koutn=C3=BD?= , Michel Lespinasse , Mike Kravetz , Mike Rapoport , Nicholas Piggin , Shaohua Li , Shawn Anastasio , Steven Rostedt , Steven Price , Vlastimil Babka , LKML , linux-fsdevel@vger.kernel.org, Linux MM , Adam Ruprecht , Cannon Matthews , "Dr . David Alan Gilbert" , David Rientjes , Oliver Upton Subject: Re: [PATCH 0/9] userfaultfd: add minor fault handling Message-ID: <20210121223703.GH260413@xz-x1> References: <20210115190451.3135416-1-axelrasmussen@google.com> <20210121191241.GG260413@xz-x1> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 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 Thu, Jan 21, 2021 at 02:13:50PM -0800, Axel Rasmussen wrote: > When I wrote this, my thinking was that users of this feature would > have two mappings, one of which is not UFFD registered at all. So, to > replace the existing page contents, userspace would just write to the > non-UFFD mapping (with memcpy() or whatever else, or we could get > fancy and imagine using some RDMA technology to copy the page over the > network from the live migration source directly in place). After > performing the write, we just UFFDIO_CONTINUE. > > I believe FALLOC_FL_PUNCH_HOLE / MADV_REMOVE doesn't work with > hugetlbfs? Once shmem support is implemented, I would expect > FALLOC_FL_PUNCH_HOLE + UFFDIO_COPY to work, but I wonder if such an > operation would be more expensive than just copying using the other > side of the shared mapping? IIUC hugetlb supports that (hugetlbfs_punch_hole()). But I agree with you on what you said should be good enough. Thanks, -- Peter Xu