linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pgcl-2.6.0-test5-bk3-17
@ 2003-11-28  4:15 William Lee Irwin III
  2003-11-28  7:21 ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  0 siblings, 1 reply; 13+ messages in thread
From: William Lee Irwin III @ 2003-11-28  4:15 UTC (permalink / raw)
  To: linux-kernel

This is a forward port of Hugh Dickins' patch to implement ABI-
preserving large software PAGE_SIZE support, effectively "large VM
blocksize". It's also been called "subpages". "pgcl" is an abbreviation
for "page clustering", after the historical but different BSD notion.

This is meant to make memory management more efficient by reducing the
number of objects to manage, as well as establishing more physical
contiguity of memory by keeping it pieces larger than what individual
ptes map. This very noticeably reduces the space requirements for
mem_map[]. I hope to eventually demonstrate further advantages like
larger fs blocksize support and reduced sglist length requirements.

This release features a rewrite of all the fault handling logic, done
to incorporate a forward port of hugh's original fault handlers. This
should perform much better than prior releases as they efficiently
implement COW unsharing's trivial case and have bounded search overhead,
though there is clearly a lot of room for further optimization.

Tested for basic userspace functionality on a 256MB Thinkpad T21 and a
32GB NUMA-Q with 32KB PAGE_SIZE. It does break when you push it, though
it does run init scripts, most programs, and some benchmarks here.

Available from:
ftp://ftp.kernel.org/pub/linux/kernel/people/wli/vm/pgcl/

Incremental patches for all stages of the rewrite as well as cumulative
diffs vs. 2.6.0-test5-bk3 and 2.6.0-test5 are also available there.

Errata:
(1) the CONFIG_PAGE_CLUSTER==0/PAGE_MMUCOUNT==1 case is nonfunctional
(2) some oopsen zwane found while running KDE
(3) some mysterious preempt imbalance(s)
(4) drivers and fs's are essentially totally unaudited, probably broken
(5) non-i386 are all broken
(6) CONFIG_DEBUG_HIGHMEM is nonfunctional
(7) CONFIG_DEBUG_PAGEALLOC is nonfunctional
(8) many, many more

TODO:
(1) merge to current
(2) sweep drivers/fs's
(3) optimize and rework kmap_atomic_sg() API to not impact CONFIG_NOHIGHMEM
(4) clean up potentially-removable code impacts (e.g. debug code)
(5) rework pagetable allocation
(6) rework/optimize rmap interaction
(7) rework TLB invalidations
(8) fix all bugs (as usual)
(9) eventually play with ia64's 32-bit emulation


-- wli

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-28  4:15 pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-11-28  7:21 ` William Lee Irwin III
  2003-11-28 23:51   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-11-28  7:21 UTC (permalink / raw)
  To: linux-kernel

On Thu, Nov 27, 2003 at 08:15:58PM -0800, William Lee Irwin III wrote:
> This is a forward port of Hugh Dickins' patch to implement ABI-
> preserving large software PAGE_SIZE support, effectively "large VM
> blocksize". It's also been called "subpages". "pgcl" is an abbreviation
> for "page clustering", after the historical but different BSD notion.

Now also ported to 2.6.0-test11:
ftp://ftp.kernel.org/pub/linux/kernel/people/wli/vm/pgcl/pgcl-2.6.0-test11-1.gz

This also corrects some PAGE_SHIFT instances that crept into mm/mmap.c
while I wasn't looking and drops sym2 driver changes.


-- wli

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-28  7:21 ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-11-28 23:51   ` William Lee Irwin III
  2003-11-30  1:12   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-11-30 16:43   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2 siblings, 0 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-11-28 23:51 UTC (permalink / raw)
  To: linux-kernel

On Thu, Nov 27, 2003 at 08:15:58PM -0800, William Lee Irwin III wrote:
>> This is a forward port of Hugh Dickins' patch to implement ABI-
>> preserving large software PAGE_SIZE support, effectively "large VM
>> blocksize". It's also been called "subpages". "pgcl" is an abbreviation
>> for "page clustering", after the historical but different BSD notion.

On Thu, Nov 27, 2003 at 11:21:48PM -0800, William Lee Irwin III wrote:
> Now also ported to 2.6.0-test11:
> ftp://ftp.kernel.org/pub/linux/kernel/people/wli/vm/pgcl/pgcl-2.6.0-test11-1.gz
> This also corrects some PAGE_SHIFT instances that crept into mm/mmap.c
> while I wasn't looking and drops sym2 driver changes.

Looks like I missed the update to the Committed_AS accounting in exec.c
during the conversion. The reduced granularity on RLIMIT_STACK, stack
fault alignment,  and the argument size Committed_AS accounting bothers
me. I should teach copy_folio() etc. to cope with unaligned pages, but
there appears to be some pain wrt. how far and wide to hunt for ptes
(i.e. this requires some design effort).

I do the swap bits a bit differently from the original, so the
swapfile accounting needs a unit conversion.

This also arranges for pr_debug()-based logging of Committed_AS
accounting, which is useful while this thing is still prototypical in
nature, but will eventually get removed for "production" patch posting
along with several other things of a similar nature.


-- wli


