Skip to contentSkip to conversation

PAGE_RW Should be added to PAGE_COPY ?

RFC Yingchao Zhou 1 participant 1 message Sep 14, 2006

lore
Share & tools
lore
#0 lore raw

I think it's OK to lock the page for the NIC driver. But I think it is an OS flaw to clear the _PAGE_RW bit for ptes in the mprotected space. If the _PAGE_RW is set, it should not get to do_wp_page.

Best regards

Quoted 28 lines

Your analysis is correct. But locking a page to avoid swap has different meaning with page locked (TestSetPageLocked()). Looks you missed this.

Thanks,
Shaohua
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Yingchao Zhou
Sent: Wednesday, September 13, 2006 10:03 PM
To: linux-kernel
Cc: akpm; alan; zxc
Subject: [RFC] PAGE_RW Should be added to PAGE_COPY ?

The current kernel set PAGE_COPY without write bit. This will cause
intermittent non-cosistent data for user-level network drivers such as Infiniband, Quadrics and Myrinet. Which has also be mentioned by Costin Iancu in the paper "HUNTing the Overlap " (PACT'05).
An example of such phenomena is the following sequences:

	register a memory space BUFF for receive message, 
	receive message,
	call mprotect(...PROT_NONE...) and

mprotect(...PROT_READ|PROT_WRITE) one by one,
write into BUFF,
then receive again.
The second time received data will perhaps not be the data sent by
the peer machine but the data written by itself in the 4th step.

Quoted 4 lines

The reson is that :
1) User-level network driver locks phy pages when memory space is
registered;
........

___________________________________________________

_      Yingchao Zhou                              _
_      ICT, CAS                                   _
_      (86)010-62601009                           _

___________________________________________________