History

mm/huge_memory: rename freeze_page() to unmap_page()

The term "freeze" is used in several ways in the kernel, and in mm it has the particular meaning of forcing page refcount temporarily to 0. freeze_page() is just too confusing a name for a function that unmaps a page: rename it unmap_page(), and rename unfreeze_page() remap_page(). Went to change the mention of freeze_page() added later in mm/rmap.c, but found it to be incorrect: ordinary page reclaim reaches there too; but the substance of the comment still seems correct, so edit it down.

Hugh Dickins committed 7 years ago

Commit 906f9cd1 parent 7c0950d2 files · +9 −16Browse files

Unified · Split

2 files
  1. mm/huge_memory.c +6 −6
  2. mm/rmap.c +3 −10
mm/huge_memory.c+6−6
@@ -2350,7 +2350,7 @@ void vma_adjust_trans_huge(struct vm_area_struct *vma, · 2349 unmodified lines
23502350 }
23512351 }
23522352
2353−static void freeze_page(struct page *page)
2353+static void unmap_page(struct page *page)
23542354 {
23552355 enum ttu_flags ttu_flags = TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS |
23562356 TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD;
@@ -2365,7 +2365,7 @@ static void freeze_page(struct page *page) · 8 unmodified lines
23652365 VM_BUG_ON_PAGE(!unmap_success, page);
23662366 }
23672367
2368−static void unfreeze_page(struct page *page)
2368+static void remap_page(struct page *page)
23692369 {
23702370 int i;
23712371 if (PageTransHuge(page)) {
@@ -2483,7 +2483,7 @@ static void __split_huge_page(struct page *page, struct list_head *list, · 111 unmodified lines
24832483
24842484 spin_unlock_irqrestore(zone_lru_lock(page_zone(head)), flags);
24852485
2486− unfreeze_page(head);
2486+ remap_page(head);
24872487
24882488 for (i = 0; i < HPAGE_PMD_NR; i++) {
24892489 struct page *subpage = head + i;
@@ -2664,7 +2664,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) · 174 unmodified lines
26642664 }
26652665
26662666 /*
2667− * Racy check if we can split the page, before freeze_page() will
2667+ * Racy check if we can split the page, before unmap_page() will
26682668 * split PMDs
26692669 */
26702670 if (!can_split_huge_page(head, &extra_pins)) {
@@ -2673,7 +2673,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) · 2 unmodified lines
26732673 }
26742674
26752675 mlocked = PageMlocked(page);
2676− freeze_page(head);
2676+ unmap_page(head);
26772677 VM_BUG_ON_PAGE(compound_mapcount(head), head);
26782678
26792679 /* Make sure the page is not on per-CPU pagevec as it takes pin */
@@ -2727,7 +2727,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) · 47 unmodified lines
27272727 fail: if (mapping)
27282728 xa_unlock(&mapping->i_pages);
27292729 spin_unlock_irqrestore(zone_lru_lock(page_zone(head)), flags);
2730− unfreeze_page(head);
2730+ remap_page(head);
27312731 ret = -EBUSY;
27322732 }
27332733
mm/rmap.c+3−10
@@ -1627,16 +1627,9 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, · 1626 unmodified lines
16271627 address + PAGE_SIZE);
16281628 } else {
16291629 /*
1630− * We should not need to notify here as we reach this
1631− * case only from freeze_page() itself only call from
1632− * split_huge_page_to_list() so everything below must
1633− * be true:
1634− * - page is not anonymous
1635− * - page is locked
1636− *
1637− * So as it is a locked file back page thus it can not
1638− * be remove from the page cache and replace by a new
1639− * page before mmu_notifier_invalidate_range_end so no
1630+ * This is a locked file-backed page, thus it cannot
1631+ * be removed from the page cache and replaced by a new
1632+ * page before mmu_notifier_invalidate_range_end, so no
16401633 * concurrent thread might update its page table to
16411634 * point at new page while a device still is using this
16421635 * page.

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