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.2 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 5F2CDC4338F for ; Thu, 29 Jul 2021 19:40:09 +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 BED5A60BD3 for ; Thu, 29 Jul 2021 19:40:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BED5A60BD3 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]:52466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9Bt1-0007wI-W1 for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 15:40:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9BsQ-0007DI-UF for qemu-devel@nongnu.org; Thu, 29 Jul 2021 15:39:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9BsP-0002PW-9n for qemu-devel@nongnu.org; Thu, 29 Jul 2021 15:39:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627587568; 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=2jtO1wqRaLHmgv4Kj3W3dnomylb+occ2lWcbt0UBxas=; b=bHFBrTdAber3Gk5NDOOIJqBBHzhQMoHJ6hY9KHLXHVVB1pse+/lY665ogHeJlC49e6bk5N I0poJkoE+4jgNt4iFQRBQaXY0hTluK8jeGNYwA+CS3smxVxbdXpnSU3H7RLoXEoQCFDAyB XPBL8LdPlOplYivGv9oddpV8zDTVyMI= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-y00Q1nwaPje9jP0_hFrhQg-1; Thu, 29 Jul 2021 15:39:27 -0400 X-MC-Unique: y00Q1nwaPje9jP0_hFrhQg-1 Received: by mail-wm1-f71.google.com with SMTP id w25-20020a1cf6190000b0290252505ddd56so1085259wmc.3 for ; Thu, 29 Jul 2021 12:39:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=2jtO1wqRaLHmgv4Kj3W3dnomylb+occ2lWcbt0UBxas=; b=ic8YvRa79YMRp9R9sBjnY3Byq6NJkfw71Lo4aoqkTM9zb/Jc6ENX0wqrW4dna6rurE hHWlIWupUrkYhCrOmpdEIA46z+U41u/j0OX6Km9v8w/kNhLU50n6y/noZKGB/MTXOuGE SzZ08sNFC5n0Vq9Fh2fG9gGSY7OAwS3OwhgiaOP9+vgYYGV989PhJ5vCqqJvAdlfChXB WGbJzF/ST9eJ6YmTUc1gDUU/18v52mtzvVwVgICQjWSTZsxeySqkPXMhmWE2o1ClAIYf 60ov4Ci3r65g6ifONEPFdGeeIxVHOyervpdVT5zRJZ4tBr3RccCI3f2SDyiLREUkqdQ6 seVA== X-Gm-Message-State: AOAM533UNpdbAWhUFLR7xXM0+d0/nvvRRxDUg2x0OXMT4nznj92TMk1k 8UHOQrOlge2BGudYrFU9ULCkBUvIUHe2jeL8SMsmJXWa9wespFCjSQ/AuOswY8qF1SVLTJXDBm0 E6cMM24XtCqzec4k= X-Received: by 2002:a7b:c30f:: with SMTP id k15mr64653wmj.128.1627587565931; Thu, 29 Jul 2021 12:39:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRsLJUZkMisxc6zLjoiqIZcAMYidNoGcN/MaBkflrZFBw+A2IdQ+zEz9actWd0KZ71OCqJIg== X-Received: by 2002:a7b:c30f:: with SMTP id k15mr64635wmj.128.1627587565744; Thu, 29 Jul 2021 12:39:25 -0700 (PDT) Received: from ?IPv6:2003:d8:2f0a:7f00:fad7:3bc9:69d:31f? (p200300d82f0a7f00fad73bc9069d031f.dip0.t-ipconnect.de. [2003:d8:2f0a:7f00:fad7:3bc9:69d:31f]) by smtp.gmail.com with ESMTPSA id y19sm9957609wma.21.2021.07.29.12.39.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jul 2021 12:39:25 -0700 (PDT) To: Peter Xu , "Dr. David Alan Gilbert" , Juan Quintela References: <74271964-c481-7168-2a70-ea9eb5067450@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v2 0/6] migration/ram: Optimize for virtio-mem via RamDiscardManager Message-ID: Date: Thu, 29 Jul 2021 21:39:24 +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=216.205.24.124; envelope-from=david@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.717, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.125, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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 , "Michael S. Tsirkin" , Pankaj Gupta , qemu-devel@nongnu.org, Andrey Gruzdev , Alex Williamson , teawater , Paolo Bonzini , Marek Kedzierski , Wei Yang Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" >> In the meantime I adjusted the code but it does the clearing under the >> iothread lock, which should not be what we want ... I'll have a look. > > Thanks; if it takes more changes than expected we can still start from simple, > IMHO, by taking bql and timely yield it. > > At the meantime, I found two things in ram_init_bitmaps() that I'm not sure we > need them of not: > > 1. Do we need WITH_RCU_READ_LOCK_GUARD() if with both bql and ramlist lock? > (small question) Good question, I'm not sure if we need it. > > 2. Do we need migration_bitmap_sync_precopy() even if dirty bmap is all 1's? > (bigger question) IIRC, the bitmap sync will fetch the proper dirty bitmap from KVM and set the proper bits in the clear_bitmap. So once we call migration_clear_memory_region_dirty_bitmap_range() etc. later we will actually clear dirty bits. Without that, migration_clear_memory_region_dirty_bitmap_range() is a nop and we might migrate stuff unnecessarily twice as dirty bits are not cleared: I certainly need that, otherwise the migration_clear_memory_region_dirty_bitmap_range() is a nop and it all won't work as you proposed. -- Thanks, David / dhildenb