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,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 2E7D5C433F5 for ; Fri, 3 Sep 2021 07:58:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6B5761057 for ; Fri, 3 Sep 2021 07:58:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B6B5761057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:33258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM46C-0005oT-NL for qemu-devel@archiver.kernel.org; Fri, 03 Sep 2021 03:58:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM45V-0004wR-Vm for qemu-devel@nongnu.org; Fri, 03 Sep 2021 03:58:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM45T-0000EO-Nj for qemu-devel@nongnu.org; Fri, 03 Sep 2021 03:58:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630655890; 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=G41YEcJGzdfzZitf4SCJrIXcvnZtTPPvU7E60sYtFy4=; b=ba6yKRhTQwySrZD7SO1CZKWcQSHYV/8tf6wpSE7iAX6PIXbPHKS6KJI15A1O0mahuRuXV7 QuzM2rrvghCWaLdPkXddqAplrd3SjPrYrYiAJqWJVg4I12KZh+FVTi5U4ZnMh7f4Fe28+q h1QiAHo7zwPKetHYjHR8vfVMJrqaF6o= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-570-w-FF0TvwMv6IqCtuVQ-fJw-1; Fri, 03 Sep 2021 03:58:09 -0400 X-MC-Unique: w-FF0TvwMv6IqCtuVQ-fJw-1 Received: by mail-wr1-f70.google.com with SMTP id p10-20020a5d68ca000000b001552bf8b9daso1295223wrw.22 for ; Fri, 03 Sep 2021 00:58:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=G41YEcJGzdfzZitf4SCJrIXcvnZtTPPvU7E60sYtFy4=; b=SazATD8xSM5KfNfP92yB84Ei+4AM8Z9mY30yAyd5ge+XgEH48UZiNWuEFrKDyW3utm 4LaJj7R8UXNsntOBk2mRgsqFf7N7qLSGVtODbS5slLBx3tobXM/LrpDULwL9a4dnVN+h EN3emq+9Y/VmOK6U9IkI5chGRD1UAq4lTDvp4NP3apoBPjdhb5WFWUFeyJX0PhapPTpH UBHOUiRZDQOp2dCF5gBWc+GuB75aHb94dUVWZ4ekYmRzcVI4a0JZNerWwuFy6qyuhVHO bCz85JCpmklqDTpShuX9fn8zrMMRfOCc0vJwdc3Ts7HdHeoQB43RhpQuLavkpLnAATzC KY/Q== X-Gm-Message-State: AOAM530NpbuYNbDzLaB2sj1WfJPdT3WgfYJo/bNMRrINYFqo51Ij7k07 fP1iMvxPLtm6ERerwYK2Fu0/SnYW30BEYnVeH8eDjV7UB5r3AKkdl0Kqq4zsW2sv4/VidWwQxyk o5d+T++EQ/D7ibww= X-Received: by 2002:adf:d1a4:: with SMTP id w4mr2430161wrc.233.1630655888509; Fri, 03 Sep 2021 00:58:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLWBemqqoItwvj2q7X52QGiMzjQWnsI2obSDpOjRXnYKTtIKqTFGqndtUHJiNi73dTKNodMA== X-Received: by 2002:adf:d1a4:: with SMTP id w4mr2430127wrc.233.1630655888275; Fri, 03 Sep 2021 00:58:08 -0700 (PDT) Received: from [192.168.3.132] (p4ff23e05.dip0.t-ipconnect.de. [79.242.62.5]) by smtp.gmail.com with ESMTPSA id q11sm3598274wmc.41.2021.09.03.00.58.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Sep 2021 00:58:07 -0700 (PDT) From: David Hildenbrand To: Peter Xu References: <20210902131432.23103-1-david@redhat.com> <20210902131432.23103-9-david@redhat.com> Organization: Red Hat Subject: Re: [PATCH v4 8/9] migration/ram: Factor out populating pages readable in ram_block_populate_pages() Message-ID: <4ed5a784-986b-67a7-f8e6-0245ef10c301@redhat.com> Date: Fri, 3 Sep 2021 09:58:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=david@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.225, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Juan Quintela , Pankaj Gupta , "Michael S. Tsirkin" , teawater , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , Alex Williamson , Marek Kedzierski , Paolo Bonzini , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Andrey Gruzdev , Wei Yang Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" >> That'll be good enough for live snapshot as uffd-wp works for zero pages, >> however I'm just afraid it may stop working for some new users of it when zero >> pages won't suffice. > > I thought about that as well. But snapshots/migration will read all > memory either way and consume real memory when there is no shared zero > page. So it's just shifting the point in time when we allocate all these > pages I guess. ... thinking again, even when populating on shmem and friends there is nothing stopping pages from getting mapped out again. What would happen when trying uffd-wp protection on a pte_none() in your current shmem implementation? Will it lookup if there is something in the page cache (not a hole) and set a PTE marker? Or will it simply skip as there is currently nothing in the page table? Or will it simply unconditionally install a PTE marker, even if there is a hole? Having an uffd-wp mode that doesn't require pre-population would really be great. I remember you shared prototypes. -- Thanks, David / dhildenb