Re: Do I need spin_lock before pgd/pmd/pte_offset?

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

 



Ed L Cashin wrote:

The normal order of lock acquisition is first to get the mmap
semaphore (at which point you may sleep) and then to get the page
table lock.

So you're saying I need to use

	down_read(&current->mm->mmap_sem);
	...
	up_read(&current->mm->mmap_sem);

In addition to the spinlocks?

A good reference for the proceedure you're implementing is follow_page
in mm/memory.c.  Note that it's called with the page_table_lock held.

I'm looking at follow_page() in 2.6.6, and I don't see any spinlock or semaphore code. The code in RedHat 9.0 is also similar in this respect.


No, the page table lock allows you to see a consistent view of the
page tables while you hold it.

Is "&current->mm->page_table_lock" the right parameter to use in this case?

--
Timur Tabi
Staff Software Engineer
timur.tabi@ammasso.com

--
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