Re: + mm-hugetlb-fix-race-when-migrate-pages.patch added to -mm tree

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

 



On Thu 21-07-16 21:25:38, zhong jiang wrote:
> On 2016/7/21 20:55, Michal Hocko wrote:
[...]
> > OK, now I understand what you mean. So you mean that a different process
> > initiates the migration while this path copies to pte. That is certainly
> > possible but I still fail to see what is the problem about that.
> > huge_pte_alloc will return the identical pte whether it is regular or
> > migration one. So what exactly is the problem?
> >
> copy_hugetlb_page_range obtain the shared dst_pte, it may be not equal
> to the src_pte.  The dst_pte can come from other process sharing the
> mapping.

So you mean that the parent doesn't have the shared pte while the child
would get one?
 
> 		/* If the pagetables are shared don't copy or take references */
> 		if (dst_pte == src_pte)
> 			continue;
>  
> Even it do the fork path, we scan the i_mmap to find same pte. I think
> that dst_pte may come from other process. It is not the parent. it
> will lead to the dst_pte is not equal to the src_pte from the parent.

Let's say this would be possible (I am not really sure but for the sake
of argumentation), if the src is not shared while dst is shared and the
page is under migration then all the page table should be marked as
swap migrate entries no? If they are not and copy_hugetlb_page_range
cannot handle with that then it is a bug in copy_hugetlb_page_range
which doesn't have anything to do with the BUG_ON in  huge_pte_alloc.
So I would argue that if the problem exists at all it is a separate
issue IMHO.

Naoya, could you comment on that please?
-- 
Michal Hocko
SUSE Labs

--
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]