linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Some confusion about the period of updating new function in
@ 2015-12-11 10:52 Minfei Huang
  2015-12-11 14:22 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Minfei Huang @ 2015-12-11 10:52 UTC (permalink / raw)
  To: rostedt; +Cc: mhuang, linux-kernel

ftrace
Reply-To: 

Hi, Steven.

There is a confusion which blocks my step to go further for ftrace.

Does ftrace guarantee that the replaced function is finished while
ftrace is replacing the functions? In the other word, is there a
possible that new function starts to run, while old function is also
running (maybe this function is called before replacing the function).

Function schedule_on_each_cpu maybe fails to excute, if there is no
enough memory to be allocated? Then kernel may be unstable, if ftrace
continues, without handling the error, does it?

Previously, I posted a patch to fix this issue, and you nacked it.

[PATCH] workqueue: Add the allocation flags to function
schedule_on_each_cpu_gfp

Thanks
Minfei

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

* Re: Some confusion about the period of updating new function in
  2015-12-11 10:52 Some confusion about the period of updating new function in Minfei Huang
@ 2015-12-11 14:22 ` Steven Rostedt
  2015-12-11 14:46   ` Some confusion about the period of updating new function in ftrace Minfei Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2015-12-11 14:22 UTC (permalink / raw)
  To: Minfei Huang; +Cc: mhuang, linux-kernel

On Fri, 11 Dec 2015 18:52:42 +0800
Minfei Huang <mnfhuang@gmail.com> wrote:

> ftrace
> Reply-To: 
> 
> Hi, Steven.
> 
> There is a confusion which blocks my step to go further for ftrace.
> 
> Does ftrace guarantee that the replaced function is finished while
> ftrace is replacing the functions? In the other word, is there a
> possible that new function starts to run, while old function is also
> running (maybe this function is called before replacing the function).

No there is no such guarantee. That is up to the function callbacks to
handle themselves.

> 
> Function schedule_on_each_cpu maybe fails to excute, if there is no
> enough memory to be allocated? Then kernel may be unstable, if ftrace
> continues, without handling the error, does it?
> 
> Previously, I posted a patch to fix this issue, and you nacked it.
> 
> [PATCH] workqueue: Add the allocation flags to function
> schedule_on_each_cpu_gfp

Ah that patch. Actually __GFP_NOFAIL is pretty much deprecated. The
real solution is to manually do the schedule on each CPU.

I can whip up a patch for that.

-- Steve


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

* Re: Some confusion about the period of updating new function in ftrace
  2015-12-11 14:22 ` Steven Rostedt
@ 2015-12-11 14:46   ` Minfei Huang
  0 siblings, 0 replies; 3+ messages in thread
From: Minfei Huang @ 2015-12-11 14:46 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: mhuang, linux-kernel

On 12/11/15 at 09:22P, Steven Rostedt wrote:
> On Fri, 11 Dec 2015 18:52:42 +0800
> Minfei Huang <mnfhuang@gmail.com> wrote:
> 
> > Hi, Steven.
> > 
> > There is a confusion which blocks my step to go further for ftrace.
> > 
> > Does ftrace guarantee that the replaced function is finished while
> > ftrace is replacing the functions? In the other word, is there a
> > possible that new function starts to run, while old function is also
> > running (maybe this function is called before replacing the function).
> 
> No there is no such guarantee. That is up to the function callbacks to
> handle themselves.
> 

Got it.

> > 
> > Function schedule_on_each_cpu maybe fails to excute, if there is no
> > enough memory to be allocated? Then kernel may be unstable, if ftrace
> > continues, without handling the error, does it?
> > 
> > Previously, I posted a patch to fix this issue, and you nacked it.
> > 
> > [PATCH] workqueue: Add the allocation flags to function
> > schedule_on_each_cpu_gfp
> 
> Ah that patch. Actually __GFP_NOFAIL is pretty much deprecated. The
> real solution is to manually do the schedule on each CPU.
> 
> I can whip up a patch for that.

Thanks for your explanation.

Thanks
Minfei

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

end of thread, other threads:[~2015-12-11 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-11 10:52 Some confusion about the period of updating new function in Minfei Huang
2015-12-11 14:22 ` Steven Rostedt
2015-12-11 14:46   ` Some confusion about the period of updating new function in ftrace Minfei Huang

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).