All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Antoine Martin <antoine@nagafix.co.uk>
Cc: UML devel <user-mode-linux-devel@lists.sourceforge.net>,
	Blaisorblade <blaisorblade@yahoo.it>,
	Jeff Dike <jdike@addtoit.com>,
	eric_leitner@web.de
Subject: Re: [uml-devel] Re: [uml-user] Hardware Requirements -Some Questions about UML by a Newbie
Date: Sun, 28 Aug 2005 10:03:55 -0400	[thread overview]
Message-ID: <20050828140355.GF3192@ccure.user-mode-linux.org> (raw)
In-Reply-To: <1124960678.28722.29.camel@localhost.localdomain>

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

On Thu, Aug 25, 2005 at 10:04:38AM +0100, Antoine Martin wrote:
> 64-bit is broken atm, you'll run out of memory very quickly.

Um, and the patch is really included this time.

				Jeff

[-- Attachment #2: page-leak --]
[-- Type: text/plain, Size: 3120 bytes --]

Index: linux-2.6.13-rc6-mm2/arch/um/include/skas/mmu-skas.h
===================================================================
--- linux-2.6.13-rc6-mm2.orig/arch/um/include/skas/mmu-skas.h	2005-08-23 10:51:42.000000000 -0400
+++ linux-2.6.13-rc6-mm2/arch/um/include/skas/mmu-skas.h	2005-08-25 23:15:24.000000000 -0400
@@ -6,6 +6,7 @@
 #ifndef __SKAS_MMU_H
 #define __SKAS_MMU_H
 
+#include "linux/config.h"
 #include "mm_id.h"
 #include "asm/ldt.h"
 
@@ -13,6 +14,9 @@
 	struct mm_id id;
 
         unsigned long last_page_table;
+#ifdef CONFIG_3_LEVEL_PGTABLES
+        unsigned long last_pmd;
+#endif
         uml_ldt_t ldt;
 };
 
Index: linux-2.6.13-rc6-mm2/arch/um/kernel/skas/mmu.c
===================================================================
--- linux-2.6.13-rc6-mm2.orig/arch/um/kernel/skas/mmu.c	2005-08-23 10:51:42.000000000 -0400
+++ linux-2.6.13-rc6-mm2/arch/um/kernel/skas/mmu.c	2005-08-26 11:22:25.000000000 -0400
@@ -55,6 +55,9 @@
 	 */
 
         mm->context.skas.last_page_table = pmd_page_kernel(*pmd);
+#ifdef CONFIG_3_LEVEL_PGTABLES
+        mm->context.skas.last_pmd = (unsigned long) __va(pud_val(*pud));
+#endif
 
 	*pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT));
         *pte = pte_mkwrite(*pte);
@@ -143,6 +146,11 @@
 
 	if(!proc_mm || !ptrace_faultinfo){
 		free_page(mmu->id.stack);
-		free_page(mmu->last_page_table);
+		pte_free_kernel((pte_t *) mmu->last_page_table);
+                dec_page_state(nr_page_table_pages);
+#ifdef CONFIG_3_LEVEL_PGTABLES
+                log_info("Freeing last pmd 0x%x\n", mmu->last_pmd);
+		pmd_free((pmd_t *) mmu->last_pmd);
+#endif
 	}
 }
Index: linux-2.6.13-rc6-mm2/include/asm-um/pgalloc.h
===================================================================
--- linux-2.6.13-rc6-mm2.orig/include/asm-um/pgalloc.h	2005-08-23 10:51:42.000000000 -0400
+++ linux-2.6.13-rc6-mm2/include/asm-um/pgalloc.h	2005-08-25 22:20:38.000000000 -0400
@@ -42,11 +42,13 @@
 #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
 
 #ifdef CONFIG_3_LEVEL_PGTABLES
-/*
- * In the 3-level case we free the pmds as part of the pgd.
- */
-#define pmd_free(x)			do { } while (0)
-#define __pmd_free_tlb(tlb,x)		do { } while (0)
+
+extern __inline__ void pmd_free(pmd_t *pmd)
+{
+	free_page((unsigned long)pmd);
+}
+
+#define __pmd_free_tlb(tlb,x)   tlb_remove_page((tlb),virt_to_page(x))
 #endif
 
 #define check_pgt_cache()	do { } while (0)
Index: linux-2.6.13-rc6-mm2/include/asm-um/pgtable-3level.h
===================================================================
--- linux-2.6.13-rc6-mm2.orig/include/asm-um/pgtable-3level.h	2005-08-23 10:51:41.000000000 -0400
+++ linux-2.6.13-rc6-mm2/include/asm-um/pgtable-3level.h	2005-08-27 12:19:30.000000000 -0400
@@ -69,14 +69,11 @@
         return pmd;
 }
 
-static inline void pmd_free(pmd_t *pmd){
-	free_page((unsigned long) pmd);
+extern inline void pud_clear (pud_t *pud)
+{
+        set_pud(pud, __pud(0));
 }
 
-#define __pmd_free_tlb(tlb,x)   do { } while (0)
-
-static inline void pud_clear (pud_t * pud) { }
-
 #define pud_page(pud) \
 	((struct page *) __va(pud_val(pud) & PAGE_MASK))
 

  parent reply	other threads:[~2005-08-28 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <396648218@web.de>
     [not found] ` <20050811232256.GF11873@ccure.user-mode-linux.org>
     [not found]   ` <200508121814.43201.blaisorblade@yahoo.it>
2005-08-25  9:04     ` [uml-devel] Re: [uml-user] Hardware Requirements -Some Questions about UML by a Newbie Antoine Martin
2005-08-28 13:48       ` Jeff Dike
2005-08-28 14:03       ` Jeff Dike [this message]
2005-08-31  0:27         ` Antoine Martin
2005-08-31 13:21           ` Antoine Martin
2005-08-31 15:41             ` Jeff Dike
2005-08-31 18:05               ` Antoine Martin

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=20050828140355.GF3192@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=antoine@nagafix.co.uk \
    --cc=blaisorblade@yahoo.it \
    --cc=eric_leitner@web.de \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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 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.