[RFC][PATCH][kprobe] enabling booster on the preemptible kernel, take 2
bibo,mao
bibo.mao@intel.com
Fri Nov 3 09:16:00 GMT 2006
Masami Hiramatsu wrote:
> Hi Bibo,
>
> bibo mao wrote:
> > I am not familiar with freeze_processes(), I only view code.
> > And I write simple program(though buggy) to test:
> [...]
> > it seems that many threads are not frozen even freeze_processes
> > return 0.
>
> I think the most important issue is whether those threads are
> preempted (suddenly scheduled out) or not.
> Those preempted threads might be preempted on the instruction
> buffer or on the middle of the target instructions. In that
> case, we cannot free the buffer or overwrite a jump code.
> But, if those threads are sleeping at the known places, we can
> ensure safety of freeing/overwriting.
> Therefore, I think it is necessary to check whether all
> non-frozen threads are sleeping or not, like as below;
I think that will be ok, it will be safe to free jump buffer
at that time.
thanks
bibo,mao
> ---------------------------------------
> int check_safety(void)
> {
> int ret = 0;
> struct task_struct *g, *p;
> if (freeze_processes()) {
> goto Thaw;
> }
> do_each_thread(g, p) {
> if (frozen(p))
> continue;
> if (p->state == TASK_RUNNING) {
> ret = -EAGAIN;
> break;
> }
> } while_each_thread(g, p);
> Thaw:
> thaw_processes();
> return ret;
> }
>
>
> Thanks,
>
>
> --
> Masami HIRAMATSU
> Linux Technology Center
> Hitachi, Ltd., Systems Development Laboratory
> E-mail: masami.hiramatsu.pt@hitachi.com
>
More information about the Systemtap
mailing list