feeling_lonely
feeling_lonely

Reputation: 6853

What effect lock_page has on that page and on processes referencing/mapping that page?

What locking a page (i.e. lock_page() or try_lock_page()) is supposed to do? Can the process reference a memory location in a locked page or it has to wait until that lock is released?

I will be writing some tests and run them to see what actually happens. But I would like to know what should I expect.

Also, is there any way to prevent a process from accessing particular page? something other than read/write protect. I want something to work on the page level.

Thanks.

Upvotes: 2

Views: 744

Answers (1)

Alex Hoppus
Alex Hoppus

Reputation: 3935

lock_page defends struct page fields from concurrent access. It has no business with memory location which this page struct describes. To avoid page "X" allocation for concrete process you may try to modify __alloc_pages_nodemask function in order to get any but not "X" page from the free list.

Upvotes: 3

Related Questions