tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
re: Problem with syscall_disestablish() - PR kern/50430
On Tue, 17 Nov 2015, matthew green wrote:
there's a fairly significant problem with this implementation.
you're only catching callers who use end up going through sy_call()
and that's not the majority. mostly they're called directly from
MD code. so to fix that, you have to update every platform syscall
handler.
Ah, I see. I'll have to investigate further.
it also slows down normal operation adding branches and data access
to the call path of every system call. and bloats struct lwp and
more.
i don't think it's worth paying that for what feature that isn't
really useful to anyone. (sure, it's useful for you when you're
modifying the calls perhaps, but that comes down to the case of
don't shoot yourself in the foot and unload something you're
still using/testing.)
This is actually more oriented to modules that are going to get auto-
unloaded. For example, we can (attempt to) load a large list of
compat modules in the hope of getting one that can handle an unknown
emulation/execsw. It's really nice for (most of) those to just "go
away" if they're not really used. But you need to be able to make
that determination.
however, it looks like this *should* already be handled by
platforms that do use sy_call() directly, and could be fixed on
everywhere else by simply setting l_sysent the same way. that's
what the setting of l_sysent does -- "this is the system call i'm
currently actively running" -- and syscall_disestablish() checks
this correctly already.
The problem I'm attempting to address is when syscall #1 is blocked,
some signal gets delivered to the lwp, and the signal handler calls some
other syscall #2. In that case, the single l_sysent gets overwritten
and we now have no record that syscall #1 is still active.
+------------------+--------------------------+-------------------------+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+-------------------------+
Home |
Main Index |
Thread Index |
Old Index