Re: context tracking vs. syscall_trace_leave & do_notify_resume loop

From: Andy Lutomirski
Date: Fri May 01 2015 - 11:55:47 EST


On Thu, Apr 30, 2015 at 6:30 PM, Rik van Riel <riel@xxxxxxxxxx> wrote:
> Andy pointed out to me something I should have seen earlier: both
> syscall_trace_leave and do_notify_resume call both user_exit()
> and user_enter(), which has the potential to greatly increase the
> cost of context tracking.
>
> I believe (though it is hard to know for sure) there are legitimate
> reasons why there is a loop around syscall_trace_leave and
> do_notify_resume, but I strongly suspect the context tracking code
> does not need to be in that loop.
>
> I suspect it would be possible to stick a call to a new function
> (return_to_user ?) right after the DISABLE_INTERRUPTS below, which
> could be used to do the context tracking user_enter just once, and
> later on also to load the user FPU context (patches I have sitting
> around).
>
> syscall_return:
> /* The IRETQ could re-enable interrupts: */
> DISABLE_INTERRUPTS(CLBR_ANY)
> TRACE_IRQS_IRETQ
>
> Andy, Denys, do you guys see any issues with that idea?

Ick. Let's make the mess better before we make it worse. Now that
Denys disentangled the syscall exit path from the interrupt exit path,
let me see if I can just rewrite the syscall exit path entirely later
this week.
'
--Andy
--
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/