History

mm/thp: do not wait for lock_page() in deferred_split_scan()

deferred_split_scan() gets called from reclaim path. Waiting for page lock may lead to deadlock there. Replace lock_page() with trylock_page() and skip the page if we failed to lock it. We will get to the page on the next scan.

Kirill A. Shutemov committed 8 years ago

Commit fa41b901 parent fece2021 file · +3 −1Browse files

Unified · Split

mm/huge_memory.c+3−1
@@ -2783,11 +2783,13 @@ static unsigned long deferred_split_scan(struct shrinker *shrink, · 2782 unmodified lines
27832783
27842784 list_for_each_safe(pos, next, &list) {
27852785 page = list_entry((void *)pos, struct page, mapping);
2786− lock_page(page);
2786+ if (!trylock_page(page))
2787+ goto next;
27872788 /* split_huge_page() removes page from list on success */
27882789 if (!split_huge_page(page))
27892790 split++;
27902791 unlock_page(page);
2792+next:
27912793 put_page(page);
27922794 }
27932795

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t