mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Yingchao Zhou <yc_zhou@ncic.ac.cn>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, akpm <akpm@osdl.org>,
	alan <alan@redhat.com>, zxc <zxc@ncic.ac.cn>
Subject: Re: Re: [RFC] PAGE_RW Should be added to PAGE_COPY ?
Date: Fri, 15 Sep 2006 04:32:28 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0609150419170.6769@blonde.wat.veritas.com> (raw)
In-Reply-To: <20060915005846.07C31FB045@ncic.ac.cn>

On Fri, 15 Sep 2006, Yingchao Zhou wrote:
> >
> >You want to mmap MAP_SHARED, which will use PAGE_SHARED instead,
> >including the write bit, both before and after the mprotects.
> >There should be no problem then: do you actually see a problem
> >when MAP_SHARED is used?
> It's ok to mmap MAP_SHARED. But is it not a normal way to malloc() a space and
> then registered to NIC ?

Not that I know of.  How would one register malloc()ed space to a NIC?
Sorry, I may well be misunderstanding you.

> >>      Adding PAGE_RW to PAGE_COPY will resolve this problem.  
> >
> >No!  That would give every user write access to shared files they
> >should have no write access to.
> I guess you refer to mmap a file MAP_READ|MAP_WRITE in MAP_PRIVATE way.
> I think it is probably more logical to read the file data into an anoymous page and filled the pte with _PAGE_RW in the first time page-fault. It will probably reduce numbers of page fault interrupt.

do_no_page() does just that when its fault demands write access; but
doesn't waste memory and time on copying when it's only a read access.

Hugh

  reply	other threads:[~2006-09-15  3:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-15  0:58 Yingchao Zhou
2006-09-15  3:32 ` Hugh Dickins [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-14  5:23 Yingchao Zhou

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=Pine.LNX.4.64.0609150419170.6769@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yc_zhou@ncic.ac.cn \
    --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

all inboxes | Powered by JetHome®