Messages in this thread | | | Date | Mon, 17 Apr 2006 20:16:11 -0700 (PDT) | From | Christoph Lameter <> | Subject | Re: [PATCH 5/5] Swapless V2: Revise main migration logic |
| |
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 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/
| |