mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	"David S. Miller" <davem@davemloft.net>,
	"Luck, Tony" <tony.luck@intel.com>,
	Ben Herrenschmidt <benh@kernel.crashing.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] freepgt: remove arch pgd_addr_end
Date: Mon, 21 Mar 2005 20:57:47 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0503212056460.1970@goblin.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0503212048040.1970@goblin.wat.veritas.com>

ia64 and sparc64 hurriedly had to introduce their own variants of
pgd_addr_end, to leapfrog over the holes in their virtual address spaces
which the final clear_page_range suddenly presented when converted from
pgd_index to pgd_addr_end.  But now that free_pgtables respects the vma
list, those holes are never presented, and the arch variants can go.

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

 include/asm-generic/pgtable.h |    8 +++-----
 include/asm-ia64/pgtable.h    |   26 --------------------------
 include/asm-sparc64/pgtable.h |   15 ---------------
 3 files changed, 3 insertions(+), 46 deletions(-)

--- freepgt3/include/asm-generic/pgtable.h	2005-03-18 10:22:40.000000000 +0000
+++ freepgt4/include/asm-generic/pgtable.h	2005-03-21 19:07:13.000000000 +0000
@@ -136,17 +136,15 @@ static inline void ptep_set_wrprotect(st
 #endif
 
 /*
- * When walking page tables, get the address of the next boundary, or
- * the end address of the range if that comes earlier.  Although end might
- * wrap to 0 only in clear_page_range, __boundary may wrap to 0 throughout.
+ * When walking page tables, get the address of the next boundary,
+ * or the end address of the range if that comes earlier.  Although no
+ * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
  */
 
-#ifndef pgd_addr_end
 #define pgd_addr_end(addr, end)						\
 ({	unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;	\
 	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
 })
-#endif
 
 #ifndef pud_addr_end
 #define pud_addr_end(addr, end)						\
--- freepgt3/include/asm-ia64/pgtable.h	2005-03-21 19:07:01.000000000 +0000
+++ freepgt4/include/asm-ia64/pgtable.h	2005-03-21 19:07:13.000000000 +0000
@@ -551,32 +551,6 @@ do {											\
 #define __HAVE_ARCH_PTE_SAME
 #define __HAVE_ARCH_PGD_OFFSET_GATE
 
-/*
- * Override for pgd_addr_end() to deal with the virtual address space holes
- * in each region.  In regions 0..4 virtual address bits are used like this:
- *      +--------+------+--------+-----+-----+--------+
- *      | pgdhi3 | rsvd | pgdlow | pmd | pte | offset |
- *      +--------+------+--------+-----+-----+--------+
- *  'pgdlow' overflows to pgdhi3 (a.k.a. region bits) leaving rsvd==0
- */
-#define IA64_PGD_OVERFLOW (PGDIR_SIZE << (PAGE_SHIFT-6))
-
-#define pgd_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;	\
- 	if (REGION_NUMBER(__boundary) < 5 && 				\
-	    __boundary & IA64_PGD_OVERFLOW)				\
-		__boundary += (RGN_SIZE - 1) & ~(IA64_PGD_OVERFLOW - 1);\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
-#define pmd_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;	\
- 	if (REGION_NUMBER(__boundary) < 5 &&				\
-	    __boundary & IA64_PGD_OVERFLOW)				\
-		__boundary += (RGN_SIZE - 1) & ~(IA64_PGD_OVERFLOW - 1);\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
 #include <asm-generic/pgtable-nopud.h>
 #include <asm-generic/pgtable.h>
 
--- freepgt3/include/asm-sparc64/pgtable.h	2005-03-18 10:22:42.000000000 +0000
+++ freepgt4/include/asm-sparc64/pgtable.h	2005-03-21 19:07:13.000000000 +0000
@@ -432,21 +432,6 @@ extern int io_remap_page_range(struct vm
 			       unsigned long offset,
 			       unsigned long size, pgprot_t prot, int space);
 
-/* Override for {pgd,pmd}_addr_end() to deal with the virtual address
- * space hole.  We simply sign extend bit 43.
- */
-#define pgd_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;	\
-	__boundary = ((long) (__boundary << 20)) >> 20;			\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
-#define pmd_addr_end(addr, end)						\
-({	unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;	\
-	__boundary = ((long) (__boundary << 20)) >> 20;			\
-	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
-})
-
 #include <asm-generic/pgtable.h>
 
 /* We provide our own get_unmapped_area to cope with VA holes for userland */

  parent reply	other threads:[~2005-03-21 21:40 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-21 20:52 [PATCH 1/5] freepgt: free_pgtables use vma list Hugh Dickins
2005-03-21 20:55 ` [PATCH 2/5] freepgt: remove MM_VM_SIZE(mm) Hugh Dickins
2005-03-21 20:56 ` [PATCH 3/5] freepgt: hugetlb_free_pgd_range Hugh Dickins
2005-03-21 20:57 ` Hugh Dickins [this message]
2005-03-21 20:58 ` [PATCH 5/5] freepgt: mpnt to vma cleanup Hugh Dickins
2005-03-21 22:26 ` [PATCH 1/5] freepgt: free_pgtables use vma list David S. Miller
2005-03-22  5:47   ` Hugh Dickins
2005-03-22 17:41     ` David S. Miller
2005-03-22 11:40 ` Andrew Morton
2005-03-22 12:17   ` Nick Piggin
2005-03-22 16:37   ` Hugh Dickins
2005-03-22 18:34     ` David S. Miller
2005-03-22 19:01     ` David S. Miller
2005-03-22 19:21       ` David S. Miller
2005-03-22 19:23         ` David S. Miller
2005-03-22 19:36           ` Hugh Dickins
2005-03-22 20:21             ` David S. Miller
2005-03-22 23:45               ` Benjamin Herrenschmidt
2005-03-22 20:33             ` David S. Miller
2005-03-22 21:51               ` Hugh Dickins
2005-03-22 22:41                 ` David S. Miller
2005-03-23  0:51                   ` Hugh Dickins
2005-03-23  2:09                     ` David S. Miller
2005-03-22 23:32                 ` Nick Piggin
2005-03-22 23:44                   ` David S. Miller
2005-03-23  0:19                     ` Nick Piggin
2005-03-23  0:20                       ` David S. Miller
2005-03-23  0:00                   ` David S. Miller
2005-03-23  0:03                   ` David S. Miller
2005-03-22 21:28             ` David S. Miller
2005-03-22 23:30     ` Benjamin Herrenschmidt
2005-03-23 13:28       ` Hugh Dickins
2005-03-23 23:07         ` Benjamin Herrenschmidt

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.0503212056460.1970@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --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

all inboxes | Powered by JetHome®