Re: Re: No copy on write system call?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What is the size of virtual memory?  My understanding would
be that virtual memory == paging space.  In my case my 
system has 256MB physical and a 512MB swap partition.  Thus
I can have at most 768MB of memory in use at one time before
I exhaust all of the memory.  Since kernel memory is not
pageable then the total would be 768 - kernel memory which
would be avaialble for user space applications.

In my test I was able to allocate 705M on the heap in a user
application and do a write which works.  Based on this I can
conclude that the kernel could not have created a copy of my
buffer before it wrote the data to disk as it would have run
out of memory.

So my original question is, how does the kernel do this?  I 
was under the impression that any memory passed to the
kernel had to be checked to see if it is valid and then
copied to make sure that it was in physical non-paged memory.

The only thing I can think of is that in this case the kernel
can use the user space addresses as is and is in a position
to handle page faults?

Does this make sense?

Thanks,
Tony

> 
> From: Timur Tabi <timur.tabi@xxxxxxxxxxx>
> Date: 2005/03/22 Tue AM 10:48:52 CST
> To: kernelnewbies@xxxxxxxxxxxx
> Subject: Re: No copy on write system call?
> 
> stackframe@xxxxxxxxxxx wrote:
> > How is it that a write (man 2 write) can be passed a buffer 
> > that exceeds most of the physical and virtual memory on a 
> > system and work successfully?
> 
> I don't see how you can create a buffer at all that exceeds the size of 
> virtual memory.
> 
> -- 
> Timur Tabi
> Staff Software Engineer
> timur.tabi@xxxxxxxxxxx
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
> 


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux