]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fd: free old file descriptor tables when not shared
authorrew <rew@FreeBSD.org>
Sun, 22 Nov 2020 05:00:28 +0000 (05:00 +0000)
committerrew <rew@FreeBSD.org>
Sun, 22 Nov 2020 05:00:28 +0000 (05:00 +0000)
commit4af6bc5d0510c1f31f8414120a81debc292dc829
tree3c1f44a3b31eb88d742b84ebbdd922eaed2f0e2d
parent1f1caa1b18594cf66c59eca81474b79015e2256f
fd: free old file descriptor tables when not shared

During the life of a process, new file descriptor tables may be allocated. When
a new table is allocated, the old table is placed in a free list and held onto
until all processes referencing them exit.

When a new file descriptor table is allocated, the old file descriptor table
can be freed when the current process has a single-thread and the file
descriptor table is not being shared with any other processes.

Reviewed by:    kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D18617
sys/kern/kern_descrip.c
tests/sys/kern/Makefile
tests/sys/kern/fdgrowtable_test.c [new file with mode: 0644]