Re: [git pull] kgdb-light -v10

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Andi Kleen <andi@...>, <linux-kernel@...>, Frank Ch. Eigler <fche@...>, Roland McGrath <roland@...>, Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, Andrew Morton <akpm@...>
Date: Tuesday, February 12, 2008 - 12:46 pm

On Tue, 12 Feb 2008, Ingo Molnar wrote:

Quite frankly, I don't see why the kernel kgdb layer should have *any* 
code like this at all.

The one who is actually debugging is the one who should decide which CPU's 
get stopped, and which don't.

I realize that the gdb remote protocol is probably a piece of crap and 
cannot handle that, but hey, that's not my problem, and more importantly, 
I don't think it's even a *remotely* valid reason for making bad decisions 
in the kernel. gdb was still open source last time I saw, and I think it's 
reasonable to just say:

 - the kgdb commands should always act on the *current* CPU only
 - add one command that says "switch over to CPU #n" which just releases 
   the current CPU and sends an IPI to that CPU #n (no timeouts, no 
   synchronous waiting, no nothing - it's like a "continue", but with a 
   "try to get the other CPU to stop"

Yes, other CPU's will obviously often end up stopping due to waiting for 
some spinlock or other if we stop one, but that's a separate issue, and 
quite often it might be sufficient - and what we want.

And yes, you'd likely have to add some support to gdb to make this 
_usable_, but now all that usability crap, all those timeouts for "stop 
all CPU's" are now in user space on the _debugger_ side. That can be as 
fancy as it wants to be.

And maybe this isn't realistic. I'm not saying "we _must_ do it this way", 
I just want to say that the kernel kgdb layer should be as thin ass 
humanly possible, and maybe the right thing to do is to simply totally 
punt on the whole "stop other cpu's" issue and make it a debugger-side 
question.

In other words, is it perhaps possible to just *get*rid*of* that 
"kgdb_active" and "nmicallback" and the whole multi-CPU roundup? Just use 
a kgdb spinlock around the stuff that actually sends and receives 
individual packets, and expect the debugger side to sort them out (yeah, I 
suspect this involves having to add the CPU ID to each packet).

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kgdb in git-x86#mm review, Andi Kleen, (Sun Feb 10, 9:53 pm)
Re: kgdb in git-x86#mm review, Mark Lord, (Mon Feb 11, 12:03 pm)
Re: kgdb in git-x86#mm review, Frank Ch. Eigler, (Mon Feb 11, 11:32 am)
Re: [git pull] kgdb-light -v8,, Jan Kiszka, (Mon Feb 11, 12:41 pm)
Re: [git pull] kgdb-light -v8,, Ingo Molnar, (Mon Feb 11, 12:54 pm)
[git pull] kgdb-light -v9, Ingo Molnar, (Mon Feb 11, 7:03 pm)
Re: [git pull] kgdb-light -v9, Andi Kleen, (Tue Feb 12, 6:03 am)
[git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 7:27 am)
Re: [git pull] kgdb-light -v10, Domenico Andreoli, (Tue Feb 12, 9:18 am)
Re: [git pull] kgdb-light -v10, Jason Wessel, (Tue Feb 12, 9:59 am)
Re: [git pull] kgdb-light -v10, Domenico Andreoli, (Tue Feb 12, 11:45 am)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 8:19 am)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 8:38 am)
Re: [git pull] kgdb-light -v10, Jason Wessel, (Tue Feb 12, 9:30 am)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 10:39 am)
Re: [git pull] kgdb-light -v10, Jason Wessel, (Tue Feb 12, 10:35 am)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 11:36 am)
Re: [git pull] kgdb-light -v10, Jason Wessel, (Tue Feb 12, 12:21 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 1:10 pm)
Re: [git pull] kgdb-light -v10, Jason Wessel, (Tue Feb 12, 12:48 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 9:50 am)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 11:28 am)
Re: [git pull] kgdb-light -v10, Linus Torvalds, (Tue Feb 12, 12:46 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 2:20 pm)
Re: [git pull] kgdb-light -v10, Andrew Morton, (Tue Feb 12, 2:20 pm)
Re: [git pull] kgdb-light -v10, Frank Ch. Eigler, (Tue Feb 12, 3:34 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 4:16 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 3:16 pm)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 5:01 pm)
Re: [git pull] kgdb-light -v10, Linus Torvalds, (Tue Feb 12, 2:11 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 3:22 pm)
Re: [git pull] kgdb-light -v10, Linus Torvalds, (Tue Feb 12, 3:01 pm)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 1:01 pm)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 1:10 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 12:11 pm)
Re: [git pull] kgdb-light -v10, Linus Torvalds, (Tue Feb 12, 12:25 pm)
Re: [git pull] kgdb-light -v10, Jason Wessel, (Fri Feb 15, 4:36 pm)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 12:42 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 1:07 pm)
Re: [RFC][PATCH] modular kgdb-light, Jason Wessel, (Fri Feb 15, 4:24 pm)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 12:24 pm)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 1:01 pm)
Re: [git pull] kgdb-light -v10, Ingo Molnar, (Tue Feb 12, 11:16 am)
Re: [git pull] kgdb-light -v10, Andi Kleen, (Tue Feb 12, 11:28 am)
Re: [git pull] kgdb-light -v9, Roland McGrath, (Tue Feb 12, 6:26 am)
Re: [git pull] kgdb-light -v9, Ingo Molnar, (Tue Feb 12, 6:34 am)
Re: [git pull] kgdb-light -v9, Sam Ravnborg, (Tue Feb 12, 5:35 am)
Re: kgdb in git-x86#mm review, Andi Kleen, (Mon Feb 11, 12:11 pm)