All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] freepgt: free_pgtables shakeup
@ 2005-03-23 17:10 Hugh Dickins
  2005-03-23 17:11 ` [PATCH 1/6] freepgt: free_pgtables use vma list Hugh Dickins
                   ` (7 more replies)
  0 siblings, 8 replies; 49+ messages in thread
From: Hugh Dickins @ 2005-03-23 17:10 UTC (permalink / raw)
  To: Nick Piggin; +Cc: akpm, davem, tony.luck, benh, ak, linux-kernel

Here's the recut of those patches, including David Miller's vital fixes.
I'm addressing these to Nick rather than Andrew, because they're perhaps
not fit for -mm until more testing done and the x86_64 32-bit vdso issue
handled.  I'm unlikely to be responsive until next week, sorry: over to
you, Nick - thanks.

Hugh

 arch/i386/mm/hugetlbpage.c    |   11 --
 arch/i386/mm/pgtable.c        |    2 
 arch/ia64/mm/hugetlbpage.c    |   60 ++++---------
 arch/ppc64/mm/hugetlbpage.c   |   47 ----------
 include/asm-generic/pgtable.h |    8 -
 include/asm-ia64/page.h       |    2 
 include/asm-ia64/pgtable.h    |   30 ------
 include/asm-ia64/processor.h  |    8 -
 include/asm-ppc64/pgtable.h   |   12 +-
 include/asm-ppc64/processor.h |    4 
 include/asm-s390/processor.h  |    2 
 include/asm-sparc64/pgtable.h |   15 ---
 include/linux/hugetlb.h       |    6 -
 include/linux/mm.h            |   14 +--
 mm/memory.c                   |  190 ++++++++++++++++++++++++++++++------------
 mm/mmap.c                     |  139 ++++++++----------------------
 16 files changed, 226 insertions(+), 324 deletions(-)

^ permalink raw reply	[flat|nested] 49+ messages in thread
* RE: [PATCH 1/6] freepgt: free_pgtables use vma list
@ 2005-03-23 19:16 Luck, Tony
  2005-03-23 19:19 ` David S. Miller
  2005-03-23 22:07 ` Paul Mackerras
  0 siblings, 2 replies; 49+ messages in thread
From: Luck, Tony @ 2005-03-23 19:16 UTC (permalink / raw)
  To: Hugh Dickins, Nick Piggin; +Cc: akpm, davem, benh, ak, linux-kernel

+	 * Why all these "- 1"s?  Because 0 represents both the bottom
+	 * of the address space and the top of it (using -1 for the
+	 * top wouldn't help much: the masks would do the wrong thing).
+	 * The rule is that addr 0 and floor 0 refer to the bottom of
+	 * the address space, but end 0 and ceiling 0 refer to the top
+	 * Comparisons need to use "end - 1" and "ceiling - 1" (though
+	 * that end 0 case should be mythical).

Can we legislate that "end==0" isn't possible.  On ia64 this is
certainly true (user virtual space is confined to regions 0-4, so
the max value of end is 0xa000000000000000[*]).  Same applies on x86
where the max user address is 0xc0000000 (assuming a standard 3G/1G
split, and ignoring the 4G-4G patch).  What do the other architectures
do?  Does anyone allow:
	mmap((void *)-PAGE_SIZE, PAGE_SIZE, MAP_FIXED, ...)
to succeed?

Otherwise throw in some extra macros to hide the computation needed
to make the masks work on ceiling values that represent the last byte
of the vma rather than the address beyond.  Presumably we can use a
few cycles on some extra arithmetic to help us save gazillions of
cycles for all the cache misses that we currently expend traversing
empty areas of page tables at each level.

Latest patches run on ia64 ... I did at least throw a fork-tester at
it to make sure that we aren't leaking pagetables ... it is still
running after a few million forks, so the simple cases are not doing
anything completely bogus.

-Tony

[*] Since a three level page table doesn't give us enough bits, the
actual limit (with a 16k page size) is 0x8000100000000000 with a hole
for the rest of region 4).


^ permalink raw reply	[flat|nested] 49+ messages in thread
* RE: [PATCH 1/6] freepgt: free_pgtables use vma list
@ 2005-03-30 18:23 Luck, Tony
  0 siblings, 0 replies; 49+ messages in thread
From: Luck, Tony @ 2005-03-30 18:23 UTC (permalink / raw)
  To: Hugh Dickins, David S. Miller; +Cc: nickpiggin, akpm, benh, ak, linux-kernel

>Though my knowledge of out-of-tree patches is very limited,
>I believe "end == 0" is not possible on any arch - when "end"
>originates from vma->vm_end (or vm_struct->addr + size).  There
>are plenty of "BUG_ON(addr >= end)"s dotted around to support that,
>and other places that would be confused by vm_start > vm_end.
>
>(And when Linus first proposed the sysenter page at 0xfffff000,
>I protested, and he brought it down to 0xffffe000: I think we'll
>do well ever to keep that last virtual page invalid.)

IS_ERR(ptr) and PTR_ERR(ptr) would also yield some interesting bizarre
errors if the last page (last 1000 bytes in the current implementation
of IS_ERR) were valid!

>But certainly "ceiling == 0" is possible and common, and "rounded-up
>end" may well be 0 with out-of-tree patches.  When I did those
>free_pgtables tests, it seemed simpler to treat "end" in the same
>way as "ceiling", implicitly allowing it the 0 case.  Perhaps
>that's not so in Nick's version, I've yet to think through it.

Yes ... rounding 'end' up to pmd/pud/pgd boundaries can certainly
wrap around to zero ... giving up the last page of address space
seems reasonable.  Giving up the last PGD_SIZE just to make some
math a bit easier sounds like overkill.

-Tony

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2005-03-31 10:57 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 6/6] freepgt: hugetlb area is clean Hugh Dickins
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
  -- strict thread matches above, loose matches on Subject: below --
2005-03-23 19:16 [PATCH 1/6] freepgt: free_pgtables use vma list Luck, Tony
2005-03-23 19:19 ` David S. Miller
2005-03-29 20:50   ` Hugh Dickins
2005-03-23 22:07 ` Paul Mackerras
2005-03-23 22:19   ` Andreas Schwab
2005-03-30 18:23 Luck, Tony

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.