Page MenuHomeFreeBSD

Test and set ranges of reservation population bits at once
AbandonedPublic

Authored by dougm on May 17 2019, 8:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 26 2024, 12:21 PM
Unknown Object (File)
Jan 22 2024, 3:03 PM
Unknown Object (File)
Jan 1 2024, 6:42 AM
Unknown Object (File)
Dec 4 2023, 12:53 PM
Unknown Object (File)
Nov 18 2023, 1:13 PM
Unknown Object (File)
Nov 18 2023, 1:12 PM
Unknown Object (File)
Nov 18 2023, 10:26 AM
Unknown Object (File)
Nov 18 2023, 9:49 AM
Subscribers

Details

Reviewers
None
Summary

A loop in vm_reserv_extend_contig checks bits one-by-one to ensure that all are zero. This change makes the checking up to 64 bits at a time. Other loops populate the reservation one item at a time. This change allows populating a range of pages at once.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

$ cc -c -O0 -pipe -fno-strict-aliasing  -g -nostdinc  -I. -I../../.. -I../../../contrib/ck/include -I../../../contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h    -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD  -MF.depend.vm_reserv.o -MTvm_reserv.o -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -Werror  ../../../vm/vm_reserv.c
../../../vm/vm_reserv.c:181:34: error: & has lower precedence than ==; == will be evaluated first [-Werror,-Wparentheses]
             i < end / NBPOPMAP && mask & popmap[i] == 0;
                                        ^~~~~~~~~~~~~~~~
../../../vm/vm_reserv.c:181:34: note: place parentheses around the '==' expression to silence this warning
             i < end / NBPOPMAP && mask & popmap[i] == 0;
                                        ^
                                          (             )
../../../vm/vm_reserv.c:181:34: note: place parentheses around the & expression to evaluate it first
             i < end / NBPOPMAP && mask & popmap[i] == 0;
                                        ^
                                   (               )
../../../vm/vm_reserv.c:188:15: error: & has lower precedence than ==; == will be evaluated first [-Werror,-Wparentheses]
        return (mask & popmap[i] == 0);
                     ^~~~~~~~~~~~~~~~
../../../vm/vm_reserv.c:188:15: note: place parentheses around the '==' expression to silence this warning
        return (mask & popmap[i] == 0);
                     ^
                       (             )
../../../vm/vm_reserv.c:188:15: note: place parentheses around the & expression to evaluate it first
        return (mask & popmap[i] == 0);
                     ^
                (               )
2 errors generated.
$ 
dougm edited the summary of this revision. (Show Details)

Populate page ranges, rather than individual pages.

dougm retitled this revision from Let vm_reserv_extend_contig check for 0-bits 64 at a time to Test and set ranges of reservation population bits at once.May 18 2019, 2:52 AM

Drop unused index variables.

With D20299.57518.diff I see

$ cc -c -O0 -pipe -fno-strict-aliasing  -g -nostdinc  -I. -I../../.. -I../../../contrib/ck/include -I../../../contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h    -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD  -MF.depend.vm_reserv.o -MTvm_reserv.o -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -Werror  ../../../vm/vm_reserv.c
../../../vm/vm_reserv.c:677:11: error: & has lower precedence than ==; == will be evaluated first [-Werror,-Wparentheses]
                    (pa & (alignment - 1) == 0) &&
                        ^~~~~~~~~~~~~~~~~~~~~~
../../../vm/vm_reserv.c:677:11: note: place parentheses around the '==' expression to silence this warning
                    (pa & (alignment - 1) == 0) &&
                        ^
                          (                   )
../../../vm/vm_reserv.c:677:11: note: place parentheses around the & expression to evaluate it first
                    (pa & (alignment - 1) == 0) &&
                        ^
                     (                   )
1 error generated.
$ 

I ran tests on D20299.57522.diff for five hours without seeing any problems.