mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.911.1.2 (40abd812eI8191scOuEXdi7E2VKxGQ)
When flushing network buffers, don't put the pages back in the psuedo-physical map, so we don't have to send junk pages. Add shadow_control_op_peek
This commit is contained in:
1 parent
ba0805e639
commit
77fc412d7a
5 files changed
+55
-5
No files matched your search
@@ -136,11 +136,13 @@ elif cmd == 'suspend':
|
||||
pid = int(fd.readline())
|
||||
os.kill(pid, signal.SIGTERM)
|
||||
|
||||
"""
|
||||
xc.domain_stop( dom=dom )
|
||||
|
||||
XXX
|
||||
while not xc.domain_getinfo( first_dom=dom, max_doms=1 )[0]['stopped']:
|
||||
print "Sleep..."
|
||||
time.sleep(0.001);
|
||||
"""
|
||||
|
||||
rc = xc.linux_save( dom=dom, state_file=file, progress=1)
|
||||
if rc == 0 : xc.domain_destroy( dom=dom, force=1 )
|
||||
|
||||
@@ -140,8 +140,9 @@ int xc_linux_save(int xc_handle,
|
||||
/* bitmap of pages left to send */
|
||||
unsigned long *to_send, *to_fix;
|
||||
|
||||
//live=0;
|
||||
|
||||
int needed_to_fix = 0;
|
||||
int total_sent = 0;
|
||||
|
||||
if ( mlock(&ctxt, sizeof(ctxt) ) )
|
||||
{
|
||||
PERROR("Unable to mlock ctxt");
|
||||
@@ -422,6 +423,7 @@ int xc_linux_save(int xc_handle,
|
||||
|
||||
if ( last_iter && test_bit(n, to_fix ) && !test_bit(n, to_send ))
|
||||
{
|
||||
needed_to_fix++;
|
||||
DPRINTF("Fix! iter %d, pfn %lx. mfn %lx\n",
|
||||
iter,n,pfn_type[batch]);
|
||||
}
|
||||
@@ -567,9 +569,18 @@ int xc_linux_save(int xc_handle,
|
||||
munmap(region_base, batch*PAGE_SIZE);
|
||||
|
||||
skip:
|
||||
|
||||
|
||||
total_sent += sent_this_iter;
|
||||
|
||||
verbose_printf("\b\b\b\b100%% (%d pages)\n", sent_this_iter );
|
||||
|
||||
if ( last_iter )
|
||||
{
|
||||
verbose_printf("Total pages sent= %d (%.2fx)\n",
|
||||
total_sent, ((float)total_sent)/nr_pfns );
|
||||
verbose_printf("(of which %d were fixups)\n", needed_to_fix );
|
||||
}
|
||||
|
||||
if ( debug && last_iter )
|
||||
{
|
||||
int minusone = -1;
|
||||
|
||||
+33
-1
@@ -350,6 +350,38 @@ static int shadow_mode_table_op( struct task_struct *p,
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DOM0_SHADOW_CONTROL_OP_PEEK:
|
||||
{
|
||||
int i;
|
||||
|
||||
if( p->tot_pages > sc->pages ||
|
||||
!sc->dirty_bitmap || !p->mm.shadow_dirty_bitmap )
|
||||
{
|
||||
rc = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
sc->pages = p->tot_pages;
|
||||
|
||||
#define chunk (8*1024) // do this in 1KB chunks for L1 cache
|
||||
|
||||
for(i=0;i<p->tot_pages;i+=chunk)
|
||||
{
|
||||
int bytes = (( ((p->tot_pages-i) > (chunk))?
|
||||
(chunk):(p->tot_pages-i) ) + 7) / 8;
|
||||
|
||||
copy_to_user( sc->dirty_bitmap + (i/(8*sizeof(unsigned long))),
|
||||
p->mm.shadow_dirty_bitmap +(i/(8*sizeof(unsigned long))),
|
||||
bytes );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
BUG();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -386,7 +418,7 @@ int shadow_mode_control( struct task_struct *p, dom0_shadow_control_t *sc )
|
||||
if(p->mm.shadow_mode) shadow_mode_disable(p);
|
||||
shadow_mode_enable(p, SHM_logdirty);
|
||||
}
|
||||
else if ( p->mm.shadow_mode && cmd >= DOM0_SHADOW_CONTROL_OP_FLUSH && cmd<=DOM0_SHADOW_CONTROL_OP_CLEAN )
|
||||
else if ( p->mm.shadow_mode && cmd >= DOM0_SHADOW_CONTROL_OP_FLUSH && cmd<=DOM0_SHADOW_CONTROL_OP_PEEK )
|
||||
{
|
||||
rc = shadow_mode_table_op(p, sc);
|
||||
}
|
||||
|
||||
@@ -238,6 +238,7 @@ typedef struct dom0_sched_id_st
|
||||
#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2
|
||||
#define DOM0_SHADOW_CONTROL_OP_FLUSH 10
|
||||
#define DOM0_SHADOW_CONTROL_OP_CLEAN 11
|
||||
#define DOM0_SHADOW_CONTROL_OP_PEEK 12
|
||||
typedef struct dom0_shadow_control_st
|
||||
{
|
||||
/* IN variables. */
|
||||
|
||||
@@ -381,6 +381,10 @@ xc_linux_save */
|
||||
/* With live migrate, we even get these... Disable for now. */
|
||||
// printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status);
|
||||
}
|
||||
else
|
||||
phys_to_machine_mapping[virt_to_phys(skb->head) >> PAGE_SHIFT] =
|
||||
0x80000004; // disown this page -- it was a flush
|
||||
|
||||
dev_kfree_skb_any(skb);
|
||||
continue;
|
||||
}
|
||||
|
||||