public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/6] i386 virtualization - Remove some dead debugging code
@ 2005-08-15 22:59 zach
  2005-08-16  4:38 ` Chris Wright
  0 siblings, 1 reply; 3+ messages in thread
From: zach @ 2005-08-15 22:59 UTC (permalink / raw)
  To: akpm, chrisl, chrisw, hpa, linux-kernel, mbligh, pratap,
	virtualization, zach, zwane

This code is quite dead.  Release_thread is always guaranteed that the mm has
already been released, thus dead_task->mm will always be NULL.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.13/arch/i386/kernel/process.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/process.c	2005-08-15 10:46:18.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/process.c	2005-08-15 10:48:51.000000000 -0700
@@ -421,17 +421,7 @@
 
 void release_thread(struct task_struct *dead_task)
 {
-	if (dead_task->mm) {
-		// temporary debugging check
-		if (dead_task->mm->context.size) {
-			printk("WARNING: dead process %8s still has LDT? <%p/%d>\n",
-					dead_task->comm,
-					dead_task->mm->context.ldt,
-					dead_task->mm->context.size);
-			BUG();
-		}
-	}
-
+	BUG_ON(dead_task->mm);
 	release_vm86_irqs(dead_task);
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/6] i386 virtualization - Remove some dead debugging code
  2005-08-15 22:59 [PATCH 2/6] i386 virtualization - Remove some dead debugging code zach
@ 2005-08-16  4:38 ` Chris Wright
  2005-08-16  5:08   ` Zachary Amsden
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wright @ 2005-08-16  4:38 UTC (permalink / raw)
  To: zach
  Cc: akpm, chrisl, chrisw, hpa, linux-kernel, mbligh, pratap,
	virtualization, zwane

* zach@vmware.com (zach@vmware.com) wrote:
> This code is quite dead.  Release_thread is always guaranteed that the mm has
> already been released, thus dead_task->mm will always be NULL.
> 
> Signed-off-by: Zachary Amsden <zach@vmware.com>
> Index: linux-2.6.13/arch/i386/kernel/process.c
> ===================================================================
> --- linux-2.6.13.orig/arch/i386/kernel/process.c	2005-08-15 10:46:18.000000000 -0700
> +++ linux-2.6.13/arch/i386/kernel/process.c	2005-08-15 10:48:51.000000000 -0700
> @@ -421,17 +421,7 @@
>  
>  void release_thread(struct task_struct *dead_task)
>  {
> -	if (dead_task->mm) {
> -		// temporary debugging check
> -		if (dead_task->mm->context.size) {
> -			printk("WARNING: dead process %8s still has LDT? <%p/%d>\n",
> -					dead_task->comm,
> -					dead_task->mm->context.ldt,
> -					dead_task->mm->context.size);
> -			BUG();
> -		}
> -	}
> -
> +	BUG_ON(dead_task->mm);

This BUG_ON() has different semantics than old dead one.  Is there a
point?  exit_mm() has already reset this to NULL, no?

>  	release_vm86_irqs(dead_task);
>  }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/6] i386 virtualization - Remove some dead debugging code
  2005-08-16  4:38 ` Chris Wright
@ 2005-08-16  5:08   ` Zachary Amsden
  0 siblings, 0 replies; 3+ messages in thread
From: Zachary Amsden @ 2005-08-16  5:08 UTC (permalink / raw)
  To: Chris Wright
  Cc: akpm, chrisl, hpa, linux-kernel, mbligh, pratap, virtualization,
	zwane

Chris Wright wrote:

>* zach@vmware.com (zach@vmware.com) wrote:
>  
>
>>This code is quite dead.  Release_thread is always guaranteed that the mm has
>>already been released, thus dead_task->mm will always be NULL.
>>
>>Signed-off-by: Zachary Amsden <zach@vmware.com>
>>Index: linux-2.6.13/arch/i386/kernel/process.c
>>===================================================================
>>--- linux-2.6.13.orig/arch/i386/kernel/process.c	2005-08-15 10:46:18.000000000 -0700
>>+++ linux-2.6.13/arch/i386/kernel/process.c	2005-08-15 10:48:51.000000000 -0700
>>@@ -421,17 +421,7 @@
>> 
>> void release_thread(struct task_struct *dead_task)
>> {
>>-	if (dead_task->mm) {
>>-		// temporary debugging check
>>-		if (dead_task->mm->context.size) {
>>-			printk("WARNING: dead process %8s still has LDT? <%p/%d>\n",
>>-					dead_task->comm,
>>-					dead_task->mm->context.ldt,
>>-					dead_task->mm->context.size);
>>-			BUG();
>>-		}
>>-	}
>>-
>>+	BUG_ON(dead_task->mm);
>>    
>>
>
>This BUG_ON() has different semantics than old dead one.  Is there a
>point?  exit_mm() has already reset this to NULL, no?
>  
>

Yes, completely.  This BUG() could be eliminated entirely, as trivial 
inspection shows.  I can't fathom a single reason why it should still 
exist, but the presence of it in the first place made be wonder if there 
may be some erudite reason for it.  Thus I raised the BUG to a higher 
power - obviously the LDT is gone if the MM is gone.

Zach

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-16  5:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-15 22:59 [PATCH 2/6] i386 virtualization - Remove some dead debugging code zach
2005-08-16  4:38 ` Chris Wright
2005-08-16  5:08   ` Zachary Amsden

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