The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Copy-on-write
@ 2009-03-27  5:15 sidc7
  2009-03-27  5:35 ` Copy-on-write Bryan Donlan
  0 siblings, 1 reply; 3+ messages in thread
From: sidc7 @ 2009-03-27  5:15 UTC (permalink / raw)
  To: linux-kernel


When the kernel does a COW, say from a "src" to a "dest" page, does it need
to map the "src" and "dest" page to its address space or the kernel can
directly initiate the read from "src" and write to "dest" page ?

Thanks,
SC
-- 
View this message in context: http://www.nabble.com/Copy-on-write-tp22736146p22736146.html
Sent from the linux-kernel mailing list archive at Nabble.com.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Copy-on-write
  2009-03-27  5:15 Copy-on-write sidc7
@ 2009-03-27  5:35 ` Bryan Donlan
  2009-03-27  6:43   ` Copy-on-write sidc7
  0 siblings, 1 reply; 3+ messages in thread
From: Bryan Donlan @ 2009-03-27  5:35 UTC (permalink / raw)
  To: sidc7; +Cc: linux-kernel

On Fri, Mar 27, 2009 at 1:15 AM, sidc7 <siddhartha.chhabra@gmail.com> wrote:
>
> When the kernel does a COW, say from a "src" to a "dest" page, does it need
> to map the "src" and "dest" page to its address space or the kernel can
> directly initiate the read from "src" and write to "dest" page ?

If the source and destination pages are not in high memory (exactly
where this boundary is depends on your architecture) they do not need
to be mapped before copying. See cow_user_page in mm/memory.c,
copy_user_highpage in include/linux/highmem.h and kmap_atomic in
arch/x86/mm/highmem_32.c (as well as implementations for other
architectures)

Note that on 64-bit platforms, generally there will be no high memory,
and so remappings will never be needed to carry out a COW.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Copy-on-write
  2009-03-27  5:35 ` Copy-on-write Bryan Donlan
@ 2009-03-27  6:43   ` sidc7
  0 siblings, 0 replies; 3+ messages in thread
From: sidc7 @ 2009-03-27  6:43 UTC (permalink / raw)
  To: linux-kernel


> If the source and destination pages are not in high memory (exactly
> where this boundary is depends on your architecture) they do not need
> to be mapped before copying. See cow_user_page in mm/memory.c,
> copy_user_highpage in include/linux/highmem.h and kmap_atomic in
> arch/x86/mm/highmem_32.c (as well as implementations for other
> architectures)

> Note that on 64-bit platforms, generally there will be no high memory,
> and so remappings will never be needed to carry out a COW.

Thanks for the quick reply. In general if the kernel wishes to read any
arbitrary page mapped to an application's address space, will the kernel
cause a page fault on that page, since the page is currently not in its
address space and the kernel is wishing to read from this page?

Thanks

-- 
View this message in context: http://www.nabble.com/Copy-on-write-tp22736146p22736728.html
Sent from the linux-kernel mailing list archive at Nabble.com.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-27  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-27  5:15 Copy-on-write sidc7
2009-03-27  5:35 ` Copy-on-write Bryan Donlan
2009-03-27  6:43   ` Copy-on-write sidc7

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox