-
Notifications
You must be signed in to change notification settings - Fork 643
Two performance improvements when recording wine #1777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/preload/preload.c
Outdated
| if (set && (how == SIG_BLOCK || how == SIG_SETMASK)) { | ||
| local_memcpy(&modified_set, set, sizeof(kernel_sigset_t)); | ||
| // SIGSTKFLT (PerfCounters::TIME_SLICE_SIGNAL) and | ||
| // SIGPWR(SYSCALLBUF_DESCHED_SIGNAL) are used by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"by rr"
|
Looks good! |
|
This causes a number of test failures... |
|
Oops, sorry. I will take a look. |
|
|
|
Ah yes, of course. Should have realized that (well, should have remembered that I realized that ;)). This gets our understanding of which signals are blocked out of whack, which as we learned before is a bad idea. I had thought about using an extra thread-local field to hold a copy of the current sigmask that rr can reload when it needs to. Thoughts? |
|
This looks like it should be easy but it's not :-( |
|
ah right. I thought about that and then forgot about it. |
|
The way we handle this for |
|
that could work, but I don't think it needs to be that fancy, because we don't really need to know the full history. |
|
Storing a signal mask in |
|
Maybe stick it in |
|
Unless I'm missing something, we can't put this in |
|
It can go in |
|
Ok, try this. Passed tests for me, but I'm running them again just to be sure ;). Also GitHub appears to be confused by me having put a newer commit in front of the older ones, but in the actual git history they should be in proper order. |
In preparation of being able to buffer system calls that affect the signal mask, keep a copy of blocked_sigs in syscallbuf_hdr, save it whenever modified due to an event not visible to preload, and reload it whenever queried whether a particular signal is blocked.
…state A priori, there's nothing wrong with keeping the existing TLS descriptor if the VM is forked, since the two threads won't clobber each other. This fixes a performance problem in single threaded processes that fork (where thread locals get initialized only because of the preload library), since the forked process would never set a new TLS descriptor.
|
Found one small thing, but now should be good to go. |
|
Merged. Thanks!!! |
|
My pleasure as always ;). |
First add syscall buffering for rt_sigprocmask, second if a clone forks the address space, keep the state of thread local initialization since there won't be an explicit re-initialization (and without this the syscallbuf is effectively disabled).