Re: [PATCH 1/4] mm: vm_page_prot: update with WRITE_ONCE/READ_ONCE

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

 



Hey Andrea
> 
> @@ -111,13 +111,16 @@ static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags)
>  void vma_set_page_prot(struct vm_area_struct *vma)
>  {
>  	unsigned long vm_flags = vma->vm_flags;
> +	pgprot_t vm_page_prot;
> 
> -	vma->vm_page_prot = vm_pgprot_modify(vma->vm_page_prot, vm_flags);
> +	vm_page_prot = vm_pgprot_modify(vma->vm_page_prot, vm_flags);
>  	if (vma_wants_writenotify(vma)) {

Since vma->vm_page_prot is currently used in vma_wants_writenotify(), is 
it possible that semantic change is introduced here with local variable? 

thanks
Hillf
>  		vm_flags &= ~VM_SHARED;
> -		vma->vm_page_prot = vm_pgprot_modify(vma->vm_page_prot,
> -						     vm_flags);
> +		vm_page_prot = vm_pgprot_modify(vma->vm_page_prot,
> +						vm_flags);
>  	}
> +	/* remove_protection_ptes reads vma->vm_page_prot without mmap_sem */
> +	WRITE_ONCE(vma->vm_page_prot, vm_page_prot);
>  }
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]