linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace
       [not found]     ` <200807081756.47140.rusty@rustcorp.com.au>
@ 2008-07-10 21:07       ` Milton Miller
  2008-07-11  6:43         ` Rusty Russell
  2008-07-11  7:46         ` Ingo Molnar
  0 siblings, 2 replies; 5+ messages in thread
From: Milton Miller @ 2008-07-10 21:07 UTC (permalink / raw)
  To: Ingo Molnar, Rusty Russell; +Cc: linuxppc-dev, linux-next, linux-kernel



Hi Rusty, Ingo.

Rusty's patch [PATCH 3/3] stop_machine: use cpu mask rather than magic numbers
didn't find kernel/trace/ftrace.c in -next, causing an immediate almost NULL
pointer dereference in ftrace_dynamic_init.


Signed-off-by: Milton Miller <miltonm@bga.com>

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 0f271c4..c29acb5 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -587,7 +587,7 @@ static int __ftrace_modify_code(void *data)
 
 static void ftrace_run_update_code(int command)
 {
-	stop_machine_run(__ftrace_modify_code, &command, NR_CPUS);
+	stop_machine_run(__ftrace_modify_code, &command, NULL);
 }
 
 void ftrace_disable_daemon(void)
@@ -787,7 +787,7 @@ static int ftrace_update_code(void)
 	    !ftrace_enabled || !ftraced_trigger)
 		return 0;
 
-	stop_machine_run(__ftrace_update_code, NULL, NR_CPUS);
+	stop_machine_run(__ftrace_update_code, NULL, NULL);
 
 	return 1;
 }
@@ -1564,7 +1564,7 @@ static int __init ftrace_dynamic_init(void)
 
 	addr = (unsigned long)ftrace_record_ip;
 
-	stop_machine_run(ftrace_dyn_arch_init, &addr, NR_CPUS);
+	stop_machine_run(ftrace_dyn_arch_init, &addr, NULL);
 
 	/* ftrace_dyn_arch_init places the return code in addr */
 	if (addr) {

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

* Re: [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace
  2008-07-10 21:07       ` [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace Milton Miller
@ 2008-07-11  6:43         ` Rusty Russell
  2008-07-11  7:46         ` Ingo Molnar
  1 sibling, 0 replies; 5+ messages in thread
From: Rusty Russell @ 2008-07-11  6:43 UTC (permalink / raw)
  To: Milton Miller; +Cc: linuxppc-dev, linux-next, Ingo Molnar, linux-kernel

On Friday 11 July 2008 07:07:57 Milton Miller wrote:
> Hi Rusty, Ingo.
>
> Rusty's patch [PATCH 3/3] stop_machine: use cpu mask rather than magic
> numbers didn't find kernel/trace/ftrace.c in -next, causing an immediate
> almost NULL pointer dereference in ftrace_dynamic_init.

Yes, I'm switching the patches around, so it does the transition correctly. 
Introduces a new stop_machine() fn with the new interface and deprecates the 
old stop_machine_run().  We can remove stop_machine_run() after everyone is 
switched.

Thanks,
Rusty.

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

* Re: [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace
  2008-07-10 21:07       ` [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace Milton Miller
  2008-07-11  6:43         ` Rusty Russell
@ 2008-07-11  7:46         ` Ingo Molnar
  2008-07-11  8:55           ` Ingo Molnar
  2008-07-11 12:34           ` Rusty Russell
  1 sibling, 2 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-07-11  7:46 UTC (permalink / raw)
  To: Milton Miller
  Cc: Stephen Rothwell, Rusty Russell, linux-kernel, linuxppc-dev,
	Ingo Molnar, linux-next, Andrew Morton


* Milton Miller <miltonm@bga.com> wrote:

> Hi Rusty, Ingo.
> 
> Rusty's patch [PATCH 3/3] stop_machine: use cpu mask rather than magic 
> numbers didn't find kernel/trace/ftrace.c in -next, causing an 
> immediate almost NULL pointer dereference in ftrace_dynamic_init.

Rusty - what's going on here? Please do not change APIs like that, which 
cause code to crash. Either do a compatible API change, or change it 
over in a way that causes clear build failures, not crashes.

	Ingo

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

* Re: [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace
  2008-07-11  7:46         ` Ingo Molnar
@ 2008-07-11  8:55           ` Ingo Molnar
  2008-07-11 12:34           ` Rusty Russell
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-07-11  8:55 UTC (permalink / raw)
  To: Milton Miller
  Cc: Stephen Rothwell, Rusty Russell, linux-kernel, linuxppc-dev,
	Ingo Molnar, linux-next, Andrew Morton


* Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Milton Miller <miltonm@bga.com> wrote:
> 
> > Hi Rusty, Ingo.
> > 
> > Rusty's patch [PATCH 3/3] stop_machine: use cpu mask rather than magic 
> > numbers didn't find kernel/trace/ftrace.c in -next, causing an 
> > immediate almost NULL pointer dereference in ftrace_dynamic_init.
> 
> Rusty - what's going on here? Please do not change APIs like that, 
> which cause code to crash. Either do a compatible API change, or 
> change it over in a way that causes clear build failures, not crashes.

ah, i see it from Rusty's other reply that there's going to be another 
version of this. Good :-)

	Ingo

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

* Re: [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace
  2008-07-11  7:46         ` Ingo Molnar
  2008-07-11  8:55           ` Ingo Molnar
@ 2008-07-11 12:34           ` Rusty Russell
  1 sibling, 0 replies; 5+ messages in thread
From: Rusty Russell @ 2008-07-11 12:34 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Stephen Rothwell, linux-kernel, Milton Miller, linuxppc-dev,
	linux-next, Andrew Morton, Ingo Molnar

On Friday 11 July 2008 17:46:03 Ingo Molnar wrote:
> * Milton Miller <miltonm@bga.com> wrote:
> > Hi Rusty, Ingo.
> >
> > Rusty's patch [PATCH 3/3] stop_machine: use cpu mask rather than magic
> > numbers didn't find kernel/trace/ftrace.c in -next, causing an
> > immediate almost NULL pointer dereference in ftrace_dynamic_init.
>
> Rusty - what's going on here? Please do not change APIs like that, which
> cause code to crash. Either do a compatible API change, or change it
> over in a way that causes clear build failures, not crashes.

To be fair, I did.  Unfortunately GCC only warns about passing an int to a 
pointer arg, and boom.

But compatible is even better.  Given the number of stop_machine_run users I 
thought it unlikely that a new one would be introduced during the change.  I 
was wrong, so I'll do it the Right Way.

Cheers,
Rusty.

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

end of thread, other threads:[~2008-07-11 12:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200807081801.38026.rusty@rustcorp.com.au>
     [not found] ` <200807081750.55536.rusty@rustcorp.com.au>
     [not found]   ` <200807081756.02838.rusty@rustcorp.com.au>
     [not found]     ` <200807081756.47140.rusty@rustcorp.com.au>
2008-07-10 21:07       ` [PATCH -next-20080709] fixup stop_machine use cpu mask vs ftrace Milton Miller
2008-07-11  6:43         ` Rusty Russell
2008-07-11  7:46         ` Ingo Molnar
2008-07-11  8:55           ` Ingo Molnar
2008-07-11 12:34           ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).