Skip to contentSkip to conversation

linux/blktap2: eliminate bogus clearing of PG_reserved

PATCH New Jan Beulich 1 participant 1 message Aug 10, 2010 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/blktap2: eliminate bogus clearing of PG_reserved

While making sure PG_reserved is set for pages allocated from the balloon driver (and to be used for I/O) is a necessary thing to do (as 2.6.18's as well as pv-ops' balloon drivers don't guarantee this for the pages returned from alloc_empty_pages_and_page_vec()), clearing this flag again when a page is no longer in use for I/O is bogus at best (after all, the page at that point is not associated with any MFN anymore), and causes problems when the balloon driver properly marks all such pages as reserved and checks, upon their return, that they are still marked this way.

Cc Jake Wires <[email protected]>
Cc Dutch Meyer <[email protected]>
Cc Jeremy Fitzhardinge <[email protected]>
drivers/xen/blktap2/device.c +0 -1
@@ -281,7 +281,6 @@ blktap_device_fast_flush(struct blktap *
 
 		page = map[offset];
 		if (page) {
-			ClearPageReserved(map[offset]);
 			if (PageBlkback(page)) {
 				ClearPageBlkback(page);
 				set_page_private(page, 0);
drivers/xen/blktap2/ring.c +3 -6
@@ -112,12 +112,9 @@ blktap_ring_clear_pte(struct vm_area_str
 
 	offset  = (int)((uvaddr - vma->vm_start) >> PAGE_SHIFT);
 	page    = map[offset];
-	if (page) {
-		ClearPageReserved(page);
-		if (PageBlkback(page)) {
-			ClearPageBlkback(page);
-			set_page_private(page, 0);
-		}
+	if (page && PageBlkback(page)) {
+		ClearPageBlkback(page);
+		set_page_private(page, 0);
 	}
 	map[offset] = NULL;
 

Subject: blktap2: eliminate bogus clearing of PG_reserved

While making sure PG_reserved is set for pages allocated from the balloon driver (and to be used for I/O) is a necessary thing to do (as 2.6.18's as well as pv-ops' balloon drivers don't guarantee this for the pages returned from alloc_empty_pages_and_page_vec()), clearing this flag again when a page is no longer in use for I/O is bogus at best (after all, the page at that point is not associated with any MFN anymore), and causes problems when the balloon driver properly marks all such pages as reserved and checks, upon their return, that they are still marked this way.

Cc Jake Wires <[email protected]>
Cc Dutch Meyer <[email protected]>
Cc Jeremy Fitzhardinge <[email protected]>
drivers/xen/blktap2/device.c +0 -1
@@ -281,7 +281,6 @@ blktap_device_fast_flush(struct blktap *
 
 		page = map[offset];
 		if (page) {
-			ClearPageReserved(map[offset]);
 			if (PageBlkback(page)) {
 				ClearPageBlkback(page);
 				set_page_private(page, 0);
drivers/xen/blktap2/ring.c +3 -6
@@ -112,12 +112,9 @@ blktap_ring_clear_pte(struct vm_area_str
 
 	offset  = (int)((uvaddr - vma->vm_start) >> PAGE_SHIFT);
 	page    = map[offset];
-	if (page) {
-		ClearPageReserved(page);
-		if (PageBlkback(page)) {
-			ClearPageBlkback(page);
-			set_page_private(page, 0);
-		}
+	if (page && PageBlkback(page)) {
+		ClearPageBlkback(page);
+		set_page_private(page, 0);
 	}
 	map[offset] = NULL;
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel