From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] linux/blktap2: eliminate bogus clearing of PG_reserved Date: Tue, 10 Aug 2010 15:04:43 +0100 Message-ID: <4C61789B020000780000F0FF@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part725F526B.3__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: dmeyer@cs.ubc.ca, Jeremy Fitzhardinge , jake.wires@citrix.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part725F526B.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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. Signed-off-by: Jan Beulich Cc: Jake Wires Cc: Dutch Meyer Cc: Jeremy Fitzhardinge --- a/drivers/xen/blktap2/device.c +++ b/drivers/xen/blktap2/device.c @@ -281,7 +281,6 @@ blktap_device_fast_flush(struct blktap * =20 page =3D map[offset]; if (page) { - ClearPageReserved(map[offset]); if (PageBlkback(page)) { ClearPageBlkback(page); set_page_private(page, 0); --- a/drivers/xen/blktap2/ring.c +++ b/drivers/xen/blktap2/ring.c @@ -112,12 +112,9 @@ blktap_ring_clear_pte(struct vm_area_str =20 offset =3D (int)((uvaddr - vma->vm_start) >> PAGE_SHIFT); page =3D 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] =3D NULL; =20 --=__Part725F526B.3__= Content-Type: text/plain; name="xenlinux-blktap2-ClearPageReserved.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xenlinux-blktap2-ClearPageReserved.patch" Subject: blktap2: eliminate bogus clearing of PG_reserved=0A=0AWhile = making sure PG_reserved is set for pages allocated from the=0Aballoon = driver (and to be used for I/O) is a necessary thing to do=0A(as 2.6.18's = as well as pv-ops' balloon drivers don't guarantee this=0Afor the pages = returned from alloc_empty_pages_and_page_vec()),=0Aclearing this flag = again when a page is no longer in use for I/O is=0Abogus at best (after = all, the page at that point is not associated=0Awith any MFN anymore), and = causes problems when the balloon driver=0Aproperly marks all such pages as = reserved and checks, upon their=0Areturn, that they are still marked this = way.=0A=0ASigned-off-by: Jan Beulich =0ACc: Jake = Wires =0ACc: Dutch Meyer =0ACc: = Jeremy Fitzhardinge =0A=0A--- a/drivers/xen/blktap2/device= .c=0A+++ b/drivers/xen/blktap2/device.c=0A@@ -281,7 +281,6 @@ blktap_device= _fast_flush(struct blktap *=0A =0A page =3D map[offset];=0A = if (page) {=0A- ClearPageReserved(map[offset]);=0A = if (PageBlkback(page)) {=0A = ClearPageBlkback(page);=0A set_page_private(pa= ge, 0);=0A--- a/drivers/xen/blktap2/ring.c=0A+++ b/drivers/xen/blktap2/ring= .c=0A@@ -112,12 +112,9 @@ blktap_ring_clear_pte(struct vm_area_str=0A =0A = offset =3D (int)((uvaddr - vma->vm_start) >> PAGE_SHIFT);=0A page = =3D map[offset];=0A- if (page) {=0A- ClearPageReserved(page);=0A= - if (PageBlkback(page)) {=0A- ClearPageBl= kback(page);=0A- set_page_private(page, 0);=0A- = }=0A+ if (page && PageBlkback(page)) {=0A+ ClearPageBlkback(pa= ge);=0A+ set_page_private(page, 0);=0A }=0A map[offset]= =3D NULL;=0A =0A --=__Part725F526B.3__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part725F526B.3__=--