Page MenuHomeFreeBSD

per-cpu free page caching
ClosedPublic

Authored by jeff on Mar 30 2018, 3:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 10:14 AM
Unknown Object (File)
Sun, Oct 12, 5:59 PM
Unknown Object (File)
Tue, Sep 23, 12:14 AM
Unknown Object (File)
Sep 15 2025, 11:52 AM
Unknown Object (File)
Aug 20 2025, 2:38 AM
Unknown Object (File)
Aug 18 2025, 11:05 AM
Unknown Object (File)
Aug 4 2025, 2:06 AM
Unknown Object (File)
Aug 2 2025, 4:29 AM
Subscribers

Details

Summary

This implements per-cpu free page caching only for FREEPOOL_DEFAULT. I haven't seen enough contention yet from FREEPOOL_DIRECT that it is an issue. This also brings in vm_phys_alloc_npages() which gives you as many as 'count' pages. This is an optimization to reduce round-trips to the backend phys allocator. Contrary to other instances of this patch, this is now completely compatible with reservations.

It might be more elegant to push this into vm_phys.c along with all of the vm_domain_free_lock() calls. However, pushing it there would mean the cached pages were reflected in the free count. I believe this will make us more prone to out of memory deadlocks.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vm/vm_page.c
224 ↗(On Diff #40906)

Should it be sizeof(struct vm_page *) ?

vm/vm_page.c
224 ↗(On Diff #40906)

actually in this case uma uses it as a cost function to limit the bucket size. But we override with MAXBUCKET. So it is correct to intent but unused.

This revision is now accepted and ready to land.Apr 1 2018, 4:20 AM
This revision was automatically updated to reflect the committed changes.