Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

Josh Poimboeuf
2015-02-12T15:24:34Z

On Thu, Feb 12, 2015 at 03:08:38PM +0100, Jiri Kosina wrote:
> On Thu, 12 Feb 2015, Peter Zijlstra wrote:
> I personally am not a big fan of the task_rq_lock() public exposure
> either. What might be generally useful though (not only for livepatching)
> would be an API that would allow for "safe" stack dump (where "safe" means
> that guarantee, that it wouldn't be interferred by process waking up in
> the middle of dumping, would be provided).

In general, I think a safe stack dump is needed. A lot of the stack
dumping in the kernel seems dangerous. For example, it looks like doing
a `cat /proc/pid/stack` while the process is writing the stack could
easily go off into the weeds.

But I don't see how it would help the livepatch case. What happens if
the process starts running in the to-be-patched function after we call
the "safe" dump_stack() but before switching it to the new universe?

--
Josh