Re: Question on i_mmap_mutex locking rule

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

 



(2012/04/02 21:04), Aneesh Kumar K.V wrote:

> 
> Hi,
> 
> I started looking at unmap_hugepage_range. unmap_hugepage_range takes
> i_mmap_mutex. But then the same lock is also taken higher up in the
> stack. ie via the below chain
> 
> unmap_mapping_range (i_mmap_mutex)
>  -> unmap_mapping_range_tree
>     -> unmap_mapping_range_vma
>        -> zap_page_range_single
>           -> unmap_single_vma
>              -> unmap_hugepage_range (i_mmap_mutex)
> 


why not deadlock ?

> But there are other code path that doesn't take i_mmap_mutex. For ex:
> -> madvise_dontneed
>    -> zap_page_range
>       -> unmap_vmas
>          -> unmap_single_vma
>             -> unmap_page_range
>       
> 


IIUC, DONTNEED will not change vma layout...so it doesn't require
i_mmap_mutex.

Thanks,
-Kame 


--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
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]