public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] remove copy_segments, release_segments, forget_segments
@ 2002-10-13 12:10 Manfred Spraul
  0 siblings, 0 replies; only message in thread
From: Manfred Spraul @ 2002-10-13 12:10 UTC (permalink / raw)
  To: linux-kernel

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

forget_segments and copy_segments are already dead, release_segments is
used right now for i386 and x86_64 to release the ldt structures.
But the code is asymmetric: creation in init_new_context(), destruction
in release_segments().

What about the attached patch?
i386 and x86_64 can use destroy_context, then the _segment functions can
be removed entirely.

--
	Manfred


[-- Attachment #2: patch-remove_segments --]
[-- Type: text/plain, Size: 1588 bytes --]

// $Header$
// Kernel Version:
//  VERSION = 2
//  PATCHLEVEL = 5
//  SUBLEVEL = 42
//  EXTRAVERSION =
--- 2.5/arch/i386/kernel/ldt.c	Sun Oct 13 14:01:08 2002
+++ build-2.5/arch/i386/kernel/ldt.c	Sun Oct 13 13:44:52 2002
@@ -104,7 +104,7 @@
 /*
  * No need to lock the MM as we are the last user
  */
-void release_segments(struct mm_struct *mm)
+void destroy_context(struct mm_struct *mm)
 {
 	if (mm->context.size) {
 		if (mm == current->active_mm)
--- 2.5/include/asm-i386/mmu_context.h	Sun Sep 22 06:24:57 2002
+++ build-2.5/include/asm-i386/mmu_context.h	Sun Oct 13 13:42:50 2002
@@ -8,10 +8,10 @@
 #include <asm/tlbflush.h>
 
 /*
- * possibly do the LDT unload here?
+ * Used for LDT copy/destruction.
  */
-#define destroy_context(mm)		do { } while(0)
 int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
+void destroy_context(struct mm_struct *mm);
 
 #ifdef CONFIG_SMP
 
--- 2.5/include/asm-i386/processor.h	Sun Oct 13 13:56:03 2002
+++ build-2.5/include/asm-i386/processor.h	Sun Oct 13 13:44:02 2002
@@ -437,9 +437,6 @@
  */
 extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 
-/* Release all segment info associated with a VM */
-extern void release_segments(struct mm_struct * mm);
-
 extern unsigned long thread_saved_pc(struct task_struct *tsk);
 
 unsigned long get_wchan(struct task_struct *p);
--- 2.5/mm/mmap.c	Sun Oct 13 13:56:04 2002
+++ build-2.5/mm/mmap.c	Sun Oct 13 13:43:55 2002
@@ -1278,8 +1278,6 @@
 
 	profile_exit_mmap(mm);
  
-	release_segments(mm);
- 
 	spin_lock(&mm->page_table_lock);
 
 	flush_cache_mm(mm);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-13 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-13 12:10 [RFC] remove copy_segments, release_segments, forget_segments Manfred Spraul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox