login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
2
Re: [PATCH 14/14] mm,migration: Allow the migration of PageSwapCache pages
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Mel Gorman
Subject:
Re: [PATCH 14/14] mm,migration: Allow the migration of PageSwapCache pages
Date: Friday, April 2, 2010 - 1:52 am
On Fri, Apr 02, 2010 at 09:21:50AM +0900, KAMEZAWA Hiroyuki wrote:
quoted text
> On Thu, 1 Apr 2010 18:36:41 +0100 > Mel Gorman <mel@csn.ul.ie> wrote: > > > > > == > > > > skip_remap = 0; > > > > if (PageAnon(page)) { > > > > rcu_read_lock(); > > > > if (!page_mapped(page)) { > > > > if (!PageSwapCache(page)) > > > > goto rcu_unlock; > > > > /* > > > > * We can't convice this anon_vma is valid or not because > > > > * !page_mapped(page). Then, we do migration(radix-tree replacement) > > > > * but don't remap it which touches anon_vma in page->mapping. > > > > */ > > > > skip_remap = 1; > > > > goto skip_unmap; > > > > } else { > > > > anon_vma = page_anon_vma(page); > > > > atomic_inc(&anon_vma->external_refcount); > > > > } > > > > } > > > > .....copy page, radix-tree replacement,.... > > > > > > > > > > It's not enough. > > > we uses remove_migration_ptes in move_to_new_page, too. > > > We have to prevent it. > > > We can check PageSwapCache(page) in move_to_new_page and then > > > skip remove_migration_ptes. > > > > > > ex) > > > static int move_to_new_page(....) > > > { > > > int swapcache = PageSwapCache(page); > > > ... > > > if (!swapcache) > > > if(!rc) > > > remove_migration_ptes > > > else > > > newpage->mapping = NULL; > > > } > > > > > > > This I agree with. > > > me, too. > > > > I am not sure this race exists because the page is locked but a key > > observation has been made - A page that is unmapped can be migrated if > > it's PageSwapCache but it may not have a valid anon_vma. Hence, in the > > !page_mapped case, the key is to not use anon_vma. How about the > > following patch? > > > > Seems good to me. But (see below) > > > > ==== CUT HERE ==== > > > > mm,migration: Allow the migration of PageSwapCache pages > > > > PageAnon pages that are unmapped may or may not have an anon_vma so are > > not currently migrated. However, a swap cache page can be migrated and > > fits this description. This patch identifies page swap caches and allows > > them to be migrated but ensures that no attempt to made to remap the pages > > would would potentially try to access an already freed anon_vma. > > > > Signed-off-by: Mel Gorman <mel@csn.ul.ie> > > > > diff --git a/mm/migrate.c b/mm/migrate.c > > index 35aad2a..5d0218b 100644 > > --- a/mm/migrate.c > > +++ b/mm/migrate.c > > @@ -484,7 +484,8 @@ static int fallback_migrate_page(struct address_space *mapping, > > * < 0 - error code > > * == 0 - success > > */ > > -static int move_to_new_page(struct page *newpage, struct page *page) > > +static int move_to_new_page(struct page *newpage, struct page *page, > > + int safe_to_remap) > > { > > struct address_space *mapping; > > int rc; > > @@ -519,10 +520,12 @@ static int move_to_new_page(struct page *newpage, struct page *page) > > else > > rc = fallback_migrate_page(mapping, newpage, page); > > > > - if (!rc) > > - remove_migration_ptes(page, newpage); > > - else > > - newpage->mapping = NULL; > > + if (safe_to_remap) { > > + if (!rc) > > + remove_migration_ptes(page, newpage); > > + else > > + newpage->mapping = NULL; > > + } > > > if (rc) > newpage->mapping = NULL; > else if (safe_to_remap) > remove_migrateion_ptes(page, newpage); > > Is better. Old code cleared newpage->mapping if rc!=0. >
True, done. -- Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH 14/14] mm,migration: Allow the migration of PageSwa ...
, Mel Gorman
, (Tue Mar 30, 2:14 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, KAMEZAWA Hiroyuki
, (Tue Mar 30, 10:26 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Mel Gorman
, (Wed Mar 31, 4:27 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, KAMEZAWA Hiroyuki
, (Wed Mar 31, 4:57 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Minchan Kim
, (Wed Mar 31, 7:39 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Minchan Kim
, (Wed Mar 31, 7:43 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, KAMEZAWA Hiroyuki
, (Wed Mar 31, 8:01 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Minchan Kim
, (Wed Mar 31, 9:44 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, KAMEZAWA Hiroyuki
, (Wed Mar 31, 10:42 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Mel Gorman
, (Thu Apr 1, 2:30 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Minchan Kim
, (Thu Apr 1, 3:42 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Minchan Kim
, (Thu Apr 1, 3:51 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Mel Gorman
, (Thu Apr 1, 10:36 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Minchan Kim
, (Thu Apr 1, 5:20 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, KAMEZAWA Hiroyuki
, (Thu Apr 1, 5:21 pm)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Mel Gorman
, (Fri Apr 2, 1:51 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ...
, Mel Gorman
, (Fri Apr 2, 1:52 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ingo Molnar
Re: [patch] e1000=y && e1000e=m regression fix
Greg Kroah-Hartman
[PATCH 20/36] Driver core: Call device_pm_add() after bus_add_device() in device_a...
Eli Cohen
Re: LRO num of frags limit
Boaz Harrosh
how to use KBUILD_EXTRA_SYMBOLS
Pekka Enberg
Re: [PATCH] include/linux/slab.h: new KFREE() macro.
git
:
Bill Lear
cpio command not found
Jing Xue
Re: git rm --cached
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
Michael S. Tsirkin
git-kill: rewrite history removing a commit
Johannes Sixt
Re: How to pull remote branch with specified commit id?
linux-netdev
:
Johann Baudy
Packet mmap: TX RING and zero copy
Stephen Hemminger
Re: NAPI, rx_no_buffer_count, e1000, r8169 and other actors
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
Balazs Scheidler
Re: [PATCH 5/9] tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is...
David Miller
Re: [net-next PATCH 2/2] qlge: Version change to v1.00.00.27
openbsd-misc
:
Bryan Irvine
Re: DVD burn error: No space left on device
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Siju George
This is what Linus Torvalds calls openBSD crowd
elitdostlar
Seks partneri arayan bayanlar bu adreste - 8878xs706x6438
Skylar Hawk
Re: asus eee 1201n - acpitz0 critical temperature 255C (5282K), shutting down
git-commits-head
:
Linux Kernel Mailing List
Linux 2.6.34-rc4
Linux Kernel Mailing List
x86 boot: only pick up additional EFI memmap if add_efi_memmap flag
Linux Kernel Mailing List
powerpc/fsl_msi: enable msi allocation in all banks
Linux Kernel Mailing List
[ALSA] hda-codec - Add support for VIA VT1708B HD audio codec
Linux Kernel Mailing List
ARM: dma-mapping: remove dmac_clean_range and dmac_inv_range
Colocation donated by:
Syndicate