Skip to contentSkip to conversation

pagemap: avoid splitting thp when reading /proc/pid/pagemap

PATCH Naoya Horiguchi 1 participant 1 message Jan 16, 2012 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines · Andrea Arcangeli

Review

Quoted 9 lines · Naoya Horiguchi
(quoted diff) +9 -0
+		if (pmd_trans_splitting(*pmd)) {
+			spin_unlock(&walk->mm->page_table_lock);
+			wait_split_huge_page(vma->anon_vma, pmd);
+		} else {
+			for (; addr != end; addr += PAGE_SIZE) {
+				unsigned long offset = (addr & ~PAGEMAP_WALK_MASK)
+					>> PAGE_SHIFT;
+				pfn = thp_pte_to_pagemap_entry(*(pte_t *)pmd,
+							       offset);
Quoted 7 lines

What is this that then morphs into a pme (which still has a cast inside its creation)? thp_pte_to_pagemap_entry don't seem to be passed ptes too. The only case where it is valid to do a cast like that is when a function is used by both ptes sand pmds and the code tends to work for both with minimal modification to differentiate the two cases. Considering the function that gets the cast is called thp_ this is hardly the case here.

Agreed.

Quoted 4 lines

Why don't you pass the pmd and then do "if (pmd_present(pmd)) page_to_pfn(pmd_page(pmd)) ? What's the argument for the cast. I'm just reviewing this series and maybe it was covered in previous versions.

OK, I can do this by introducing pmd_pte as you commented in another email.

Quoted 2 lines

I don't get this pme thing for something as trivial as above that shouldn't require any cast at all.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>