Hi All,
        Patch attached below replaces occurrences of checks of
pidhash_init_done by checks of last_pid. I have tested it on i386 and
x86_64 with both serial and ethernet. It works fine.

Thanks
On Thu, 2006-06-15 at 09:09 -0700, Tom Rini wrote:
> On Thu, Jun 15, 2006 at 06:01:59PM +0200, Andi Kleen wrote:
> >  
> > > No, that one I suspect, but haven't had a chance to verify, can die.
> > 
> > Ok.
> > 
> > > The one we can't get rid of is our adding a flag for pidhash_init()
> > > being done.  The problem is that many GDB front-ends (Eclipse) will
> > > always do an 'info threads' upon connect.  But if they connect before
> > > pidhash_init() is done, we need to 'fake' the information rather than
> > > try and dig up the real info.
> > 
> > Just check (last_pid != 0) ? 
> 
> If that works, that'd be quite handy.  I'll give that a shot soon.
> Thanks!
> 
-- 
...Milind
KGDB-PRO
http://www.linsyssoft.com/Kgdbpro.html
Signed off: Milind Dumbare <[EMAIL PROTECTED]>

 kgdb.c |    7 +++----
 pid.c  |   10 +---------
 2 files changed, 4 insertions(+), 13 deletions(-)

Index: linux-2.6.16.20/kernel/kgdb.c
===================================================================
--- linux-2.6.16.20.orig/kernel/kgdb.c	2006-06-13 14:49:17.000000000 +0530
+++ linux-2.6.16.20/kernel/kgdb.c	2006-06-20 12:48:11.000000000 +0530
@@ -51,8 +51,7 @@
 
 
 extern int pid_max;
-extern int pidhash_init_done;
-
+extern int last_pid;
 /* How many times to count all of the waiting CPUs */
 #define ROUNDUP_WAIT		640000	/* Arbitrary, increase if needed. */
 #define BUF_THREAD_ID_SIZE	16
@@ -719,7 +718,7 @@
 
 static struct task_struct *getthread(struct pt_regs *regs, int tid)
 {
-	if (!pidhash_init_done)
+	if (last_pid != 0)
 		return current;
 
 	if (num_online_cpus() &&
@@ -1360,7 +1359,7 @@
 				 * pidhash_init() there isn't much we
 				 * can give back.
 				 */
-				if (!pidhash_init_done) {
+				if (last_pid != 0) {
 					if (remcom_in_buffer[1] == 'f')
 						strcpy(remcom_out_buffer,
 						       "m0000000000000001");
Index: linux-2.6.16.20/kernel/pid.c
===================================================================
--- linux-2.6.16.20.orig/kernel/pid.c	2006-06-20 12:47:06.000000000 +0530
+++ linux-2.6.16.20/kernel/pid.c	2006-06-20 12:48:04.000000000 +0530
@@ -250,13 +250,8 @@
 /*
  * The pid hash table is scaled according to the amount of memory in the
  * machine.  From a minimum of 16 slots up to 4096 slots at one gigabyte or
- * more.  KGDB needs to know if this function has been called already,
- * since we might have entered KGDB very early.
+ * more. 
  */
-#ifdef CONFIG_KGDB
-int pidhash_init_done;
-#endif
-
 void __init pidhash_init(void)
 {
 	int i, j, pidhash_size;
@@ -279,9 +274,6 @@
 			INIT_HLIST_HEAD(&pid_hash[i][j]);
 	}
 
-#ifdef CONFIG_KGDB
-	pidhash_init_done = 1;
-#endif
 }
 
 void __init pidmap_init(void)
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to