lkml.org 
[lkml]   [2015]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectcontext tracking vs. syscall_trace_leave & do_notify_resume loop
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?

I realize that would mean a RESTORE_EXTRA_REGS after that call
to return_to_user(), but it looks like that could be achieved
without making the code any worse than it already is :)

--
All rights reversed


\
 
 \ /
  Last update: 2015-05-01 03:41    [W:0.061 / U:23.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site