[RFC 02/10] mm/hmm: Remove dead check for HugeTLB and FS DAX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pud_huge() returns true only for a HugeTLB page. pud_devmap() is only
used by FS DAX pages. These two things are mutually exclusive so this
code is dead code and can be removed.

Signed-off-by: Alistair Popple <apopple@xxxxxxxxxx>
---
 mm/hmm.c | 33 ---------------------------------
 1 file changed, 33 deletions(-)

diff --git a/mm/hmm.c b/mm/hmm.c
index 277ddca..5bbfb0e 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -411,9 +411,6 @@ static inline unsigned long pud_to_hmm_pfn_flags(struct hmm_range *range,
 static int hmm_vma_walk_pud(pud_t *pudp, unsigned long start, unsigned long end,
 		struct mm_walk *walk)
 {
-	struct hmm_vma_walk *hmm_vma_walk = walk->private;
-	struct hmm_range *range = hmm_vma_walk->range;
-	unsigned long addr = start;
 	pud_t pud;
 	spinlock_t *ptl = pud_trans_huge_lock(pudp, walk->vma);
 
@@ -429,39 +426,9 @@ static int hmm_vma_walk_pud(pud_t *pudp, unsigned long start, unsigned long end,
 		return hmm_vma_walk_hole(start, end, -1, walk);
 	}
 
-	if (pud_huge(pud) && pud_devmap(pud)) {
-		unsigned long i, npages, pfn;
-		unsigned int required_fault;
-		unsigned long *hmm_pfns;
-		unsigned long cpu_flags;
-
-		if (!pud_present(pud)) {
-			spin_unlock(ptl);
-			return hmm_vma_walk_hole(start, end, -1, walk);
-		}
-
-		i = (addr - range->start) >> PAGE_SHIFT;
-		npages = (end - addr) >> PAGE_SHIFT;
-		hmm_pfns = &range->hmm_pfns[i];
-
-		cpu_flags = pud_to_hmm_pfn_flags(range, pud);
-		required_fault = hmm_range_need_fault(hmm_vma_walk, hmm_pfns,
-						      npages, cpu_flags);
-		if (required_fault) {
-			spin_unlock(ptl);
-			return hmm_vma_fault(addr, end, required_fault, walk);
-		}
-
-		pfn = pud_pfn(pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT);
-		for (i = 0; i < npages; ++i, ++pfn)
-			hmm_pfns[i] = pfn | cpu_flags;
-		goto out_unlock;
-	}
-
 	/* Ask for the PUD to be split */
 	walk->action = ACTION_SUBTREE;
 
-out_unlock:
 	spin_unlock(ptl);
 	return 0;
 }
-- 
git-series 0.9.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux