On Tue, 18 Apr 2006, KAMEZAWA Hiroyuki wrote: > I think following patch will help. but this increases complexity... Hmm... So the idea is to lock the anon vma before removing the ptes and keep it until we are finished migrating. I like it! That would also reduce the locking overhead. > /* > + * When mmap->sem is not held, we have to guarantee anon_vma is not freed. > + */ > +static void migrate_lock_anon_vma(struct page *page) > +{ > + unsigned long mapping; > + struct anon_vma *anon_vma; > + struct vm_area_struct *vma; > + > + if (PageAnon(page)) > + page_lock_anon_vma(page); > + /* remove migration ptes will unlock */ > +} We need a whole function for two statements? > */ > anon_vma = (struct anon_vma *) (mapping - PAGE_MAPPING_ANON); > - spin_lock(&anon_vma->lock); Maybe we better pass the anon_vma as a parameter? > +++ Christoph-NewMigrationV2/mm/rmap.c > @@ -160,7 +160,7 @@ void anon_vma_unlink(struct vm_area_stru > empty = list_empty(&anon_vma->head); > spin_unlock(&anon_vma->lock); > > - if (empty) > + if (empty && !anon_vma->async_refernece) > anon_vma_free(anon_vma); > } async_reference? What is this for? This does not exist in Linus' tree. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- References:
- [PATCH 0/5] Swapless page migration V2: Overview
- From: Christoph Lameter <[email protected]>
- [PATCH 5/5] Swapless V2: Revise main migration logic
- From: Christoph Lameter <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: Christoph Lameter <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: Christoph Lameter <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: Christoph Lameter <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: Christoph Lameter <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: Christoph Lameter <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: Christoph Lameter <[email protected]>
- Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- From: KAMEZAWA Hiroyuki <[email protected]>
- [PATCH 0/5] Swapless page migration V2: Overview
- Prev by Date: Re: No kernel message when filesystem full
- Next by Date: Re: [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices
- Previous by thread: Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- Next by thread: Re: [PATCH 5/5] Swapless V2: Revise main migration logic
- Index(es):