Skip to content

Commit

Permalink
HWPOISON: Export some rmap vma locking to outside world
Browse files Browse the repository at this point in the history
Needed for later patch that walks rmap entries on its own.

This used to be very frowned upon, but memory-failure.c does
some rather specialized rmap walking and rmap has been stable
for quite some time, so I think it's ok now to export it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Sep 16, 2009
1 parent d466f2f commit 10be22d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions include/linux/rmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ int page_mkclean(struct page *);
*/
int try_to_munlock(struct page *);

/*
* Called by memory-failure.c to kill processes.
*/
struct anon_vma *page_lock_anon_vma(struct page *page);
void page_unlock_anon_vma(struct anon_vma *anon_vma);

#else /* !CONFIG_MMU */

#define anon_vma_init() do {} while (0)
Expand Down
4 changes: 2 additions & 2 deletions mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void __init anon_vma_init(void)
* Getting a lock on a stable anon_vma from a page off the LRU is
* tricky: page_lock_anon_vma rely on RCU to guard against the races.
*/
static struct anon_vma *page_lock_anon_vma(struct page *page)
struct anon_vma *page_lock_anon_vma(struct page *page)
{
struct anon_vma *anon_vma;
unsigned long anon_mapping;
Expand All @@ -211,7 +211,7 @@ static struct anon_vma *page_lock_anon_vma(struct page *page)
return NULL;
}

static void page_unlock_anon_vma(struct anon_vma *anon_vma)
void page_unlock_anon_vma(struct anon_vma *anon_vma)
{
spin_unlock(&anon_vma->lock);
rcu_read_unlock();
Expand Down

0 comments on commit 10be22d

Please sign in to comment.