mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: akpm@osdl.org, davem@davemloft.net, tony.luck@intel.com,
	benh@kernel.crashing.org, ak@suse.de,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/6] freepgt: hugetlb area is clean
Date: Wed, 23 Mar 2005 17:16:29 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0503231715340.15274@goblin.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0503231705560.15274@goblin.wat.veritas.com>

Once we're strict about clearing away page tables, hugetlb_prefault can
assume there are no page tables left within its range.  Since the other
arches continue if !pte_none here, let i386 do the same.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

 arch/i386/mm/hugetlbpage.c  |   11 ++---------
 arch/ppc64/mm/hugetlbpage.c |   37 -------------------------------------
 2 files changed, 2 insertions(+), 46 deletions(-)

--- freepgt5/arch/i386/mm/hugetlbpage.c	2005-03-18 10:22:18.000000000 +0000
+++ freepgt6/arch/i386/mm/hugetlbpage.c	2005-03-23 15:41:23.000000000 +0000
@@ -246,15 +246,8 @@ int hugetlb_prefault(struct address_spac
 			goto out;
 		}
 
-		if (!pte_none(*pte)) {
-			pmd_t *pmd = (pmd_t *) pte;
-
-			page = pmd_page(*pmd);
-			pmd_clear(pmd);
-			mm->nr_ptes--;
-			dec_page_state(nr_page_table_pages);
-			page_cache_release(page);
-		}
+		if (!pte_none(*pte))
+			continue;
 
 		idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
 			+ (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
--- freepgt5/arch/ppc64/mm/hugetlbpage.c	2005-03-21 19:07:01.000000000 +0000
+++ freepgt6/arch/ppc64/mm/hugetlbpage.c	2005-03-23 15:41:23.000000000 +0000
@@ -203,8 +203,6 @@ static int prepare_low_seg_for_htlb(stru
 	unsigned long start = seg << SID_SHIFT;
 	unsigned long end = (seg+1) << SID_SHIFT;
 	struct vm_area_struct *vma;
-	unsigned long addr;
-	struct mmu_gather *tlb;
 
 	BUG_ON(seg >= 16);
 
@@ -213,41 +211,6 @@ static int prepare_low_seg_for_htlb(stru
 	if (vma && (vma->vm_start < end))
 		return -EBUSY;
 
-	/* Clean up any leftover PTE pages in the region */
-	spin_lock(&mm->page_table_lock);
-	tlb = tlb_gather_mmu(mm, 0);
-	for (addr = start; addr < end; addr += PMD_SIZE) {
-		pgd_t *pgd = pgd_offset(mm, addr);
-		pmd_t *pmd;
-		struct page *page;
-		pte_t *pte;
-		int i;
-
-		if (pgd_none(*pgd))
-			continue;
-		pmd = pmd_offset(pgd, addr);
-		if (!pmd || pmd_none(*pmd))
-			continue;
-		if (pmd_bad(*pmd)) {
-			pmd_ERROR(*pmd);
-			pmd_clear(pmd);
-			continue;
-		}
-		pte = (pte_t *)pmd_page_kernel(*pmd);
-		/* No VMAs, so there should be no PTEs, check just in case. */
-		for (i = 0; i < PTRS_PER_PTE; i++) {
-			BUG_ON(!pte_none(*pte));
-			pte++;
-		}
-		page = pmd_page(*pmd);
-		pmd_clear(pmd);
-		mm->nr_ptes--;
-		dec_page_state(nr_page_table_pages);
-		pte_free_tlb(tlb, page);
-	}
-	tlb_finish_mmu(tlb, start, end);
-	spin_unlock(&mm->page_table_lock);
-
 	return 0;
 }
 

  parent reply	other threads:[~2005-03-23 17:24 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-23 17:10 [PATCH 0/6] freepgt: free_pgtables shakeup Hugh Dickins
2005-03-23 17:11 ` [PATCH 1/6] freepgt: free_pgtables use vma list Hugh Dickins
2005-03-24 12:26   ` Andi Kleen
2005-03-29 22:03     ` Hugh Dickins
2005-03-30 15:08       ` Andi Kleen
2005-03-30 17:15         ` Hugh Dickins
2005-03-31 10:57           ` Andi Kleen
2005-03-25  5:32   ` Nick Piggin
2005-03-25  5:35     ` Nick Piggin
2005-03-25 17:23       ` David S. Miller
2005-03-25 17:23     ` David S. Miller
2005-03-26  0:29       ` David S. Miller
2005-03-29 21:32         ` Hugh Dickins
2005-03-30 10:46         ` David Howells
2005-03-30 11:32           ` Ian Molton
2005-03-30 12:22           ` Hugh Dickins
2005-03-30 18:15             ` David S. Miller
2005-03-23 17:12 ` [PATCH 2/6] freepgt: remove MM_VM_SIZE(mm) Hugh Dickins
2005-03-23 17:13 ` [PATCH 3/6] freepgt: hugetlb_free_pgd_range Hugh Dickins
2005-03-23 17:14 ` [PATCH 4/6] freepgt: remove arch pgd_addr_end Hugh Dickins
2005-03-23 17:15 ` [PATCH 5/6] freepgt: mpnt to vma cleanup Hugh Dickins
2005-03-23 17:16 ` Hugh Dickins [this message]
2005-03-23 19:57 ` [PATCH 0/6] freepgt: free_pgtables shakeup David S. Miller
2005-03-24  0:26   ` Nick Piggin
2005-03-24  5:44     ` David S. Miller
2005-03-30 19:30     ` Hugh Dickins
2005-03-30 23:40       ` Nick Piggin
2005-03-25 21:22 ` Russell King
2005-03-26  2:06   ` Nick Piggin
2005-03-26 11:35     ` Russell King
2005-03-26 13:37       ` Russell King
2005-03-26 13:51         ` Nick Piggin
2005-03-26 15:03           ` Russell King
2005-03-30 17:00             ` Hugh Dickins
2005-03-30 17:39               ` Russell King
2005-03-26 13:42       ` Nick Piggin
2005-03-26 15:52         ` Russell King
2005-03-27  3:41           ` Nick Piggin
2005-03-27  7:57             ` Russell King
2005-03-27 18:17               ` David S. Miller
2005-03-28  7:51                 ` Russell King
2005-03-28 18:47                   ` David S. Miller
2005-03-30 16:30           ` Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0503231715340.15274@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome