Re: debugctl msr

From: Markus Metzger
Date: Wed Nov 19 2008 - 17:26:34 EST


On Wed, 2008-11-19 at 20:20 +0100, stephane eranian wrote:

> Yes, I have narrowed this down to the following lines:
> current->mm->total_vm -= context->pages[qual];
> current->mm->locked_vm -= context->pages[qual];
>
> I think this is again related to the problem of which thread call
> ds_release(). In my test
> case, this is the monitored thread as it exits. By the time it gets
> there current->mm is NULL.

Yes, this is again the ptrace-ness of the approach. The entire code
assumes that there is one tracer task that controls another traced task.

You're right, though, that I should only do the memory accounting
if the buffer had been allocated by ds.c.
That's a plain bug. Perfmon2 is the first user that uses its own
buffers.


> > The point I was trying to make is that buffer overflows should not be
> > handled on higher levels (i.e. users of ds.c). That's why I am so
> > reluctant to expose the interrupt threshold in the ds.c interface.
> >
> But the threshold is a characteristic of the buffer, not the interrupt handler.
> Depending on the tool, it may be interesting to set the threshold earlier than
> at the end of the buffer.

Good point.

Would you want to change the threshold or would it be OK if this became
another parameter to ds_request()?

regards,
markus.

--
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/