huge_memory.c (df7686101956929dcea410971656e34926773b88) huge_memory.c (ed6a79352cad00e9a49d6e438be40e45107207bf)
1/*
2 * Copyright (C) 2009 Red Hat, Inc.
3 *
4 * This work is licensed under the terms of the GNU GPL, version 2. See
5 * the COPYING file in the top-level directory.
6 */
7
8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

--- 1627 unchanged lines hidden (view full) ---

1636 pmd_t *pmd, unsigned long addr, unsigned long next)
1637{
1638 spinlock_t *ptl;
1639 pmd_t orig_pmd;
1640 struct page *page;
1641 struct mm_struct *mm = tlb->mm;
1642 bool ret = false;
1643
1/*
2 * Copyright (C) 2009 Red Hat, Inc.
3 *
4 * This work is licensed under the terms of the GNU GPL, version 2. See
5 * the COPYING file in the top-level directory.
6 */
7
8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

--- 1627 unchanged lines hidden (view full) ---

1636 pmd_t *pmd, unsigned long addr, unsigned long next)
1637{
1638 spinlock_t *ptl;
1639 pmd_t orig_pmd;
1640 struct page *page;
1641 struct mm_struct *mm = tlb->mm;
1642 bool ret = false;
1643
1644 tlb_remove_check_page_size_change(tlb, HPAGE_PMD_SIZE);
1644 tlb_change_page_size(tlb, HPAGE_PMD_SIZE);
1645
1646 ptl = pmd_trans_huge_lock(pmd, vma);
1647 if (!ptl)
1648 goto out_unlocked;
1649
1650 orig_pmd = *pmd;
1651 if (is_huge_zero_pmd(orig_pmd))
1652 goto out;

--- 59 unchanged lines hidden (view full) ---

1712}
1713
1714int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
1715 pmd_t *pmd, unsigned long addr)
1716{
1717 pmd_t orig_pmd;
1718 spinlock_t *ptl;
1719
1645
1646 ptl = pmd_trans_huge_lock(pmd, vma);
1647 if (!ptl)
1648 goto out_unlocked;
1649
1650 orig_pmd = *pmd;
1651 if (is_huge_zero_pmd(orig_pmd))
1652 goto out;

--- 59 unchanged lines hidden (view full) ---

1712}
1713
1714int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
1715 pmd_t *pmd, unsigned long addr)
1716{
1717 pmd_t orig_pmd;
1718 spinlock_t *ptl;
1719
1720 tlb_remove_check_page_size_change(tlb, HPAGE_PMD_SIZE);
1720 tlb_change_page_size(tlb, HPAGE_PMD_SIZE);
1721
1722 ptl = __pmd_trans_huge_lock(pmd, vma);
1723 if (!ptl)
1724 return 0;
1725 /*
1726 * For architectures like ppc64 we look at deposited pgtable
1727 * when calling pmdp_huge_get_and_clear. So do the
1728 * pgtable_trans_huge_withdraw after finishing pmdp related

--- 1227 unchanged lines hidden ---
1721
1722 ptl = __pmd_trans_huge_lock(pmd, vma);
1723 if (!ptl)
1724 return 0;
1725 /*
1726 * For architectures like ppc64 we look at deposited pgtable
1727 * when calling pmdp_huge_get_and_clear. So do the
1728 * pgtable_trans_huge_withdraw after finishing pmdp related

--- 1227 unchanged lines hidden ---