Skip to contentSkip to conversation

remove copy_segments, release_segments, forget_segments

RFC New Manfred Spraul 1 participant 1 message Oct 13, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 remove copy_segments, release_segments, forget_segments

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

// $Header$
// Kernel Version:

//  VERSION = 2
//  PATCHLEVEL = 5
//  SUBLEVEL = 42
//  EXTRAVERSION =
arch/i386/kernel/ldt.c +1 -1
@@ -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)
include/asm-i386/mmu_context.h +2 -2
@@ -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
 
include/asm-i386/processor.h +0 -3
@@ -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);
mm/mmap.c +0 -2
@@ -1278,8 +1278,6 @@
 
 	profile_exit_mmap(mm);
  
-	release_segments(mm);
- 
 	spin_lock(&mm->page_table_lock);
 
 	flush_cache_mm(mm);