All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: linux-kernel@vger.kernel.org
Subject: [RFC] remove copy_segments, release_segments, forget_segments
Date: Sun, 13 Oct 2002 14:10:59 +0200	[thread overview]
Message-ID: <3DA962D3.7080906@colorfullife.com> (raw)

[-- 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);

                 reply	other threads:[~2002-10-13 12:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3DA962D3.7080906@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.