[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mm->mmap_sem
Hi,
On Fri, 24 Sep 1999 10:59:31 -0400 (EDT), James Simmons
<jsimmons@edgeglobal.com> said:
> Does this mean while one process is in the act of mlocking a memory
> region another process can actually change the contents of that memory?
Yes. The semaphore only protects against changes to the mmap lists and
page tables. It does not protect memory itself. On a multi-processor
machine, the only way the kernel on one CPU can prevent the contents of
a page from being modified by a process on another CPU is to forcibly
revoke all read-write mappings to that page.
>> > Will this semaphore protect this region? In a SMP machine same
>> > thing. What kind of protect does this semaphore provide? Does it
>> > prevent other process from doing anything to the memory.
>>
>> No.
> I obtained this idea from do_page_fault. This function is called from a
> interrupt when a process actually tries to access memory correct?
No, it is only called when a process tries to access memory which is not
currently in the process's page tables. If the page is already mapped,
then there is no page fault. Otherwise you'd be doing massive amounts
of kernel work for every byte of data accessed by every process.
--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/