public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Clark <michael@metaparadigm.com>
To: Lutz Vieweg <lkv@isg.de>
Cc: Robin Holt <holt@sgi.com>, linux-kernel@vger.kernel.org
Subject: Re: How to find out which pages were copied-on-write?
Date: Wed, 14 Jul 2004 08:25:25 +0800	[thread overview]
Message-ID: <40F47D75.1060706@metaparadigm.com> (raw)
In-Reply-To: <40F40238.3080103@isg.de>

On 07/13/04 23:39, Lutz Vieweg wrote:
> Michael Clark wrote:
> 
>> On 07/13/04 21:04, Lutz Vieweg wrote:
>>
>>>> You don't use mmap for speed but rather for convenience.
>>>
>>>
>>> But isn't an advantage with mmap() that there's no need for the kernel
>>> to copy what is to be written to a dedicated buffer? The kernel
>>> could initiate DMA writes directly from the working memory...
>>
>>
>> Yes, but page faults are expensive too. Each time a page is written
>> out it needs to be marked read only again and will cause a page fault
>> for the next write access from userspace. For certain workloads this
>> can easily add up to more than copy_(to|from)_user in read/write.
> 
> 
> But I would need exactly the same number of pagefaults if I implemented
> the "mark-dirty-on-write" logic in userspace using SIGSEGV and signal
> handlers, as it is done by the LPSM software...

Yes, that's sort of my point although you get the commit semantics
you want, albeit a little more usersapce signal overhead and an mprotect
call (you've already taken the exception so the extra signal overhead
shouldn't be too much), but perhaps less overall page faults than
MAP_SHARED (which is the mmap variant that writes dirtied pages back
to backing store) as you control when to mark the page clean again
ie. do the writeout at your commit point and not before.

Really my point was you don't use mmap for speed but rather for convenience.

~mc

      reply	other threads:[~2004-07-14  0:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-06 15:58 How to find out which pages were copied-on-write? Lutz Vieweg
2004-07-09 11:31 ` Robin Holt
2004-07-09 20:42   ` Lutz Vieweg
2004-07-10  8:11     ` Michael Clark
2004-07-12 17:21       ` Lutz Vieweg
2004-07-13  4:16         ` Michael Clark
2004-07-13 13:04           ` Lutz Vieweg
2004-07-13 15:02             ` Michael Clark
2004-07-13 15:39               ` Lutz Vieweg
2004-07-14  0:25                 ` Michael Clark [this message]

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=40F47D75.1060706@metaparadigm.com \
    --to=michael@metaparadigm.com \
    --cc=holt@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkv@isg.de \
    /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