portal: bulk process-tree walk (OSI_PROC_ALL) + syscall_event pid denormalization#88
Open
lacraig2 wants to merge 1 commit into
Open
portal: bulk process-tree walk (OSI_PROC_ALL) + syscall_event pid denormalization#88lacraig2 wants to merge 1 commit into
lacraig2 wants to merge 1 commit into
Conversation
… into syscall_event
New op HYPER_OP_OSI_PROC_ALL walks for_each_process under rcu_read_lock and
returns a slim osi_proc_node {pid, ppid, create_time, uid/gid/euid/egid,
comm[16]} per user process in one paginated, RCU-consistent transaction. The
host was otherwise issuing one HYPER_OP_OSI_PROC per pid to build a process
tree -- 1+N round-trips (the portal region is a single page) and a snapshot
that can tear between the per-pid reads. comm comes from task->comm (kernel
memory only) and !mm tasks (kthreads) are skipped, so it never touches
userspace and is safe against exiting/stopped contexts. Auto-wired via the
portal_op_list X-macro (enum + dispatch + prototype).
Also denormalize current->pid and current->start_time into struct
syscall_event, populated at fire time. Host-side syscall consumers (e.g.
process-tree exit tracking) can then identify the task straight off the event
with zero extra round-trips and without reading the dying task's memory.
Compiles for 4.10 + 6.13 across armel/arm64/x86_64. osi_proc_node layout and
the new syscall_event fields verified identical in the emitted DWARF on both
kernel versions, and exercised live in an armel/6.13 guest.
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two additions to the portal OSI/syscall interface, in support of penguin epic B slice 1 (a queryable guest process-tree model — see rehosting/penguin).
1.
HYPER_OP_OSI_PROC_ALL— kernel-side bulk process walkWalks
for_each_processunderrcu_read_lockand returns a slimosi_proc_nodeper user process in one paginated transaction:Why: to build a process tree the host was issuing one
HYPER_OP_OSI_PROCper pid (get_proc_handles+ N×get_proc) —1 + Nround-trips over a single-page portal region, and a snapshot that can tear as processes come and go between the per-pid reads. This is one RCU-consistent snapshot inceil(N/72)transactions.Safety:
commcomes fromtask->comm(kernel memory only) and!mmtasks (kernel threads) are skipped, so it never callsaccess_remote_vmand is safe against exiting/stopped contexts. Kernel-thread enumeration is intentionally deferred.Auto-wired through the
portal_op_list.hX-macro (enum + dispatch + prototype); handler mirrorshandle_op_osi_proc_handles/handle_op_read_fds.2.
pid/create_timedenormalized intostruct syscall_eventSet from
currentat fire time. Host-side syscall consumers (e.g. process-tree exit tracking) can identify the task directly off the event — zero extra round-trips, and no read of a dying task's memory.Validation
osi_proc_nodelayout (size 56, field offsets) and the newsyscall_eventfields verified identical in the emitted DWARF on both kernel versions.OSI_PROC_ALLreturns correct pid/ppid/comm with proper genealogy; exit tracking viasyscall_event.pidrecords exits correctly.Consumer
rehosting/penguin will add
osi.get_all_procs()+ aprocessesplugin and bumpIGLOO_DRIVER_VERSIONto a release carrying this op.