[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: >> (2) The major problem is the __put_page_type() never handle the >> special case for shared pages. >> >> If the (1) is changed as I said, the problem still exists as the following >> /* Before nominating domain 1, gfn 0x63 */ >> (XEN) Debug for domain=1, gfn=63, Debug page: MFN=4836c7 is >> ci=8000000000000002, ti=0, owner_id=1 >> /* After a failed nominate [desired: ci=8000000000000002, ti=0]*/ >> (XEN) Debug for domain=1, gfn=63, Debug page: MFN=4836c7 is >> ci=8000000000000002, ti=8400000000000000, owner_id=1 > > Is this causing a real problem other than this printout? > > One of the reasons to use get_page_and_type/put_page_and_type was that > it gets rid of the code that requires pages to have PGT_none before > they're shared. > > As I have been trying to explain, when a page has typecount 0 its type > is only relevant for the TLB flushing logic. If there's still a place > in the page-sharing code that relies on (type == PGT_none && count == 0) > then AFAICS that's a bug. > Thanks for the clarification. As you said, the following is excerpted from the mm.c "* So, type_count is a count of the number of times a frame is being * referred to in its current incarnation. Therefore, a page can only * change its type when its type count is zero." After testing the code with your patch, it's ok for the mem_sharing. And as the argument says, when (type_count & PGT_count_mask) is zero, it's ok for changing the page type. (even when there is a old value in type_count & PGT_type_mask, e.g., ti=8400000000000000) Thanks, Jui-Hao _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |