[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacing IPC tables with radix trees (was: VM cache policy change)

From: Justus Winter
Subject: Replacing IPC tables with radix trees (was: VM cache policy change)
Date: Fri, 27 Mar 2015 12:30:47 +0100
User-agent: alot/0.3.5

Quoting Justus Winter (2015-02-24 17:15:22)
> Quoting Samuel Thibault (2015-02-24 01:04:19)
> > I tried to start a gcc-5 build, it gets stuck at the tar x stage, with
> > gnumach printing:
> > 
> > no more room for vm_map_find_entry in 80223e20 (kmem_map_store)
> > no more room for kmem_realloc in 80223e20 (kmem_map_store)
> >[...]
> > ipc_port              0010      80   4k    50 262239 262350   20988k        
> >   0k
> kmem_realloc is only used to enlarge the ipc tables, but this is not
> due to the lack of space, but due to the lack of a sufficiently large
> continuous chunk of the kernel address space.
> As demonstrated by the attached program the maximum number of ports a
> task can have seems to be around 250000, which doesn't seem like a
> lot.
> % ./test
> ./test: mach_port_allocate (last good name: 242175): (os/kern) resource 
> shortage
> This suggests that we need a different data structure that doesn't
> depend on a continuous chunk of memory.

I have replaced the IPC tables (and the reverse hash tables, which
were intertwined with the tables) with radix trees.  It seems to be
working, but it needs some more cleanups, commit messages, and some
adjustments of the debug interface (which I assume I can change
freely, right?).  The patches are here:


I haven't had a chance to assess the performance impact.

This change raises the number of ports that a task can allocate to
~950000.  Unfortunately, if the kernel runs out of space, it now
simply crashes instead of returning KERN_NO_SPACE.

Here are the relevant parts of /proc/slabinfo, before the allocation
of 950000 ports and after that:

root@debian:~# head -n1 /proc/slabinfo
cache                          obj slab  bufs   objs   bufs    total reclaimable
root@debian:~# egrep 'ipc_entry|rdxtree_node' /proc/slabinfo
rdxtree_node          0010     280   4k    14   2995   3108     888k         24k
ipc_entry             0010      16   4k   254   4231   4572      72k          4k
root@debian:~# egrep 'ipc_entry|rdxtree_node' /proc/slabinfo
rdxtree_node          0010     280   4k    14  18151  18200    5200k         12k
ipc_entry             0010      16   4k   254 954283 954532   15032k          0k


reply via email to

[Prev in Thread] Current Thread [Next in Thread]