]> Zhao Yanbai Git Server - minix.git/commit
PM: generic process event publish/subscribe system 61/3261/3
authorDavid van Moolenbroek <david@minix3.org>
Sat, 12 Dec 2015 17:22:00 +0000 (17:22 +0000)
committerLionel Sambuc <lionel.sambuc@gmail.com>
Sat, 16 Jan 2016 13:04:10 +0000 (14:04 +0100)
commit910831cb5ca62d66feb4e9664745910bbf5c03e1
tree94e92f88eeeb325ea2fe2465e9c6f02632c04e43
parent0baafa0ef4760fc6c0d2e86ae5f07c8acb9cd272
PM: generic process event publish/subscribe system

Now that there are services other than PM and VFS that implement
userland system calls directly, these services may need to know about
events related to user processes.  In particular, signal delivery may
have to interrupt blocking system calls, and certain cleanup tasks may
have to be performed after a user process exits.

This patch aims to implement a generic, lasting solution for this
problem, by allowing services to subscribe to "signal delivered"
and/or "process exit" events from PM.  PM publishes such events by
sending messages to its subscribed services, which must then reply an
acknowledgment message.

For now, only the two aforementioned events are implemented, and only
the IPC service makes use of the process event facility.

The new process event publish/subscribe system replaces the previous
VM notify-sig/watch-exit/query-exit system, which was unsound: 1) it
allowed subscription to events from individual processes, and suffered
from fundamental race conditions as a result; 2) it relied on "not too
many" processes making use of the IPC server functionality in order to
avoid loss of notifications.  In addition, it had the "ipc" process
name hardcoded, did not distinguish between signal delivery and exits,
and added a roundtrip to VM for all events from all processes.

Change-Id: I75ebad4bc54e646c6433f473294cb4003b2c3430
31 files changed:
etc/system.conf
minix/commands/service/parse.c
minix/include/minix/callnr.h
minix/include/minix/com.h
minix/include/minix/ipc.h
minix/include/minix/syslib.h
minix/include/minix/vm.h
minix/lib/libsys/Makefile
minix/lib/libsys/proceventmask.c [new file with mode: 0644]
minix/lib/libsys/vm_notify_sig.c [deleted file]
minix/lib/libsys/vm_query_exit.c [deleted file]
minix/servers/ipc/inc.h
minix/servers/ipc/ipc.conf
minix/servers/ipc/main.c
minix/servers/ipc/sem.c
minix/servers/pm/Makefile
minix/servers/pm/const.h
minix/servers/pm/event.c [new file with mode: 0644]
minix/servers/pm/forkexit.c
minix/servers/pm/main.c
minix/servers/pm/mproc.h
minix/servers/pm/proto.h
minix/servers/pm/signal.c
minix/servers/pm/table.c
minix/servers/pm/trace.c
minix/servers/pm/utility.c
minix/servers/vm/Makefile
minix/servers/vm/main.c
minix/servers/vm/proto.h
minix/servers/vm/queryexit.c [deleted file]
minix/servers/vm/vmproc.h