File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,15 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
171
171
return true;
172
172
}
173
173
174
+ /*
175
+ * Seek to next pte only makes sense for THP.
176
+ * But more important than that optimization, is to filter out
177
+ * any PageKsm page: whose page->index misleads vma_address()
178
+ * and vma_address_end() to disaster.
179
+ */
180
+ end = PageTransCompound (page ) ?
181
+ vma_address_end (page , pvmw -> vma ) :
182
+ pvmw -> address + PAGE_SIZE ;
174
183
if (pvmw -> pte )
175
184
goto next_pte ;
176
185
restart :
@@ -238,10 +247,6 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
238
247
if (check_pte (pvmw ))
239
248
return true;
240
249
next_pte :
241
- /* Seek to next pte only makes sense for THP */
242
- if (!PageTransHuge (page ))
243
- return not_found (pvmw );
244
- end = vma_address_end (page , pvmw -> vma );
245
250
do {
246
251
pvmw -> address += PAGE_SIZE ;
247
252
if (pvmw -> address >= end )
You can’t perform that action at this time.
0 commit comments