Thread (27 messages) 27 messages, 6 authors, 2016-06-09

Re: [PATCH] mm, thp: fix locking inconsistency in collapse_huge_page

flat view

From: Sergey Senozhatsky <hidden>
Date: 2016-06-09 03:51:13
Also in: linux-next, lkml

On (06/06/16 15:05), Vlastimil Babka wrote:
[..]
I think this does fix the inconsistency, thanks.

But looking at collapse_huge_page() as of latest -next, I wonder if there's
another problem:

pmd = mm_find_pmd(mm, address);
...
up_read(&mm->mmap_sem);
down_write(&mm->mmap_sem);
hugepage_vma_revalidate(mm, address);
...
pte = pte_offset_map(pmd, address);

What guarantees that 'pmd' is still valid?
the same question applied to __collapse_huge_page_swapin(), I think.

__collapse_huge_page_swapin(pmd)
	pte = pte_offset_map(pmd, address);
	do_swap_page(mm, vma, _address, pte, pmd...)
		up_read(&mm->mmap_sem);
	down_read(&mm->mmap_sem);
	pte = pte_offset_map(pmd, _address);

	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help