diff -prauN pgcl-2.6.0-test11-1/fs/exec.c pgcl-2.6.0-test11-2/fs/exec.c
--- pgcl-2.6.0-test11-1/fs/exec.c	2003-11-27 21:55:19.000000000 -0800
+++ pgcl-2.6.0-test11-2/fs/exec.c	2003-11-28 15:25:51.000000000 -0800
@@ -417,7 +417,7 @@ int setup_arg_pages(struct linux_binprm 
 #else
 	stack_base = STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE;
 	mm->arg_start = bprm->p + stack_base;
-	arg_size = STACK_TOP - (MMUPAGE_MASK & (unsigned long) mm->arg_start);
+	arg_size = STACK_TOP - (PAGE_MASK & (unsigned long) mm->arg_start);
 #endif
 
 	bprm->p += stack_base;
diff -prauN pgcl-2.6.0-test11-1/include/linux/mman.h pgcl-2.6.0-test11-2/include/linux/mman.h
--- pgcl-2.6.0-test11-1/include/linux/mman.h	2003-11-26 12:43:05.000000000 -0800
+++ pgcl-2.6.0-test11-2/include/linux/mman.h	2003-11-28 15:26:08.000000000 -0800
@@ -14,18 +14,42 @@ extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
 extern atomic_t vm_committed_space;
 
+#define vm_acct_memory(pages)						\
+do {									\
+	long __pages__ = (pages);					\
+	pr_debug("%d: vm_acct_memory(%ld) in %s at %s:%d\n",		\
+		current->pid,						\
+		__pages__,						\
+		__FUNCTION__,						\
+		__FILE__,						\
+		__LINE__);						\
+	__vm_acct_memory(__pages__);					\
+} while (0)
+
+#define vm_unacct_memory(pages)						\
+do {									\
+	long __pages__ = (pages);					\
+	pr_debug("%d: vm_unacct_memory(%ld) in %s at %s:%d\n",		\
+		current->pid,						\
+		__pages__,						\
+		__FUNCTION__,						\
+		__FILE__,						\
+		__LINE__);						\
+	__vm_unacct_memory(__pages__);					\
+} while (0)
+
 #ifdef CONFIG_SMP
-extern void vm_acct_memory(long pages);
+void __vm_acct_memory(long pages);
 #else
-static inline void vm_acct_memory(long pages)
+static inline void __vm_acct_memory(long pages)
 {
 	atomic_add(pages, &vm_committed_space);
 }
 #endif
 
-static inline void vm_unacct_memory(long pages)
+static inline void __vm_unacct_memory(long pages)
 {
-	vm_acct_memory(-pages);
+	__vm_acct_memory(-pages);
 }
 
 /*
diff -prauN pgcl-2.6.0-test11-1/include/linux/security.h pgcl-2.6.0-test11-2/include/linux/security.h
--- pgcl-2.6.0-test11-1/include/linux/security.h	2003-11-26 12:44:57.000000000 -0800
+++ pgcl-2.6.0-test11-2/include/linux/security.h	2003-11-28 15:26:01.000000000 -0800
@@ -84,6 +84,18 @@ struct nfsctl_arg;
 struct sched_param;
 struct swap_info_struct;
 
+#define security_vm_enough_memory(pages)				\
+({									\
+	long __pages__ = (pages);					\
+	pr_debug("%d: vm_enough_memory(%ld) in %s at %s:%d\n",		\
+		current->pid,						\
+		__pages__,						\
+		__FUNCTION__,						\
+		__FILE__,						\
+		__LINE__);						\
+	__security_vm_enough_memory(__pages__);				\
+})
+
 #ifdef CONFIG_SECURITY
 
 /**
@@ -1245,7 +1257,7 @@ static inline int security_syslog(int ty
 	return security_ops->syslog(type);
 }
 
-static inline int security_vm_enough_memory(long pages)
+static inline int __security_vm_enough_memory(long pages)
 {
 	return security_ops->vm_enough_memory(pages);
 }
@@ -1911,7 +1923,7 @@ static inline int security_syslog(int ty
 	return cap_syslog(type);
 }
 
-static inline int security_vm_enough_memory(long pages)
+static inline int __security_vm_enough_memory(long pages)
 {
 	return cap_vm_enough_memory(pages);
 }
diff -prauN pgcl-2.6.0-test11-1/mm/swap.c pgcl-2.6.0-test11-2/mm/swap.c
--- pgcl-2.6.0-test11-1/mm/swap.c	2003-11-27 21:55:21.000000000 -0800
+++ pgcl-2.6.0-test11-2/mm/swap.c	2003-11-28 14:14:50.000000000 -0800
@@ -367,7 +367,7 @@ unsigned int pagevec_lookup(struct pagev
 
 static DEFINE_PER_CPU(long, committed_space) = 0;
 
-void vm_acct_memory(long pages)
+void __vm_acct_memory(long pages)
 {
 	long *local;
 
@@ -380,7 +380,7 @@ void vm_acct_memory(long pages)
 	}
 	preempt_enable();
 }
-EXPORT_SYMBOL(vm_acct_memory);
+EXPORT_SYMBOL(__vm_acct_memory);
 #endif
 
 #ifdef CONFIG_SMP
diff -prauN pgcl-2.6.0-test11-1/mm/swapfile.c pgcl-2.6.0-test11-2/mm/swapfile.c
--- pgcl-2.6.0-test11-1/mm/swapfile.c	2003-11-27 21:55:21.000000000 -0800
+++ pgcl-2.6.0-test11-2/mm/swapfile.c	2003-11-28 01:23:45.000000000 -0800
@@ -1151,8 +1151,8 @@ asmlinkage long sys_swapoff(const char _
 		swap_list_unlock();
 		goto out_dput;
 	}
-	if (!security_vm_enough_memory(p->pages))
-		vm_unacct_memory(p->pages);
+	if (!security_vm_enough_memory(PAGE_MMUCOUNT*p->pages))
+		vm_unacct_memory(PAGE_MMUCOUNT*p->pages);
 	else {
 		err = -ENOMEM;
 		swap_list_unlock();

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-28  7:21 ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-11-28 23:51   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-11-30  1:12   ` William Lee Irwin III
  2003-11-30 16:43   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2 siblings, 0 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-11-30  1:12 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 7002 bytes --]

On Thu, Nov 27, 2003 at 11:21:48PM -0800, William Lee Irwin III wrote:
> Now also ported to 2.6.0-test11:
> ftp://ftp.kernel.org/pub/linux/kernel/people/wli/vm/pgcl/pgcl-2.6.0-test11-1.gz
> This also corrects some PAGE_SHIFT instances that crept into mm/mmap.c
> while I wasn't looking and drops sym2 driver changes.

Quick performance and functionality test on a 32x/64GB 700MHz P-III.
Compressed dmesg attached. Not sure where the SCSI error came from.

This seems to show that reworking the rmap interaction is a pressing
performance issue (however pressing kernel compiles can be considered
to be, never mind all the actual bugs) since the rmap functions are
burning more cpu time than bitblitting luserspace. Unfortunately there
isn't really enough disk for on-disk dbench etc. so I resorted to ramfs,
whose readdir() etc. methods appear not to be very well parallelized. I
should probably have tried ext2 on loop on ramfs or some such nonsense.

The good news is that it does still run on the thing even after all of
the massive shakeups, rewrites, and time since my last boot on it in May.


Kernel compile on ext2:

$ time make -s -j bzImage > /dev/null
arch/i386/boot/setup.S: Assembler messages:
arch/i386/boot/setup.S:168: Warning: value 0x77dfffff truncated to 0x77dfffff
Root device is (8, 2)
Boot sector 512 bytes.
Setup is 2538 bytes.
System is 1117 kB
make -s -j bzImage > /dev/null  712.96s user 284.86s system 1140% cpu 1:27.46 total

6094329 total                                      3.8079
5787061 default_idle                             90422.8281
 85912 __page_remove_rmap                       298.3056
 38331 page_remove_rmap                         140.9228
 28287 copy_folio                                88.3969
 19051 page_add_rmap                             79.3792
 14709 __copy_to_user_ll                        131.3304
  7078 __copy_user_intel                         40.2159
  6901 __copy_from_user_ll                       61.6161
  5704 __page_add_rmap                           22.2812
  4710 __d_lookup                                17.3162
  4259 zap_pte_range                              3.6464
  4127 schedule                                   2.5288
  3940 rmap_add_folio                            14.4853
  3852 kmap_atomic                                8.0250
  3258 kmem_cache_free                           33.9375
  3053 clear_page_tables                          3.3476
  2079 try_to_wake_up                             4.0605
  2012 find_get_page                             31.4375
  1815 current_kernel_time                       22.6875
  1638 kmap_atomic_sg                             4.0950
  1627 path_lookup                                4.6222


dbench on ramfs:

$ time dbench 32 
32 clients started
   0     62477  296.11 MB/sec
Throughput 296.11 MB/sec 32 procs
dbench 32  20.60s user 989.43s system 2674% cpu 37.767 total

2328901 total                                      1.4552
1335226 default_idle                             20862.9062
415966 .text.lock.libfs                         2298.1547
168210 .text.lock.dec_and_lock                  15291.8182
157310 .text.lock.dcache                        291.3148
 70329 dcache_readdir                           146.5188
 23983 atomic_dec_and_lock                      347.5797
 21502 __copy_to_user_ll                        191.9821
 18555 .text.lock.file_table                    157.2458
 16183 __copy_from_user_ll                      144.4911
 11169 d_alloc                                   23.2688
 11055 filldir64                                 40.6434
  6661 d_instantiate                             69.3854
  5826 __d_lookup                                21.4191
  5405 path_lookup                               15.3551
  4545 path_release                              71.0156
  3728 file_move                                 58.2500
  3537 d_delete                                  18.4219
  3336 fd_install                                52.1250
  3220 simple_prepare_write                      20.1250
  3081 call_rcu                                  48.1406
  2704 vfs_readdir                               21.1250


SDET 32 profile:

4605683 total                                      2.8778
3480214 default_idle                             54378.3438
212021 page_remove_rmap                         779.4890
163508 __page_remove_rmap                       567.7361
 98710 page_add_rmap                            411.2917
 87944 copy_folio                               274.8250
 31101 __page_add_rmap                          121.4883
 20883 simple_prepare_write                     130.5188
 19818 copy_page_range                           15.6788
 18555 .text.lock.dcache                         34.3611
 18277 zap_pte_range                             15.6481
 17973 rmap_add_folio                            66.0772
 17932 .text.lock.dec_and_lock                  1630.1818
 17816 __d_lookup                                65.5000
 17680 __down                                    78.9286
 16517 __copy_to_user_ll                        147.4732
 11960 atomic_dec_and_lock                      173.3333
 11795 release_pages                             36.8594
 11256 kmap_atomic                               23.4500
  9696 kmem_cache_free                          101.0000
  9622 copy_mm                                    9.5456
  9371 .text.lock.libfs                          51.7735


SDET 128 profile:

19885416 total                                     12.4250
10870694 default_idle                             169854.5938
1868923 page_remove_rmap                         6871.0404
1722495 __page_remove_rmap                       5980.8854
991381 page_add_rmap                            4130.7542
619755 __down                                   2766.7634
403192 copy_folio                               1259.9750
172220 __page_add_rmap                          672.7344
164246 rmap_add_folio                           603.8456
161239 __wake_up                                2015.4875
123047 __d_lookup                               452.3787
121684 schedule                                  74.5613
120902 zap_pte_range                            103.5120
101418 __copy_to_user_ll                        905.5179
 99572 copy_page_range                           78.7753
 95709 simple_prepare_write                     598.1812
 76676 atomic_dec_and_lock                      1111.2464
 66245 remove_shared_vm_struct                  517.5391
 64159 path_lookup                              182.2699
 61922 release_pages                            193.5062
 61415 copy_mm                                   60.9276
 61356 clear_page_tables                         67.2763


I could probably use suggestions for a more mergeable method of
mitigating the rmap functions' overheads than the currently
available mm/rmap.c rewrites.

In more relevant news, I've started taking stabs at the rvmalloc()
mess and drm, with copious help from Zwane.


-- wli

[-- Attachment #2: 64G.pgcl.test11.log.gz --]
[-- Type: application/octet-stream, Size: 9842 bytes --]

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-28  7:21 ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-11-28 23:51   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-11-30  1:12   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-11-30 16:43   ` William Lee Irwin III
  2003-11-30 18:46     ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
                       ` (2 more replies)
  2 siblings, 3 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-11-30 16:43 UTC (permalink / raw)
  To: linux-kernel

On Thu, Nov 27, 2003 at 11:21:48PM -0800, William Lee Irwin III wrote:
> Now also ported to 2.6.0-test11:
> ftp://ftp.kernel.org/pub/linux/kernel/people/wli/vm/pgcl/pgcl-2.6.0-test11-1.gz
> This also corrects some PAGE_SHIFT instances that crept into mm/mmap.c
> while I wasn't looking and drops sym2 driver changes.

I wonder if this would be enough to get sysenter support going again.
I've not got a sysenter-capable userspace around, so I can't really
test this myself.

vs. pgcl-2.6.0-test11-5


-- wli


diff -prauN pgcl-2.6.0-test11-5/include/asm-i386/elf.h pgcl-2.6.0-test11-6/include/asm-i386/elf.h
--- pgcl-2.6.0-test11-5/include/asm-i386/elf.h	2003-11-27 21:55:19.000000000 -0800
+++ pgcl-2.6.0-test11-6/include/asm-i386/elf.h	2003-11-30 07:34:34.000000000 -0800
@@ -132,17 +132,11 @@ extern int dump_task_extended_fpu (struc
 #define VSYSCALL_ENTRY	((unsigned long) &__kernel_vsyscall)
 extern void __kernel_vsyscall;
 
-/*
- * Something in pgcl broke vsyscalls. Until that's tracked down,
- * work around it with this:
- */
-#if 0
 #define ARCH_DLINFO						\
 do {								\
 		NEW_AUX_ENT(AT_SYSINFO,	VSYSCALL_ENTRY);	\
 		NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE);	\
 } while (0)
-#endif /* 0 */
 
 /*
  * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
@@ -152,7 +146,6 @@ do {								\
  * Dumping its extra ELF program headers includes all the other information
  * a debugger needs to easily find how the vsyscall DSO was being used.
  */
-#if 0
 #define ELF_CORE_EXTRA_PHDRS		(VSYSCALL_EHDR->e_phnum)
 #define ELF_CORE_WRITE_EXTRA_PHDRS					      \
 do {									      \
@@ -166,7 +159,7 @@ do {									      \
 		if (phdr.p_type == PT_LOAD) {				      \
 			BUG_ON(ofs != 0);				      \
 			ofs = phdr.p_offset = offset;			      \
-			phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz);	      \
+			phdr.p_memsz = MMUPAGE_ALIGN(phdr.p_memsz);	      \
 			phdr.p_filesz = phdr.p_memsz;			      \
 			offset += phdr.p_filesz;			      \
 		}							      \
@@ -185,10 +178,9 @@ do {									      \
 	for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) {			      \
 		if (vsyscall_phdrs[i].p_type == PT_LOAD)		      \
 			DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr,	      \
-				   PAGE_ALIGN(vsyscall_phdrs[i].p_memsz));    \
+				   MMUPAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \
 	}								      \
 } while (0)
-#endif /* 0 */
 
 #endif /* __KERNEL__ */
 
diff -prauN pgcl-2.6.0-test11-5/include/asm-i386/fixmap.h pgcl-2.6.0-test11-6/include/asm-i386/fixmap.h
--- pgcl-2.6.0-test11-5/include/asm-i386/fixmap.h	2003-11-27 21:55:19.000000000 -0800
+++ pgcl-2.6.0-test11-6/include/asm-i386/fixmap.h	2003-11-30 06:39:57.000000000 -0800
@@ -21,6 +21,11 @@
 #ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
+#ifdef CONFIG_HIGHMEM4G
+#include <asm/pgtable-2level.h>
+#else
+#include <asm/pgtable-3level.h>
+#endif
 #endif
 
 /*
@@ -49,6 +54,7 @@
 #define PKMAP_ADDR(nr)  (PKMAP_BASE + ((nr) << PAGE_SHIFT))
 #define LAST_PKMAP	1024
 #define LAST_PKMAP_MASK	(LAST_PKMAP-1)
+#define PKMAP_MASK	(~((1 << PMD_SHIFT) - 1))
 
 /*
  * FIXADDR stuff is used by highmem.c for kmapping, and various
@@ -62,7 +68,7 @@
  * and I didn't care enough to conserve PAGE_SIZE - MMUPAGE_SIZE
  * worth of virtualspace.
  */
-#define FIXADDR_TOP	(-PAGE_SIZE)
+#define FIXADDR_TOP	(-MMUPAGE_SIZE)
 #define __FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << MMUPAGE_SHIFT)
 #define FIXADDR_START	(FIXADDR_TOP - __FIXADDR_SIZE)
 
@@ -70,13 +76,8 @@
 #define __virt_to_fix(x)	((FIXADDR_TOP - ((x) & MMUPAGE_MASK)) >> MMUPAGE_SHIFT)
 
 enum fixed_addresses {
-#ifdef CONFIG_HIGHMEM
 	/* reserved pte's for temporary kernel mappings */
-	FIX_KMAP_BEGIN = 1,
-	FIX_KMAP_END = FIX_KMAP_BEGIN+((KM_TYPE_NR*NR_CPUS+1)*PAGE_MMUCOUNT)-1,
-	FIX_PKMAP_BEGIN,
-	FIX_PKMAP_END = FIX_PKMAP_BEGIN + (LAST_PKMAP+1)*PAGE_MMUCOUNT - 1,
-#endif
+	FIX_HOLE,
 	FIX_VSYSCALL,
 #ifdef CONFIG_X86_LOCAL_APIC
 	FIX_APIC_BASE,	/* local (CPU) APIC) -- required for SMP or not */
@@ -107,6 +108,12 @@ enum fixed_addresses {
 	FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
 	FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
 	FIX_WP_TEST,
+#ifdef CONFIG_HIGHMEM
+	FIX_KMAP_BEGIN = __virt_to_fix(__fix_to_virt(FIX_WP_TEST+1) & PAGE_MASK) - PAGE_MMUCOUNT + 1,
+	FIX_KMAP_END = FIX_KMAP_BEGIN+((KM_TYPE_NR*NR_CPUS+1)*PAGE_MMUCOUNT)-1,
+	FIX_PKMAP_BEGIN = __virt_to_fix(__fix_to_virt(FIX_KMAP_END+1) & PKMAP_MASK) - PAGE_MMUCOUNT + 1,
+	FIX_PKMAP_END = FIX_PKMAP_BEGIN + (LAST_PKMAP+1)*PAGE_MMUCOUNT - 1,
+#endif
 	__end_of_fixed_addresses
 };
 
@@ -129,7 +136,7 @@ extern void __set_fixmap (enum fixed_add
  * acting like user mode such as get_user_pages.
  */
 #define FIXADDR_USER_START	(__fix_to_virt(FIX_VSYSCALL))
-#define FIXADDR_USER_END	(FIXADDR_USER_START + PAGE_SIZE)
+#define FIXADDR_USER_END	(FIXADDR_USER_START + MMUPAGE_SIZE)
 
 
 extern void __this_fixmap_does_not_exist(void);

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-30 16:43   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-11-30 18:46     ` Zwane Mwaikambo
  2003-11-30 18:50       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-12-01  7:36     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-12-01 16:46     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2 siblings, 1 reply; 13+ messages in thread
From: Zwane Mwaikambo @ 2003-11-30 18:46 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-kernel

On Sun, 30 Nov 2003, William Lee Irwin III wrote:

> On Thu, Nov 27, 2003 at 11:21:48PM -0800, William Lee Irwin III wrote:
> > Now also ported to 2.6.0-test11:
> > ftp://ftp.kernel.org/pub/linux/kernel/people/wli/vm/pgcl/pgcl-2.6.0-test11-1.gz
> > This also corrects some PAGE_SHIFT instances that crept into mm/mmap.c
> > while I wasn't looking and drops sym2 driver changes.
>
> I wonder if this would be enough to get sysenter support going again.
> I've not got a sysenter-capable userspace around, so I can't really
> test this myself.
>
> vs. pgcl-2.6.0-test11-5

Brilliant!

Linux arusha.mastecende.com 2.6.0-test11-pgcl #4 SMP Sun Nov 30 13:30:51 EST 2003 i686 i686 i386 GNU/Linux

tcsh          S C0155C8D     0  1132   1131                     (NOTLB)
def85e60 00000086 def8b29c c0155c8d def85e44 def85e9c c060b940 c013010f
       0001c1ec 00000000 c1143640 00008734 ff21d58e 00000019 dea41fd0 0000000e
       fff24fc0 00000008 7fffffff c1657d7c de7f9000 c0131035 dc21bfcc c1119338
Call Trace:
 [<c0155c8d>] private_folio_page+0x1d/0x2c0
 [<c013010f>] __mod_timer+0x10f/0x360
 [<c0131035>] schedule_timeout+0xb5/0xc0
 [<c032cc53>] read_chan+0x2b3/0xc50
 [<c011d1f1>] do_page_fault+0x5b1/0x871
 [<c0121830>] default_wake_function+0x0/0x20
 [<c032dfc1>] set_termios+0x111/0x180
 [<c0121830>] default_wake_function+0x0/0x20
 [<c0326c3b>] tty_read+0x15b/0x1a0
 [<c0326ae0>] tty_read+0x0/0x1a0
 [<c0326ae0>] tty_read+0x0/0x1a0
 [<c016ac9c>] vfs_read+0xac/0xf0
 [<c016aead>] sys_read+0x2d/0x50
 [<c0109719>] sysenter_past_esp+0x52/0x79

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-30 18:46     ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
@ 2003-11-30 18:50       ` William Lee Irwin III
  0 siblings, 0 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-11-30 18:50 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: linux-kernel

On Sun, Nov 30, 2003 at 01:46:24PM -0500, Zwane Mwaikambo wrote:
> Brilliant!
> Linux arusha.mastecende.com 2.6.0-test11-pgcl #4 SMP Sun Nov 30 13:30:51 EST 2003 i686 i686 i386 GNU/Linux
> tcsh          S C0155C8D     0  1132   1131                     (NOTLB)
> def85e60 00000086 def8b29c c0155c8d def85e44 def85e9c c060b940 c013010f
>        0001c1ec 00000000 c1143640 00008734 ff21d58e 00000019 dea41fd0 0000000e
>        fff24fc0 00000008 7fffffff c1657d7c de7f9000 c0131035 dc21bfcc c1119338
> Call Trace:
[...]
>  [<c0121830>] default_wake_function+0x0/0x20
>  [<c032dfc1>] set_termios+0x111/0x180
>  [<c0121830>] default_wake_function+0x0/0x20
>  [<c0326c3b>] tty_read+0x15b/0x1a0
>  [<c0326ae0>] tty_read+0x0/0x1a0
>  [<c0326ae0>] tty_read+0x0/0x1a0
>  [<c016ac9c>] vfs_read+0xac/0xf0
>  [<c016aead>] sys_read+0x2d/0x50
>  [<c0109719>] sysenter_past_esp+0x52/0x79

I'll call this pgcl-2.6.0-test11-6, then.

-- wli

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-30 16:43   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-11-30 18:46     ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
@ 2003-12-01  7:36     ` William Lee Irwin III
  2003-12-01  7:44       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-12-07  7:28       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-12-01 16:46     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2 siblings, 2 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-12-01  7:36 UTC (permalink / raw)
  To: linux-kernel

On Sun, Nov 30, 2003 at 08:43:01AM -0800, William Lee Irwin III wrote:
> I wonder if this would be enough to get sysenter support going again.
> I've not got a sysenter-capable userspace around, so I can't really
> test this myself.
> vs. pgcl-2.6.0-test11-5

Stack decoding fixes, shutting up some compiler warnings, and dumping
PAGE_SIZE and MMUPAGE_SIZE into /proc/meminfo (for lack of a better place).

The printk()'s down there should eventually get ripped out anyway for
minimal impact and a quieter boot, but until then...


-- wli



diff -prauN pgcl-2.6.0-test11-6/arch/i386/kernel/process.c pgcl-2.6.0-test11-7/arch/i386/kernel/process.c
--- pgcl-2.6.0-test11-6/arch/i386/kernel/process.c	2003-11-27 21:55:16.000000000 -0800
+++ pgcl-2.6.0-test11-7/arch/i386/kernel/process.c	2003-11-30 11:37:50.000000000 -0800
@@ -648,12 +648,12 @@ unsigned long get_wchan(struct task_stru
 		return 0;
 	stack_page = (unsigned long)p->thread_info;
 	esp = p->thread.esp;
-	if (!stack_page || esp < stack_page || esp > 8188+stack_page)
+	if (!stack_page || esp < stack_page || esp > THREAD_SIZE+stack_page-4)
 		return 0;
 	/* include/asm-i386/system.h:switch_to() pushes ebp last. */
 	ebp = *(unsigned long *) esp;
 	do {
-		if (ebp < stack_page || ebp > 8184+stack_page)
+		if (ebp < stack_page || ebp > THREAD_SIZE + stack_page - 8)
 			return 0;
 		eip = *(unsigned long *) (ebp+4);
 		if (eip < first_sched || eip >= last_sched)
diff -prauN pgcl-2.6.0-test11-6/arch/i386/mm/discontig.c pgcl-2.6.0-test11-7/arch/i386/mm/discontig.c
--- pgcl-2.6.0-test11-6/arch/i386/mm/discontig.c	2003-11-27 22:02:41.000000000 -0800
+++ pgcl-2.6.0-test11-7/arch/i386/mm/discontig.c	2003-11-30 12:46:50.000000000 -0800
@@ -268,10 +268,10 @@ unsigned long __init setup_memory(void)
 	for (nid = 0; nid < numnodes; nid++)
 		find_max_pfn_node(nid);
 	printk("vmallocspace = [0x%lx, 0x%lx)\n",
-			VMALLOC_START, VMALLOC_END);
+			(unsigned long)VMALLOC_START, (unsigned long)VMALLOC_END);
 	printk("fixmapspace = [0x%lx, 0x%lx)\n",
-			FIXADDR_START, FIXADDR_TOP);
-	printk("MAXMEM = 0x%lx\n", MAXMEM);
+			(unsigned long)FIXADDR_START, (unsigned long)FIXADDR_TOP);
+	printk("MAXMEM = 0x%lx\n", (unsigned long)MAXMEM);
 	for (nid = 0; nid < numnodes; ++nid)
 		printk("node %d at pfns [0x%lx, 0x%lx)\n",
 				nid, node_start_pfn[nid], node_end_pfn[nid]);
diff -prauN pgcl-2.6.0-test11-6/arch/i386/mm/init.c pgcl-2.6.0-test11-7/arch/i386/mm/init.c
--- pgcl-2.6.0-test11-6/arch/i386/mm/init.c	2003-11-27 22:10:55.000000000 -0800
+++ pgcl-2.6.0-test11-7/arch/i386/mm/init.c	2003-11-30 12:45:48.000000000 -0800
@@ -514,24 +514,24 @@ void __init mem_init(void)
 	       );
 	printk("MAXMEM=0x%lx\n", MAXMEM);
 	printk("vmalloc: start = 0x%lx, end = 0x%lx\n",
-			VMALLOC_START, VMALLOC_END);
+			(unsigned long)VMALLOC_START, (unsigned long)VMALLOC_END);
 	printk("fixaddr: start = 0x%lx, end = 0x%lx\n",
-			FIXADDR_START, FIXADDR_TOP);
+			(unsigned long)FIXADDR_START, (unsigned long)FIXADDR_TOP);
 
 #ifdef CONFIG_HIGHMEM
-	printk("FIX_KMAP_END == %lx\n", __fix_to_virt(FIX_KMAP_END));
+	printk("FIX_KMAP_END == %lx\n", (unsigned long)__fix_to_virt(FIX_KMAP_END));
 	if (__fix_to_virt(FIX_KMAP_END) % PAGE_SIZE)
 		printk(KERN_CRIT "kmap_atomic() area misaligned!\n");
 
-	printk("FIX_KMAP_BEGIN == %lx\n", __fix_to_virt(FIX_KMAP_BEGIN));
+	printk("FIX_KMAP_BEGIN == %lx\n", (unsigned long)__fix_to_virt(FIX_KMAP_BEGIN));
 	if ((__fix_to_virt(FIX_KMAP_BEGIN) + MMUPAGE_SIZE) % PAGE_SIZE)
 		printk(KERN_CRIT "kmap_atomic() area misaligned!\n");
 
-	printk("FIX_PKMAP_END == %lx\n", __fix_to_virt(FIX_PKMAP_END));
+	printk("FIX_PKMAP_END == %lx\n", (unsigned long)__fix_to_virt(FIX_PKMAP_END));
 	if (__fix_to_virt(FIX_PKMAP_END) % PAGE_SIZE)
 		printk(KERN_CRIT "kmap() area misaligned!\n");
 
-	printk("FIX_PKMAP_BEGIN == %lx\n", __fix_to_virt(FIX_PKMAP_BEGIN));
+	printk("FIX_PKMAP_BEGIN == %lx\n", (unsigned long)__fix_to_virt(FIX_PKMAP_BEGIN));
 	if ((__fix_to_virt(FIX_PKMAP_BEGIN) + MMUPAGE_SIZE) % PAGE_SIZE)
 		printk(KERN_CRIT "kmap() area misaligned!\n");
 #endif
diff -prauN pgcl-2.6.0-test11-6/fs/proc/proc_misc.c pgcl-2.6.0-test11-7/fs/proc/proc_misc.c
--- pgcl-2.6.0-test11-6/fs/proc/proc_misc.c	2003-11-27 21:55:19.000000000 -0800
+++ pgcl-2.6.0-test11-7/fs/proc/proc_misc.c	2003-11-30 12:50:32.000000000 -0800
@@ -206,7 +206,9 @@ static int meminfo_read_proc(char *page,
 		"PageTables:   %8lu kB\n"
 		"VmallocTotal: %8lu kB\n"
 		"VmallocUsed:  %8lu kB\n"
-		"VmallocChunk: %8lu kB\n",
+		"VmallocChunk: %8lu kB\n"
+		"PAGE_SIZE:    %8lu kB\n"
+		"MMUPAGE_SIZE: %8d kB\n",
 		K(i.totalram),
 		K(i.freeram),
 		K(i.bufferram),
@@ -228,7 +230,9 @@ static int meminfo_read_proc(char *page,
 		K(ps.nr_page_table_pages),
 		vmtot,
 		vmi.used,
-		vmi.largest_chunk
+		vmi.largest_chunk,
+		K(PAGE_SIZE),
+		K(MMUPAGE_SIZE)
 		);
 
 		len += hugetlb_report_meminfo(page + len);
diff -prauN pgcl-2.6.0-test11-6/include/asm-i386/processor.h pgcl-2.6.0-test11-7/include/asm-i386/processor.h
--- pgcl-2.6.0-test11-6/include/asm-i386/processor.h	2003-11-26 12:42:55.000000000 -0800
+++ pgcl-2.6.0-test11-7/include/asm-i386/processor.h	2003-11-30 11:41:11.000000000 -0800
@@ -495,8 +495,16 @@ extern unsigned long thread_saved_pc(str
 void show_trace(struct task_struct *task, unsigned long *stack);
 
 unsigned long get_wchan(struct task_struct *p);
-#define KSTK_EIP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
-#define KSTK_ESP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1022])
+
+#define THREAD_SIZE_LONGS	(THREAD_SIZE/sizeof(unsigned long))
+#define task_pt_regs(task)						\
+({									\
+	unsigned long *__ptr__ = (unsigned long *)(task)->thread_info;	\
+	(struct pt_regs *)(&__ptr__[THREAD_SIZE_LONGS-1]);		\
+})
+
+#define KSTK_EIP(task)	(task_pt_regs(task)->eip)
+#define KSTK_ESP(task)	(task_pt_regs(task)->esp)
 
 struct microcode_header {
 	unsigned int hdrver;

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-12-01  7:36     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-12-01  7:44       ` William Lee Irwin III
  2003-12-07  7:28       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  1 sibling, 0 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-12-01  7:44 UTC (permalink / raw)
  To: linux-kernel

On Sun, Nov 30, 2003 at 11:36:32PM -0800, William Lee Irwin III wrote:
> Stack decoding fixes, shutting up some compiler warnings, and dumping
> PAGE_SIZE and MMUPAGE_SIZE into /proc/meminfo (for lack of a better place).
> The printk()'s down there should eventually get ripped out anyway for
> minimal impact and a quieter boot, but until then...

This fixes some bad address calculations in arch/i386/mm/boot_ioremap.c


-- wli


diff -prauN pgcl-2.6.0-test11-7/arch/i386/mm/boot_ioremap.c pgcl-2.6.0-test11-8/arch/i386/mm/boot_ioremap.c
--- pgcl-2.6.0-test11-7/arch/i386/mm/boot_ioremap.c	2003-11-26 12:46:12.000000000 -0800
+++ pgcl-2.6.0-test11-8/arch/i386/mm/boot_ioremap.c	2003-11-30 13:07:00.000000000 -0800
@@ -31,7 +31,7 @@
 
 #define BOOT_PTE_PTRS (PTRS_PER_PTE*2)
 #define boot_pte_index(address) \
-	     (((address) >> PAGE_SHIFT) & (BOOT_PTE_PTRS - 1))
+	     (((address) >> MMUPAGE_SHIFT) & (BOOT_PTE_PTRS - 1))
 
 static inline boot_pte_t* boot_vaddr_to_pte(void *address)
 {
@@ -52,17 +52,17 @@ static void __boot_ioremap(unsigned long
 	char *vaddr = virtual_source;
 
 	pte = boot_vaddr_to_pte(virtual_source);
-	for (i=0; i < nrpages; i++, phys_addr += PAGE_SIZE, pte++) {
-		set_pte(pte, pfn_pte(phys_addr>>PAGE_SHIFT, PAGE_KERNEL));
-		__flush_tlb_one(&vaddr[i*PAGE_SIZE]);
+	for (i=0; i < nrpages; i++, phys_addr += MMUPAGE_SIZE, pte++) {
+		set_pte(pte, pfn_pte(phys_addr>>MMUPAGE_SHIFT, PAGE_KERNEL));
+		__flush_tlb_one(&vaddr[i*MMUPAGE_SIZE]);
 	}
 }
 
 /* the virtual space we're going to remap comes from this array */
 #define BOOT_IOREMAP_PAGES 4
-#define BOOT_IOREMAP_SIZE (BOOT_IOREMAP_PAGES*PAGE_SIZE)
+#define BOOT_IOREMAP_SIZE (BOOT_IOREMAP_PAGES*MMUPAGE_SIZE)
 __initdata char boot_ioremap_space[BOOT_IOREMAP_SIZE] 
-		__attribute__ ((aligned (PAGE_SIZE)));
+		__attribute__ ((aligned (MMUPAGE_SIZE)));
 
 /*
  * This only applies to things which need to ioremap before paging_init()
@@ -83,11 +83,11 @@ __init void* boot_ioremap(unsigned long 
 	last_addr = phys_addr + size - 1;
 
 	/* page align the requested address */
-	offset = phys_addr & ~PAGE_MASK;
-	phys_addr &= PAGE_MASK;
-	size = PAGE_ALIGN(last_addr) - phys_addr;
+	offset = phys_addr & ~MMUPAGE_MASK;
+	phys_addr &= MMUPAGE_MASK;
+	size = MMUPAGE_ALIGN(last_addr) - phys_addr;
 	
-	nrpages = size >> PAGE_SHIFT;
+	nrpages = size >> MMUPAGE_SHIFT;
 	if (nrpages > BOOT_IOREMAP_PAGES)
 		return NULL;
 	

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-11-30 16:43   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-11-30 18:46     ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
  2003-12-01  7:36     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-12-01 16:46     ` William Lee Irwin III
  2 siblings, 0 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-12-01 16:46 UTC (permalink / raw)
  To: linux-kernel

On Sun, Nov 30, 2003 at 08:43:01AM -0800, William Lee Irwin III wrote:
> @@ -107,6 +108,12 @@ enum fixed_addresses {
>  	FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
>  	FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
>  	FIX_WP_TEST,
> +#ifdef CONFIG_HIGHMEM
> +	FIX_KMAP_BEGIN = __virt_to_fix(__fix_to_virt(FIX_WP_TEST+1) & PAGE_MASK) - PAGE_MMUCOUNT + 1,
> +	FIX_KMAP_END = FIX_KMAP_BEGIN+((KM_TYPE_NR*NR_CPUS+1)*PAGE_MMUCOUNT)-1,
> +	FIX_PKMAP_BEGIN = __virt_to_fix(__fix_to_virt(FIX_KMAP_END+1) & PKMAP_MASK) - PAGE_MMUCOUNT + 1,
> +	FIX_PKMAP_END = FIX_PKMAP_BEGIN + (LAST_PKMAP+1)*PAGE_MMUCOUNT - 1,
> +#endif
>  	__end_of_fixed_addresses

BZZZT. kmap_atomic_to_pfn() et al all check vaddr < FIXADDR_START
and FIXADDR_START == __fix_to_virt(__end_of_permanent_fixed_addresses);
hence, plopping these guys down out by the FIX_BTMAP_*'s is bogus.
Worse yet, vmallocspace will overlap the bastards since we have
VMALLOC_END == FIXADDR_START - 2*MMUPAGE_SIZE.

Conservative and unnecessarily invasive fix (debug code and all) below.

I wonder if at some point I'll get buried under all the pr_debug()'s.
I guess it might give ppl an idea of exactly how much I've had to debug
over the course of all this, assuming anyone bothers looking. At any
rate, this does have the distinct advantage of running userspace.


-- wli


diff -prauN pgcl-2.6.0-test11-8/arch/i386/mm/highmem.c pgcl-2.6.0-test11-9/arch/i386/mm/highmem.c
--- pgcl-2.6.0-test11-8/arch/i386/mm/highmem.c	2003-11-30 18:57:20.000000000 -0800
+++ pgcl-2.6.0-test11-9/arch/i386/mm/highmem.c	2003-12-01 08:29:54.000000000 -0800
@@ -45,6 +45,9 @@ void *kmap_atomic(struct page *page, enu
 
 	idx = type + KM_TYPE_NR*smp_processor_id();
 	vaddr = __fix_to_virt(FIX_KMAP_END) + PAGE_SIZE*idx;
+	pr_debug("kmap_atomic(%d) has pfn 0x%lx, idx %d, vaddr 0x%lx\n",
+		type, page_to_pfn(page), idx, vaddr);
+	BUG_ON(vaddr % PAGE_SIZE);
 	BUG_ON(vaddr > __fix_to_virt(FIX_KMAP_BEGIN));
 	BUG_ON(vaddr < __fix_to_virt(FIX_KMAP_END));
 
@@ -54,6 +57,9 @@ void *kmap_atomic(struct page *page, enu
 	pgd = pgd_offset_k(addr);
 	pmd = pmd_offset(pgd, addr);
 
+	/* barf on non-present pagetables */
+	BUG_ON(pmd_none(*pmd));
+
 	/* barf on highmem-allocated pagetables */
 	BUG_ON((pmd_val(*pmd) >> MMUPAGE_SHIFT) >= max_low_pfn);
 
@@ -66,8 +72,13 @@ void *kmap_atomic(struct page *page, enu
 		BUG_ON(addr < vaddr);
 		BUG_ON(addr - vaddr >= PAGE_SIZE);
 		BUG_ON(!pfn_valid(pfn + k));
-		if (pte_pfn(pte[k]) == pfn + k)
+		pr_debug("%s: mapping pfn 0x%lx at vaddr 0x%lx\n",
+				__FUNCTION__, pfn, vaddr);
+		if (pte_pfn(pte[k]) == pfn + k) {
+			pr_debug("%s: skipping already-set kmap_atomic() pte\n",
+				__FUNCTION__);
 			continue;
+		}
 
 		set_pte(&pte[k], pfn_pte(pfn + k, kmap_prot));
 		__flush_tlb_one(addr);
@@ -86,7 +97,7 @@ void kunmap_atomic(void *kvaddr, enum km
 	pmd_t *pmd;
 	pte_t *pte;
 
-	if (vaddr < FIXADDR_START) { // FIXME
+	if (vaddr < __fix_to_virt(__end_of_fixed_addresses)) { // FIXME
 		dec_preempt_count();
 		return;
 	}
@@ -106,7 +117,9 @@ void kunmap_atomic(void *kvaddr, enum km
 	for (k = 0; k < PAGE_MMUCOUNT; ++k, vaddr += MMUPAGE_SIZE) {
 		pte_clear(&pte[k]);
 		__flush_tlb_one(vaddr);
-	}
+	} else
+		pr_debug("%s: skipping already-set kmap_atomic() pte\n",
+				__FUNCTION__);
 
 	dec_preempt_count();
 }
@@ -119,17 +132,18 @@ unsigned long kmap_atomic_to_pfn(void *p
 	pmd_t *pmd;
 	pte_t *pte;
 
-	if (vaddr < FIXADDR_START)
+	/*
+	 * Not for vmallocspace!!!
+	 */
+	BUG_ON(vaddr >= VMALLOC_START && vaddr < __VMALLOC_END);
+	if (vaddr < VMALLOC_START)
 		return __pa(vaddr)/MMUPAGE_SIZE;
 
 	pgd = pgd_offset_k(vaddr);
 	pmd = pmd_offset(pgd, vaddr);
+	BUG_ON(pmd_none(*pmd));
 	pte = pte_offset_kernel(pmd, vaddr);
 
-	/*
-	 * unsigned long idx = virt_to_fix(vaddr);
-	 * pte = &kmap_pte[idx*PAGE_MMUCOUNT];
-	 */
 	return pte_pfn(*pte);
 }
 
@@ -145,11 +159,15 @@ void kmap_atomic_sg(pte_t *ptes[], pte_a
 	inc_preempt_count();
 	idx = type + KM_TYPE_NR*smp_processor_id();
 	base = vaddr = __fix_to_virt(FIX_KMAP_END) + PAGE_SIZE*idx;
+	pr_debug("kmap_atomic_sg(%d) has idx %d, vaddr 0x%lx\n",
+		type, idx, vaddr);
+	BUG_ON(vaddr % PAGE_SIZE);
 	BUG_ON(vaddr > __fix_to_virt(FIX_KMAP_BEGIN));
 	BUG_ON(vaddr < __fix_to_virt(FIX_KMAP_END));
 
 	pgd = pgd_offset_k(vaddr);
 	pmd = pmd_offset(pgd, vaddr);
+	BUG_ON(pmd_none(*pmd));
 	pte = pte_offset_kernel(pmd, vaddr);
 	for (k = 0; k < PAGE_MMUCOUNT; ++k, vaddr += MMUPAGE_SIZE) {
 		unsigned long pfn = paddrs[k]/MMUPAGE_SIZE;
@@ -163,6 +181,8 @@ void kmap_atomic_sg(pte_t *ptes[], pte_a
 		BUG_ON((u32)ptes[k] < base);
 		BUG_ON((u32)ptes[k] - base >= PAGE_SIZE);
 
+		pr_debug("%s: mapping pfn 0x%lx at vaddr 0x%lx\n",
+				__FUNCTION__, pfn, vaddr);
 		if (pte_pfn(pte[k]) != pfn) {
 			set_pte(&pte[k], pfn_pte(pfn, kmap_prot));
 			__flush_tlb_one(vaddr);
diff -prauN pgcl-2.6.0-test11-8/arch/i386/mm/init.c pgcl-2.6.0-test11-9/arch/i386/mm/init.c
--- pgcl-2.6.0-test11-8/arch/i386/mm/init.c	2003-11-30 12:45:48.000000000 -0800
+++ pgcl-2.6.0-test11-9/arch/i386/mm/init.c	2003-12-01 01:29:26.000000000 -0800
@@ -212,11 +212,6 @@ EXPORT_SYMBOL(kmap_prot);
 
 #define kmap_init()	do { kmap_prot = PAGE_KERNEL; } while (0)
 
-void __init permanent_kmaps_init(pgd_t *pgd_base)
-{
-	page_table_range_init(PKMAP_BASE, PKMAP_BASE + PAGE_SIZE*LAST_PKMAP, pgd_base);
-}
-
 void __init one_highpage_init(struct page *page, unsigned long pfn, int bad_ppro)
 {
 	if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
@@ -243,7 +238,6 @@ extern void set_highmem_pages_init(int);
 
 #else
 #define kmap_init() do { } while (0)
-#define permanent_kmaps_init(pgd_base) do { } while (0)
 #define set_highmem_pages_init(bad_ppro) do { } while (0)
 #endif /* CONFIG_HIGHMEM */
 
@@ -288,8 +282,6 @@ static void __init pagetable_init (void)
 	vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
 	page_table_range_init(vaddr, 0, pgd_base);
 
-	permanent_kmaps_init(pgd_base);
-
 #ifdef CONFIG_X86_PAE
 	/*
 	 * Add low memory identity-mappings - SMP needs it when
diff -prauN pgcl-2.6.0-test11-8/include/asm-generic/rmap.h pgcl-2.6.0-test11-9/include/asm-generic/rmap.h
--- pgcl-2.6.0-test11-8/include/asm-generic/rmap.h	2003-11-27 21:55:19.000000000 -0800
+++ pgcl-2.6.0-test11-9/include/asm-generic/rmap.h	2003-12-01 07:21:48.000000000 -0800
@@ -57,6 +57,8 @@ static inline void pgtable_add_rmap(stru
 	page->mapping = (void *)mm;
 	page->index = address & ~(VIRT_AREA_MAPPED_PER_PTE_PAGE - 1);
 	inc_page_state(nr_page_table_pages);
+	pr_debug("%s: installing pte page at pfn 0x%lx at uvaddr 0x%lx\n",
+			__FUNCTION__, page_to_pfn(page), page->index);
 }
 
 static inline void pgtable_remove_rmap(struct page * page)
@@ -75,6 +77,8 @@ static inline void pgtable_remove_rmap(s
 			BUG_ON(atomic_read(&page->count) <= 0);
 	}
 
+	pr_debug("%s: removing pte page at pfn 0x%lx at uvaddr 0x%lx\n",
+			__FUNCTION__, page_to_pfn(page), page->index);
 	page->mapping = NULL;
 	page->index = 0;
 	dec_page_state(nr_page_table_pages);
@@ -109,24 +113,36 @@ static inline unsigned long ptep_to_addr
 	unsigned long kvaddr = (unsigned long)ptep;
 	unsigned long swpage_voff = kvaddr/sizeof(pte_t);
 
+	pr_debug("entered ptep_to_address(%p)\n", ptep);
+	pr_debug("swpage_voff = 0x%lx\n", swpage_voff);
+
 	if (1) {
 		pgd_t *pgd;
 		pmd_t *pmd;
 		pte_t *pte;
-		unsigned long pfn;
+		unsigned long vaddr, pfn;
 		struct page *page;
 
 		pgd = pgd_offset_k(kvaddr);
+		pr_debug("ptep_to_address() saw pgd mapping ptep at %p\n", pgd);
 		pmd = pmd_offset(pgd, kvaddr);
+		pr_debug("ptep_to_address() saw pmd mapping ptep at %p\n", pmd);
 		pte = pte_offset_kernel(pmd, kvaddr);
+		pr_debug("ptep_to_address() saw pte mapping ptep at %p\n", pte);
 		pfn = pte_pfn(*pte);
+		pr_debug("ptep_to_address() saw ptep held in pfn 0x%lx\n",
+			pfn);
+		if (pfn != kmap_atomic_to_pfn(ptep))
+			pr_debug("pfn doesn't match kmap_atomic_to_pfn()!\n");
 		page = pfn_to_page(pfn);
-		return page->index + PMD_SIZE*(pfn % PAGE_MMUCOUNT)
+		vaddr = page->index + PMD_SIZE*(pfn % PAGE_MMUCOUNT)
 			+ MMUPAGE_SIZE*(swpage_voff % PTRS_PER_PTE);
+		pr_debug("ptep_to_address() returning 0x%lx\n", vaddr);
+		return vaddr;
 	} else {
 		struct page *page = pfn_to_page(kmap_atomic_to_pfn(ptep));
 
-		WARN_ON(kvaddr > (unsigned long)(-PAGE_SIZE));
+		WARN_ON(kvaddr > (unsigned long)(-MMUPAGE_SIZE));
 
 		swpage_voff %= MMUPAGES_MAPPED_PER_PTE_PAGE;
 		/* WARN_ON(swpage_voff != pfn - page_to_pfn(page)); */
diff -prauN pgcl-2.6.0-test11-8/include/asm-i386/fixmap.h pgcl-2.6.0-test11-9/include/asm-i386/fixmap.h
--- pgcl-2.6.0-test11-8/include/asm-i386/fixmap.h	2003-11-30 18:57:20.000000000 -0800
+++ pgcl-2.6.0-test11-9/include/asm-i386/fixmap.h	2003-12-01 07:33:29.000000000 -0800
@@ -69,11 +69,12 @@
  * worth of virtualspace.
  */
 #define FIXADDR_TOP	(-MMUPAGE_SIZE)
-#define __FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << MMUPAGE_SHIFT)
+#define __FIXADDR_SIZE	(__end_of_fixed_addresses << MMUPAGE_SHIFT)
 #define FIXADDR_START	(FIXADDR_TOP - __FIXADDR_SIZE)
 
 #define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << MMUPAGE_SHIFT))
 #define __virt_to_fix(x)	((FIXADDR_TOP - ((x) & MMUPAGE_MASK)) >> MMUPAGE_SHIFT)
+#define __fixmap_align(x,a)	__virt_to_fix(__fix_to_virt(x) & (a))
 
 enum fixed_addresses {
 	/* reserved pte's for temporary kernel mappings */
@@ -102,18 +103,19 @@ enum fixed_addresses {
 	FIX_ACPI_BEGIN,
 	FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
 #endif
+#ifdef CONFIG_HIGHMEM
+	FIX_HIGHMEM_HOLE,
+	FIX_KMAP_BEGIN = __fixmap_align(FIX_HIGHMEM_HOLE+1, PAGE_MASK) + 1,
+	FIX_KMAP_END = FIX_KMAP_BEGIN + KM_TYPE_NR*NR_CPUS*PAGE_MMUCOUNT - 1,
+	FIX_PKMAP_BEGIN = __fixmap_align(FIX_KMAP_END+1, PKMAP_MASK) + 1,
+	FIX_PKMAP_END = FIX_PKMAP_BEGIN + LAST_PKMAP*PAGE_MMUCOUNT - 1,
+#endif
 	__end_of_permanent_fixed_addresses,
 	/* temporary boot-time mappings, used before ioremap() is functional */
 #define NR_FIX_BTMAPS	16
 	FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
 	FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
 	FIX_WP_TEST,
-#ifdef CONFIG_HIGHMEM
-	FIX_KMAP_BEGIN = __virt_to_fix(__fix_to_virt(FIX_WP_TEST+1) & PAGE_MASK) - PAGE_MMUCOUNT + 1,
-	FIX_KMAP_END = FIX_KMAP_BEGIN+((KM_TYPE_NR*NR_CPUS+1)*PAGE_MMUCOUNT)-1,
-	FIX_PKMAP_BEGIN = __virt_to_fix(__fix_to_virt(FIX_KMAP_END+1) & PKMAP_MASK) - PAGE_MMUCOUNT + 1,
-	FIX_PKMAP_END = FIX_PKMAP_BEGIN + (LAST_PKMAP+1)*PAGE_MMUCOUNT - 1,
-#endif
 	__end_of_fixed_addresses
 };
 
diff -prauN pgcl-2.6.0-test11-8/include/asm-i386/pgtable.h pgcl-2.6.0-test11-9/include/asm-i386/pgtable.h
--- pgcl-2.6.0-test11-8/include/asm-i386/pgtable.h	2003-11-29 00:02:03.000000000 -0800
+++ pgcl-2.6.0-test11-9/include/asm-i386/pgtable.h	2003-12-01 07:26:11.000000000 -0800
@@ -81,7 +81,8 @@ void paging_init(void);
  * The vmalloc() routines leaves a hole of 4kB between each vmalloced
  * area for the same reason. ;)
  */
-#define VMALLOC_END	(FIXADDR_START-2*MMUPAGE_SIZE)
+#define __VMALLOC_END	__fix_to_virt(__end_of_fixed_addresses)
+#define VMALLOC_END	((__VMALLOC_END-2*MMUPAGE_SIZE) & PMD_MASK)
 #define __VMALLOC_START	(VMALLOC_END - VMALLOC_RESERVE - 2*MMUPAGE_SIZE)
 #define VMALLOC_START							\
 	(high_memory							\

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-12-01  7:36     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  2003-12-01  7:44       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-12-07  7:28       ` William Lee Irwin III
  2003-12-07 18:45         ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
  1 sibling, 1 reply; 13+ messages in thread
From: William Lee Irwin III @ 2003-12-07  7:28 UTC (permalink / raw)
  To: linux-kernel

On Sun, Nov 30, 2003 at 08:43:01AM -0800, William Lee Irwin III wrote:
>> I wonder if this would be enough to get sysenter support going again.
>> I've not got a sysenter-capable userspace around, so I can't really
>> test this myself.
>> vs. pgcl-2.6.0-test11-5

On Sun, Nov 30, 2003 at 11:36:32PM -0800, William Lee Irwin III wrote:
> Stack decoding fixes, shutting up some compiler warnings, and dumping
> PAGE_SIZE and MMUPAGE_SIZE into /proc/meminfo (for lack of a better place).
> The printk()'s down there should eventually get ripped out anyway for
> minimal impact and a quieter boot, but until then...

Woops, those page sizes were a bit off. Come to think of it, so is
aio_setup_ring()...


-- wli

diff -prauN pgcl-2.6.0-test11-9/fs/aio.c pgcl-2.6.0-test11-10/fs/aio.c
--- pgcl-2.6.0-test11-9/fs/aio.c	2003-11-27 21:55:19.000000000 -0800
+++ pgcl-2.6.0-test11-10/fs/aio.c	2003-12-02 04:43:21.000000000 -0800
@@ -187,8 +187,8 @@ static int aio_setup_ring(struct kioctx 
 	struct io_event *__event;					\
 	unsigned long pfn;						\
 	pfn = (info)->ring_pages[pos/AIO_EVENTS_PER_PAGE];		\
-	__event = kmap_atomic(pfn_to_page(pfn), km);			\
-	__event += (pfn % PAGE_MMUCOUNT) * MMUPAGE_SIZE;		\
+	__event = (void *)((char *)kmap_atomic(pfn_to_page(pfn), km)	\
+			+ MMUPAGE_SIZE * (pfn % PAGE_MMUCOUNT));	\
 	__event += pos % AIO_EVENTS_PER_PAGE;				\
 	__event;							\
 })
diff -prauN pgcl-2.6.0-test11-9/fs/proc/proc_misc.c pgcl-2.6.0-test11-10/fs/proc/proc_misc.c
--- pgcl-2.6.0-test11-9/fs/proc/proc_misc.c	2003-11-30 12:50:32.000000000 -0800
+++ pgcl-2.6.0-test11-10/fs/proc/proc_misc.c	2003-12-02 00:42:13.000000000 -0800
@@ -231,8 +231,8 @@ static int meminfo_read_proc(char *page,
 		vmtot,
 		vmi.used,
 		vmi.largest_chunk,
-		K(PAGE_SIZE),
-		K(MMUPAGE_SIZE)
+		PAGE_SIZE >> 10,
+		MMUPAGE_SIZE >> 10
 		);
 
 		len += hugetlb_report_meminfo(page + len);

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-12-07  7:28       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
@ 2003-12-07 18:45         ` Zwane Mwaikambo
  2003-12-07 19:12           ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
  0 siblings, 1 reply; 13+ messages in thread
From: Zwane Mwaikambo @ 2003-12-07 18:45 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: Linux Kernel

On Sat, 6 Dec 2003, William Lee Irwin III wrote:

> On Sun, Nov 30, 2003 at 08:43:01AM -0800, William Lee Irwin III wrote:
> >> I wonder if this would be enough to get sysenter support going again.
> >> I've not got a sysenter-capable userspace around, so I can't really
> >> test this myself.
> >> vs. pgcl-2.6.0-test11-5
>
> On Sun, Nov 30, 2003 at 11:36:32PM -0800, William Lee Irwin III wrote:
> > Stack decoding fixes, shutting up some compiler warnings, and dumping
> > PAGE_SIZE and MMUPAGE_SIZE into /proc/meminfo (for lack of a better place).
> > The printk()'s down there should eventually get ripped out anyway for
> > minimal impact and a quieter boot, but until then...
>
> Woops, those page sizes were a bit off. Come to think of it, so is
> aio_setup_ring()...

And here is a sync point, it gets DRI memory allocation/mapping code
working. There are a few things which need to be ironed out wrt the radeon
driver, but this is some good progress.

Tested with the radeon DRI driver.

Index: linux-2.6.0-test11/drivers/char/drm/drmP.h
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test11/drivers/char/drm/drmP.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 drmP.h
--- linux-2.6.0-test11/drivers/char/drm/drmP.h	28 Nov 2003 18:03:00 -0000	1.1.1.1
+++ linux-2.6.0-test11/drivers/char/drm/drmP.h	7 Dec 2003 17:47:22 -0000
@@ -203,7 +203,7 @@ static inline struct page * vmalloc_to_p
 #define DRM_RPR_ARG(vma) vma,
 #endif

-#define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT)
+#define VM_OFFSET(vma) ((vma)->vm_pgoff << MMUPAGE_SHIFT)

 /*@}*/

Index: linux-2.6.0-test11/drivers/char/drm/drm_bufs.h
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test11/drivers/char/drm/drm_bufs.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 drm_bufs.h
--- linux-2.6.0-test11/drivers/char/drm/drm_bufs.h	28 Nov 2003 18:03:00 -0000	1.1.1.1
+++ linux-2.6.0-test11/drivers/char/drm/drm_bufs.h	7 Dec 2003 18:37:49 -0000
@@ -120,7 +120,7 @@ int DRM(addmap)( struct inode *inode, st
 	}
 	DRM_DEBUG( "offset = 0x%08lx, size = 0x%08lx, type = %d\n",
 		   map->offset, map->size, map->type );
-	if ( (map->offset & (~PAGE_MASK)) || (map->size & (~PAGE_MASK)) ) {
+	if ((map->offset & ~MMUPAGE_MASK) || (map->size & ~MMUPAGE_MASK)) {
 		DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
 		return -EINVAL;
 	}
@@ -392,7 +392,7 @@ int DRM(addbufs_agp)( struct inode *inod
 	size = 1 << order;

 	alignment  = (request.flags & _DRM_PAGE_ALIGN)
-		? PAGE_ALIGN(size) : size;
+		? MMUPAGE_ALIGN(size) : size;
 	page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
 	total = PAGE_SIZE << page_order;

@@ -572,7 +572,7 @@ int DRM(addbufs_pci)( struct inode *inod
 	if ( dev->queue_count ) return -EBUSY; /* Not while in use */

 	alignment = (request.flags & _DRM_PAGE_ALIGN)
-		? PAGE_ALIGN(size) : size;
+		? MMUPAGE_ALIGN(size) : size;
 	page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
 	total = PAGE_SIZE << page_order;

@@ -800,7 +800,7 @@ int DRM(addbufs_sg)( struct inode *inode
 	size = 1 << order;

 	alignment  = (request.flags & _DRM_PAGE_ALIGN)
-			? PAGE_ALIGN(size) : size;
+			? MMUPAGE_ALIGN(size) : size;
 	page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
 	total = PAGE_SIZE << page_order;

Index: linux-2.6.0-test11/drivers/char/drm/drm_ioctl.h
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test11/drivers/char/drm/drm_ioctl.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 drm_ioctl.h
Index: linux-2.6.0-test11/drivers/char/drm/drm_memory.h
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test11/drivers/char/drm/drm_memory.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 drm_memory.h
--- linux-2.6.0-test11/drivers/char/drm/drm_memory.h	28 Nov 2003 18:03:00 -0000	1.1.1.1
+++ linux-2.6.0-test11/drivers/char/drm/drm_memory.h	7 Dec 2003 18:37:00 -0000
@@ -279,7 +281,7 @@ unsigned long DRM(alloc_pages)(int order
 	for (addr = address, sz = bytes;
 	     sz > 0;
 	     addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-		SetPageReserved(virt_to_page(addr));
+		SetPageReserved(pfn_to_page(vmalloc_to_pfn((void *)addr)));
 	}

 	return address;
@@ -307,7 +309,8 @@ void DRM(free_pages)(unsigned long addre
 	for (addr = address, sz = bytes;
 	     sz > 0;
 	     addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-		ClearPageReserved(virt_to_page(addr));
+
+		ClearPageReserved(pfn_to_page(vmalloc_to_pfn((void *)addr)));
 	}

 	free_pages(address, order);
Index: linux-2.6.0-test11/drivers/char/drm/drm_scatter.h
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test11/drivers/char/drm/drm_scatter.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 drm_scatter.h
--- linux-2.6.0-test11/drivers/char/drm/drm_scatter.h	28 Nov 2003 18:03:00 -0000	1.1.1.1
+++ linux-2.6.0-test11/drivers/char/drm/drm_scatter.h	29 Nov 2003 17:15:58 -0000
@@ -137,7 +137,7 @@ int DRM(sg_alloc)( struct inode *inode,
 	DRM_DEBUG( "sg alloc virtual = %p\n", entry->virtual );

 	for ( i = entry->handle, j = 0 ; j < pages ; i += PAGE_SIZE, j++ ) {
-		entry->pagelist[j] = vmalloc_to_page((void *)i);
+		entry->pagelist[j] = pfn_to_page(vmalloc_to_pfn((void *)i));
 		if (!entry->pagelist[j])
 			goto failed;
 		SetPageReserved(entry->pagelist[j]);
Index: linux-2.6.0-test11/drivers/char/drm/drm_vm.h
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test11/drivers/char/drm/drm_vm.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 drm_vm.h
--- linux-2.6.0-test11/drivers/char/drm/drm_vm.h	28 Nov 2003 18:03:00 -0000	1.1.1.1
+++ linux-2.6.0-test11/drivers/char/drm/drm_vm.h	7 Dec 2003 18:42:11 -0000
@@ -166,7 +166,7 @@ struct page *DRM(vm_shm_nopage)(struct v

 	offset	 = address - vma->vm_start;
 	i = (unsigned long)map->handle + offset;
-	page = vmalloc_to_page((void *)i);
+	page = pfn_to_page(vmalloc_to_pfn((void *)i));
 	if (!page)
 		return NOPAGE_OOM;
 	get_page(page);

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

* Re: pgcl-2.6.0-test5-bk3-17
  2003-12-07 18:45         ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
@ 2003-12-07 19:12           ` William Lee Irwin III
  0 siblings, 0 replies; 13+ messages in thread
From: William Lee Irwin III @ 2003-12-07 19:12 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel

On Sat, 6 Dec 2003, William Lee Irwin III wrote:
>> Woops, those page sizes were a bit off. Come to think of it, so is
>> aio_setup_ring()...

On Sun, Dec 07, 2003 at 01:45:36PM -0500, Zwane Mwaikambo wrote:
> And here is a sync point, it gets DRI memory allocation/mapping code
> working. There are a few things which need to be ironed out wrt the radeon
> driver, but this is some good progress.
> Tested with the radeon DRI driver.

Terrific! I'll plop that and the various minimal fixes I've got atop -9
and ship it as -10 shortly.


-- wli

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

end of thread, other threads:[~2003-12-07 19:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-28  4:15 pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-11-28  7:21 ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-11-28 23:51   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-11-30  1:12   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-11-30 16:43   ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-11-30 18:46     ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
2003-11-30 18:50       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-12-01  7:36     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-12-01  7:44       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-12-07  7:28       ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-12-07 18:45         ` pgcl-2.6.0-test5-bk3-17 Zwane Mwaikambo
2003-12-07 19:12           ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III
2003-12-01 16:46     ` pgcl-2.6.0-test5-bk3-17 William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).