Re: [EDT][PATCH 1/1] hw_breakpoint.c :cpu hotplug handling

From: Will Deacon
Date: Wed May 20 2015 - 12:50:33 EST


On Mon, May 18, 2015 at 05:46:31AM +0100, Vaneet Narang wrote:
> EP-2DAD0AFA905A4ACB804C4F82A001242F
>
> On Wed, May 13, 2015 at 06:24:06AM +0100, Maninder Singh wrote:
> >> EP-2DAD0AFA905A4ACB804C4F82A001242F
> >>
> >> Subject: [PATCH 1/1] hw_breakpoint.c :cpu hotplug handling
> >>
> >> This patch adds support for CPU hotplug, It re-installl all installed watchpoints and breakpoints
> >> back on H/W in case of cpu-hot plug.
>
> >Not sure why this is needed -- the scheduler should reinstall the
> >breakpoints when the debugged task gets scheduled in via
> >arch_install_hw_breakpoint.
> >
> >Will
>
> I agree with you this reinstalling has to be either take care by scheduler
> or Debug tool.

Which debug tool? If it's a ptrace user, then the scheduler should still
manage this, as ptrace will call into perf to create the breakpoints.

> In current implementation we clear H/W registers but we don't clear slots
> (wp_on_reg / bp_on_reg) for both watchpoint or breakpoint.

Ok, so are you saying that when the CPU is hotplugged off, the active
breakpoints aren't being uninstalled by perf? I thought this would have
happened as a result of the scheduler migrating the current task away
from the dying CPU.

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/