From: Andrew Morton <akpm@zip.com.au>
To: Tony.P.Lee@nokia.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: mprotect() api overhead.
Date: Fri, 22 Mar 2002 14:57:45 -0800 [thread overview]
Message-ID: <3C9BB6E9.16D1C533@zip.com.au> (raw)
In-Reply-To: <4D7B558499107545BB45044C63822DDE3A2043@mvebe001.NOE.Nokia.com>
Tony.P.Lee@nokia.com wrote:
>
> ...
> What I like to do is to use the mprotect() api to turn on/off the
> memory read/write access to the globally share memory. This
> way, the only possible memory corruption to the share table
> is from the APIs in the libForwardTableManager.so. It makes
> debugging this kind of problem easier. If the application
> corrupts the memory, it will cause a seg-fault which also
> makes debugging simple.
>
> Questions for the linux kernel guru are:
>
> Is this reasonable to do in Linux?
>
> Any idea the overhead for such scheme in term of numbers of
> micro-seconds added to each API call. I like to see the
> overhead in sub-microseconds range since the application
> might call the api in libForwardTableManager.so at the rate
> of 100k api call per seconds.
>
> I used the TSC counter to profile the mprotect() overhead
> in QNX (micro-kernel RTOS). It has overhead is 130
> milliseconds for 6 MB of share memory which is extremely high.
> I think the reason is all of QNX APIs turns to IPC messages
> to process manager task. It cause context switch to
> other tasks.
Seems that mprotect() against a 6 megabyte region takes five microseconds
in Linux. Which is too expensive for you.
It would be better if you could map the same memory region
two times. One with PROT_READ and the other with PROT_READ|PROT_WRITE.
Then just use the appropriate pointer at the appropriate time.
-
next prev parent reply other threads:[~2002-03-23 1:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-22 22:10 mprotect() api overhead Tony.P.Lee
2002-03-22 22:57 ` Andrew Morton [this message]
2002-03-23 1:03 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2002-03-22 23:09 Tony.P.Lee
2002-03-23 1:59 Tony.P.Lee
2002-03-23 2:20 ` Alan Cox
2002-03-25 4:19 ` Benjamin LaHaise
2002-04-06 4:13 Pete Zaitcev
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=3C9BB6E9.16D1C533@zip.com.au \
--to=akpm@zip.com.au \
--cc=Tony.P.Lee@nokia.com \
--cc=linux-kernel@vger.kernel.org \
/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