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

Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration



 


From: dunlapg@xxxxxxxxx [mailto:dunlapg@xxxxxxxxx] On Behalf Of George Dunlap
Sent: Wednesday, November 21, 2012 1:48 AM
To: Liu, Jinsong
Cc: Ian Campbell; Ian Jackson; Jan Beulich; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH V3] X86/vMCE: handle broken page with regard to migration

On Sat, Nov 17, 2012 at 2:04 AM, Liu Jinsong <jinsong.liu@xxxxxxxxx> wrote:
+            /*
+             * if vMCE occur at last iter, do one more iter so that it get
+             * chance to transfer broken page's pfn_type and pfn number to
+             * target and then take appropriate action
+             */
+            if ( last_iter )
+            {
+                for ( j = 0; j < batch; j++ )
+                {
+                    if ( hvm )
+                        pfn_type[j] = pfn_batch[j];
+                    else
+                        pfn_type[j] = pfn_to_mfn(pfn_batch[j]);
+                }
+
+                if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) )
+                {
+                    PERROR("get_pfn_type_batch failed");
+                    goto out;
+                }
+
+                broken_page_num2 = 0;
+                for ( j = 0; j < batch; j++ )
+                    if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                        broken_page_num2++;
+
+                if ( broken_page_num1 < broken_page_num2 )
+                    last_iter = 0;
+            }

I guess I still don't see the point of this loop.  The pages this loop will catch are pages in this scenario:
- Page A marked dirty
- Last iteration begins; vm paused
- Page A sent
- Page A marked broken
- Last iteration ends 
 
[Jinsong]
 
No, at last lter, there are 4 points:
1. start last iter
2. get and transfer pfn_type to target
3. copy page to target
4. end last iter
 
this code monitor whether it has a vmce occur at area from point 2 to point 4 (we don't care vmce occur at last iter but before point2) 

But in this case, it doesn't really matter that page A is clean on the receiving side; it's already got a clean working copy with the latest data, right?

 
         } /* end of this while loop for this iteration */

       skip:
@@ -1550,23 +1592,22 @@
                     PERROR("Error when writing to state file (tsc)");
                     goto out;
                 }
+            }
+        }
+        else
+            last_iter = 1;

+        if ( xc_shadow_control(xch, dom,
+                               XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
+                               dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
+        {
+            PERROR("Error flushing shadow PT");
+            goto out;
+        }

-            }
+        sent_last_iter = sent_this_iter;

-            if ( xc_shadow_control(xch, dom,
-                                   XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send),
-                                   dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size )
-            {
-                PERROR("Error flushing shadow PT");
-                goto out;
-            }
-
-            sent_last_iter = sent_this_iter;
-
-            print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);
-
-        }
+        print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1);

And what's all this stuff about?  Why force a second sweep when we're saving to disk?

 [Jinsong] if not, saving to disk will do endless loop, since it has no chance to set last_iter=1.
 
 
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.