direct-io.hg
changeset 2550:91847d36b1db
bitkeeper revision 1.1159.83.10 (41544e88xdk28a2dPYKcImhs23irug)
Only free_page_type() on a page that is not yet invalid.
Only free_page_type() on a page that is not yet invalid.
author | kaf24@freefall.cl.cam.ac.uk |
---|---|
date | Fri Sep 24 16:42:48 2004 +0000 (2004-09-24) |
parents | 5d8883c5a53a |
children | 14dd430a2130 |
files | xen/arch/x86/memory.c |
line diff
1.1 --- a/xen/arch/x86/memory.c Fri Sep 24 14:24:33 2004 +0000 1.2 +++ b/xen/arch/x86/memory.c Fri Sep 24 16:42:48 2004 +0000 1.3 @@ -820,14 +820,23 @@ void put_page_type(struct pfn_info *page 1.4 nx = x - 1; 1.5 1.6 ASSERT((x & PGT_count_mask) != 0); 1.7 - ASSERT(x & PGT_validated); 1.8 + 1.9 + /* 1.10 + * The page should always be validated while a reference is held. The 1.11 + * exception is during domain destruction, when we forcibly invalidate 1.12 + * page-table pages if we detect a referential loop. 1.13 + * See domain.c:relinquish_list(). 1.14 + */ 1.15 + ASSERT((x & PGT_validated) || 1.16 + test_bit(DF_DYING, &page->u.inuse.domain->flags)); 1.17 1.18 if ( unlikely((nx & PGT_count_mask) == 0) ) 1.19 { 1.20 /* Record TLB information for flush later. Races are harmless. */ 1.21 page->tlbflush_timestamp = tlbflush_clock; 1.22 1.23 - if ( unlikely((nx & PGT_type_mask) <= PGT_l4_page_table) ) 1.24 + if ( unlikely((nx & PGT_type_mask) <= PGT_l4_page_table) && 1.25 + likely(nx & PGT_validated) ) 1.26 { 1.27 /* 1.28 * Page-table pages must be unvalidated when count is zero. The