-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull up following revision(s) (requested by riastradh in ticket #1755):
sys/kern/subr_thmap.c: revision 1.14 sys/kern/subr_thmap.c: revision 1.15 thmap(9): Test alloc failure, not THMAP_GETPTR failure. THMAP_GETPTR may return nonnull even though alloc returned zero. Note that this failure branch is not actually appropriate; thmap_create should not fail. We really need to pass KM_SLEEP through in this call site even though there are other call sites for which KM_NOSLEEP is appropriate. Adapted from: rmind/thmap#14 PR kern/57666 rmind/thmap#13 thmap(9): Preallocate GC list storage for thmap_del. thmap_del can't fail, and it is used in places in npf where sleeping is forbidden, so it can't rely on allocating memory either. Instead of having thmap_del allocate memory on the fly for each object to defer freeing until thmap_gc, arrange to have thmap(9) preallocate the same storage when allocating all the objects in the first place, with a GC header. This is suboptimal for memory usage, especially on insertion- and lookup-heavy but deletion-light workloads, but it's not clear rmind's alternative (https://github.com/rmind/thmap/tree/thmap_del_mem_fail) is ready to use yet, so we'll go with this for correctness. PR kern/57208 rmind/npf#129
- Loading branch information
1 parent
6892c23
commit dd47b3c
Showing
1 changed file
with
57 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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