From mboxrd@z Thu Jan 1 00:00:00 1970 From: venkatram867@gmail.com (Venkatram Tummala) Date: Tue, 29 Mar 2011 15:30:26 -0700 Subject: [virtual memory] page_table_lock & mmap_sem Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi, Why do we need both page_table_lock & mmap_sem in the kernel. Why isn't mmap_sem good enough for serialization. As far as i see it, all attempts to change the page table hierarchy in the kernel is done after holding the write lock on mmap_sem. As we are already holding the write lock, we do we need an extra page_table_lock (spinlock) ? Are there any code paths in the kernel which attempt to modify the page table hierarchy without holding the write lock on mmap_sem ? page_table_lock is a finer grained lock than mmap_sem but page_table_lock is only taken after holding a write lock on mmap_sem (as far as i can tell). What is the reasoning behind having an extra spinlock? Thanks. Venkatram Tummala -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110329/28620d70/attachment.html