qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 1/4] migration: introduce 'background-snapshot' migration


From: Andrey Gruzdev
Subject: Re: [PATCH v5 1/4] migration: introduce 'background-snapshot' migration capability
Date: Wed, 9 Dec 2020 10:08:03 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 08.12.2020 18:47, Peter Xu wrote:
On Fri, Dec 04, 2020 at 12:31:00PM +0300, Andrey Gruzdev wrote:
+static
+WriteTrackingSupport migrate_query_write_tracking(void)
+{
+    static WriteTrackingSupport wt_support = WT_SUPPORT_UNKNOWN;
Better to be non-static - consider uncompatible memory can be hot plugged after
it's once set.

With static removed (I think most of below if clauses can be unwrapped too, but
your call), feel free to add:

Reviewed-by: Peter Xu <peterx@redhat.com>

Thanks,
Yes, quite possible case with memory hot plug that you mentioned..
Thanks, I'll change it to non-static.

      
+
+    /* Check UFFD-IO and memory backends for compatibility only once */
+    if (wt_support == WT_SUPPORT_UNKNOWN) {
+        wt_support = WT_SUPPORT_ABSENT;
+        /* Check if kernel supports required UFFD features */
+        if (ram_write_tracking_available()) {
+            wt_support = WT_SUPPORT_AVAILABLE;
+            /*
+             * Check if current memory configuration is
+             * compatible with required UFFD features.
+             */
+            if (ram_write_tracking_compatible()) {
+                wt_support = WT_SUPPORT_COMPATIBLE;
+            }
+        }
+    }
+
+    return wt_support;
+}
+#endif /* CONFIG_LINUX */

    



reply via email to

[Prev in Thread] Current Thread [Next in Thread]