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

[Xen-devel] RE: [PATCH] mem_sharing: fix race condition of nominate and unshare



Hi Tim:
 
      Seems not work. See log below.
      Since the patch is for xen_unstable, I need to merge the code manually, I will check my code carefully later.
 
blktap_sysfs_create: adding attributes for dev ffff880102523c00
(XEN) Bad type in alloc_page_type 8000000000000000 t=8000000000000001 c=8000000000000005
(XEN) Xen BUG at mm.c:2094
(XEN) ----[ Xen-4.0.0  x86_64  debug=n  Not tainted ]----
(XEN) CPU:    3
(XEN) RIP:    e008:[<ffff82c48015cd08>] __get_page_type+0x4d8/0x1410
(XEN) RFLAGS: 0000000000010286   CONTEXT: hypervisor
(XEN) rax: 0000000000000000   rbx: 0000000000000000   rcx: 0000000000000092
(XEN) rdx: 000000000000000a   rsi: 000000000000000a   rdi: ffff82c48021e8c4
(XEN) rbp: ffff82f603663e80   rsp: ffff83023ff27b08   r8:  0000000000000001
(XEN) r9:  0000000000000001   r10: 00000000ffffffed   r11: ffff82c4801318d0
(XEN) r12: 0000000000000000   r13: 0000000000000000   r14: 8000000000000001
(XEN) r15: ffff83023ff27bc8    cr0: 0000000080050033   cr4: 00000000000026f0
(XEN) cr3: 0000000336800000   cr2: ffff88010545d008
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: e010   cs: e008
(XEN) Xen stack trace from rsp=ffff83023ff27b08:
(XEN)    0000000000000000 00000000000000ec 000000110000000e ffff83023ff27c1c
(XEN)    0000000100000002 ffff83023ff27be8 0000000800000001 0000000000000001
(XEN)    00000000001b31f4 8000000000000000 0000008700000100 0000000000000086
(XEN)    00972cd100000000 ffff82c480376980 0000000000000000 ffff880002b63dc8
(XEN)    0000000000000000 4c00000000000002 000000000000ffff 80000003276b0127
(XEN)    0000000000000000 ffff88002c11a258 0000000000000000 ffff8801060b00a8
(XEN)    0000000000000000 0000000000000000 0000000000000009 ffff82f603663e80
(XEN) &n bsp;  ffff8301bd350000 ffff8301bd350014 0000000000000003 ffff82f603663e80
(XEN)    00000000000099f4 ffff82c48015dc5b ffff82f603663e80 ffff82c48015e98e
(XEN)    ffff8301bd350000 00000000001b31f4 ffff8301bd350000 ffff83023ff27cc0
(XEN)    0000000000000003 ffff82c4801c02aa 0000000000000000 0000000000000092
(XEN)    00000000bf568000 0000000000000096 000000013ff27f28 ffff83023ff27e38
(XEN)    ffff8301bd350000 ffff83023ff27e28 0000000000305000 0000000000000006
(XEN)    0000000000000006 ffff82c4801c06a3 0000000000000000 0000000000000000
(XEN)    00000000000099f4 00000000006ee000 00000000006ee000 ffff82c4801457fd
(XEN)    ffff82c4801447da 0000000000000080 ffff83023ff27f28 ffff82c48015a1d8
(XEN)    0000000000000000 00000000000000fc 0000000000000000 0000000000000001
(XEN)    ffff83023ff27e28 ffff82c48015 a1d8 0000000000000000 ffff82f6066d0000
(XEN)    0000000000000000 0000000000000000 00000000003369d0 0000000000000000
(XEN)    0000000000000000 ffff82f6066d3a00 0000000000000000 0000000000000000
(XEN) Xen call trace:
(XEN)    [<ffff82c48015cd08>] __get_page_type+0x4d8/0x1410
(XEN)    [<ffff82c48015dc5b>] get_page_type+0xb/0x20
(XEN)    [<ffff82c48015e98e>] page_make_sharable+0x4e/0x1a0
(XEN)    [<ffff82c4801c02aa>] mem_sharing_nominate_page+0x18a/0x380
(XEN)    [<ffff82c4801c06a3>] mem_sharing_domctl+0x73/0x130
(XEN)    [<ffff82c4801457fd>] arch_do_domctl+0xdad/0x1f90
(XEN)    [<ffff82c4801447da>] __find_next_bit+0x6a/0x70
(XEN)    [<ffff82c48015a1d8>] get_page+0x28/0xf0
(XEN)    [<ffff82c48015a1d8>] get_page+0x28/0xf0
(XEN)     [<ffff82c48015dc5b>] get_page_type+0xb/0x20
(XEN)    [<ffff82c48015e1c3>] get_page_and_type_from_pagenr+0x93/0xf0
(XEN)    [<ffff82c480104373>] do_domctl+0x163/0x1000
(XEN)    [<ffff82c480162134>] do_mmuext_op+0xf34/0x1320
(XEN)    [<ffff82c48014717d>] vcpu_kick+0x1d/0x80
(XEN)    [<ffff82c4801e3169>] syscall_enter+0xa9/0xae
(XEN)   
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 3:
(XEN) Xen BUG at mm.c:2094
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

 
> Date: Wed, 12 Jan 2011 10:54:05 +0000
> From: Tim.Deegan@xxxxxxxxxx
> To: juihaochiang@xxxxxxxxx
> CC: tinnycloud@xxxxxxxxxxx; xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH] mem_sharing: fix race condition of nominate and unshare
>
> Hi,
>
> At 10:03 +0000 on 12 Jan (1294826637), Jui-Hao Chiang wrote:
> > After a discussion with tinnycloud, his test is working after applying
> > the previous patch
> > http://lists.xensource.com/archives/html/xen-devel/2010-12/txteWc7Bs5Yap.txt
> > (set_shared_p2m_entry is not executed since it is in ASSERT).
>
> Great!
>
> > And after a few code tracing and testing, my own worry about the
> > deadlock between p2m_lock and shr_lock actually disappears as the
> > above discussion. So here I re-attach the patch again which includes
> > another fix to recover type count when nominate fails on a page (from
> > our previous dicussions).
>
> The locking parts of this patch are already applied to the staging tree,
> thanks.
>
> The "recover type count" I still think is wrong. The page-sharing code
> can't rely on the type of a page with typecount 0. Also in this patch
> you're changing the code of the core __put_page_type() function, rather
> than the page-sharing code.
>
> Can you try the attached patch instead? If it fixes your problem I'll
> apply it.
>
> Cheers,
>
> Tim.
>
> --
> Tim Deegan <Tim.Deegan@xxxxxxxxxx>
> Principal Software Engineer, Xen Platform Team
> Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

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