Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64620
b: refs/heads/master
c: 989f89c
h: refs/heads/master
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Aug 31, 2007
1 parent 37bed4e commit 145e27f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1254b12c93e1e586137a2ffef71fd33cf273f35
refs/heads/master: 989f89c57e6361e7d16fbd9572b5da7d313b073d
11 changes: 9 additions & 2 deletions trunk/mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
int rc = 0;
int *result = NULL;
struct page *newpage = get_new_page(page, private, &result);
int rcu_locked = 0;

if (!newpage)
return -ENOMEM;
Expand All @@ -636,8 +637,13 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
* we cannot notice that anon_vma is freed while we migrates a page.
* This rcu_read_lock() delays freeing anon_vma pointer until the end
* of migration. File cache pages are no problem because of page_lock()
* File Caches may use write_page() or lock_page() in migration, then,
* just care Anon page here.
*/
rcu_read_lock();
if (PageAnon(page)) {
rcu_read_lock();
rcu_locked = 1;
}
/*
* This is a corner case handling.
* When a new swap-cache is read into, it is linked to LRU
Expand All @@ -656,7 +662,8 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
if (rc)
remove_migration_ptes(page, page);
rcu_unlock:
rcu_read_unlock();
if (rcu_locked)
rcu_read_unlock();

unlock:

Expand Down

0 comments on commit 145e27f

Please sign in to comment.