From: "Yingchao Zhou" <yc_zhou@ncic.ac.cn>
To: "linux-kernel" <linux-kernel@vger.kernel.org>
Cc: "akpm" <akpm@osdl.org>, "alan" <alan@redhat.com>, "zxc" <zxc@ncic.ac.cn>
Subject: [RFC] PAGE_RW Should be added to PAGE_COPY ?
Date: Wed, 13 Sep 2006 22:02:35 +0800 [thread overview]
Message-ID: <20060913140241.60C5FFB046@ncic.ac.cn> (raw)
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.
The reson is that :
1) User-level network driver locks phy pages when memory space is registered;
2) 2 calls to mprotect change ptes in the space to PAGE_COPY, so write any page in the space will cause a page fault;
3) In the page fault handler, it goes to do_wp_page, and in it if Page Is Locked, a new page is generated and filled into the pte. So the physical page seen by the host is not the same one by the NIC.
Adding PAGE_RW to PAGE_COPY will resolve this problem.
In my option, the reason for absense of RW is to save memory by mapping all those only read pages into ZERO_PAGE. But is there really programs which make many read-ops in memory space without even initialize them?
___________________________________________________
_ Yingchao Zhou _
_ ICT, CAS _
_ (86)010-62601009 _
___________________________________________________
next reply other threads:[~2006-09-13 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 14:02 Yingchao Zhou [this message]
2006-09-14 14:48 ` Hugh Dickins
2006-09-15 3:38 Re: " Yingchao Zhou
2006-09-15 4:30 ` Hugh Dickins
2006-09-15 14:19 ` Hugh Dickins
2006-09-16 7:42 ` Nick Piggin
2006-09-23 18:51 ` Hugh Dickins
2006-09-25 2:53 ` Nick Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060913140241.60C5FFB046@ncic.ac.cn \
--to=yc_zhou@ncic.ac.cn \
--cc=akpm@osdl.org \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zxc@ncic.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome