Skip to contentSkip to conversation

Some confusion about the period of updating new function in

DISCUSSION Minfei Huang 2 participants 3 messages Dec 11, 2015

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 11 lines · On Fri, 11 Dec 2015 18:52:42 +0800 Minfei Huang <[email protected]> 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.

Quoted 9 lines

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

#2 lore raw

Re: Some confusion about the period of updating new function in ftrace

Quoted 7 lines · Steven Rostedt
Quoted 4 lines · On Fri, 11 Dec 2015 18:52:42 +0800 Minfei Huang <[email protected]> wrote:

Hi, Steven.

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

Quoted 8 lines
Quoted 4 lines

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.

Quoted 7 lines
Quoted 7 lines

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.

Quoted 7 lines
Quoted 2 lines

[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