Re: [PATCH 5/5] Swapless V2: Revise main migration logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux