Re: rmap and nvidia?

Andrew McGregor
2002-12-17T19:28:36Z

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

So, first apply the patch for 4191 from www.minion.de, then the attached
one based on yours. Been running overnight and beaten on by XScreesaver,
no memory leak anymore.

Andrew

--On Tuesday, December 17, 2002 00:22:34 +0200 "O.Sezer"
<sezero@superonline.com> wrote:

> Is this patch correct in any way?
> (Ripped out of the 2.5 patch and modified some).
>
> Thanks.
>

[-- Attachment #2: NVIDIA_kernel-1.0-4191-2.5-pte_unmap.diff --]
[-- Type: application/octet-stream, Size: 1607 bytes --]

--- NVIDIA_kernel-1.0-4191-2.5-minion/nv-linux.h 2002-12-18 08:25:50.000000000 +1300
+++ NVIDIA_kernel-1.0-4191-2.5/nv-linux.h 2002-12-17 22:03:31.000000000 +1300
@@ -151,21 +151,27 @@
# define SMP_NUM_CPUS smp_num_cpus
#endif

-#ifdef KERNEL_2_5
-#define PTE_OFFSET(pmd, address, pte) (pte = *pte_offset_map(pmd, address))
+#ifdef pte_offset_map /* rmap-vm or 2.5 */
+#define PTE_OFFSET(pmd, address, pte) \
+ { \
+ pte_t *pPTE; \
+ pPTE = pte_offset_map(pmd, address); \
+ pte = *pPTE; \
+ pte_unmap(pPTE); \
+ }
#else
-#ifdef pte_offset_atomic
+#ifdef pte_offset_atomic /* aa-vm */
#define PTE_OFFSET(pmd, address, pte) \
- { \
+ { \
pte_t *pPTE; \
pPTE = pte_offset_atomic(pmd, address); \
pte = *pPTE; \
pte_kunmap(pPTE); \
}
-#else /* !pte_offset_atomic */
+#else /* !pte_offset_atomic */
#define PTE_OFFSET(pmd, address, pte) (pte = *pte_offset(pmd, address))
-#endif /* pte_offset_atomic */
-#endif /* KERNEL_2_5 */
+#endif /* pte_offset_atomic */
+#endif /* pte_offset_map */

#define NV_PAGE_ALIGN(addr) ( ((addr) + PAGE_SIZE - 1) / PAGE_SIZE)
#define NV_MASK_OFFSET(addr) ( (addr) & (PAGE_SIZE - 1) )