Re: [PATCH] RFC x86_64 more accurate KSTK_ESP implementation

From: Andi Kleen
Date: Sun Nov 08 2009 - 14:38:00 EST


Ingo Molnar <mingo@xxxxxxx> writes:
>
> I'd suggest a competely different method: why dont you use an IPI to
> sample the SP whenever someone wants to read it from /proc and we see
> that the task is running on a CPU right now?

Most of /proc tends to turn into a fast path when you run the right
monitoring tools unfortunately, which poll /proc at sometimes
quite high frequencies.

I suspect you'll slow something down significantly with this approach.

The only good way to avoid that would be to use a separate file, but again
if someone really wants it they can as well just use a ptrace()
based program from user space.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/