In the search for free space, do not examine the same free list set more than once, since several segments can have the same free list set.
Details
- Reviewers
alc markj - Commits
- rG342056fa1c7a: vm_phys: alloc pages without duplicating searches.
I can't test right now, so hopefully this is foolproof-ly simple.
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Change the process of stringing together free blocks to satisfy a request to allow smaller blocks at the beginning and end of the sequence. When a free block is not part of a large enough range to satisfy the request, move the largest free blocks in the sequence in their free list so that they aren't encountered more than once in the search. When a request for a number of pages less then the maximum block size cannot be satisfied with a single free block, try to piece a sequence of smaller free blocks together before giving up.
I got this panic from a contigmalloc() test:
panic: vm_phys_enq_range: page 0xfffffe0031509980 and npages 2048 are misaligned
Oh, yes. I've been running tests with D33947.104249.patch for more than a day. Still about 24 hours left.
vm_phys_alloc_seg_contig() will ignore runs of pages that aren't contained in the range [seg->start, seg->end], so doesn't this change potentially cause us to skip over eligible runs?
Yes, you are correct. Nonetheless, we are currently iterating over the same free list for each segment that references it. I would suggest changing vm_phys_alloc_seg_contig to take the free list rather than the seg as its first parameter. When it needs the seg, it can derive it from the selected page.
Yes. I agree. I had addressed that once, before I stripped this patch down too far. I'll reintroduce the changes that address that.
I'm almost done with testing the D33947.104303.patch. No problems seen so far. A full stress2 test takes two days to complete.
The reporter of this bug:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274592
has offered experimental evidence that this change is responsible for that bug.