casaroli opened a new pull request, #20600: URL: https://github.com/apache/nuttx/pull/20600
## Summary The granule allocator counted granules in `uint16_t`: the number of granules, the free count and the largest free run, also in `struct graninfo_s` and `struct pginfo_s`. A pool had at most 65535 granules, so the page pool of a kernel build was limited to less than 256 MiB with 4 KiB pages, and a larger pool failed in `gran_initialize()`. This PR counts granules in `uint32_t`. `gran_initialize()` now rejects only an empty pool, and `sched_sysinfo()` casts the page count before the shift. ## Impact Granule pools and page pools larger than 65535 granules work. `struct graninfo_s` and `struct pginfo_s` change their field types (wider), which only matters to code that stores them in 16-bit variables. ## Testing The run-time tests ran on a local branch that has this change and other pending changes on top of master; the builds are of this branch alone. qemu-armv8a, kernel build, QEMU 11 with HVF, `-m 1G`, a local configuration with an 896 MiB page pool (229376 pages of 4 KiB). The system boots and `/proc/meminfo` shows the whole pool: `939524096 ... Page`. Before the change, `gran_initialize()` cannot hold more than 65535 granules. Builds with `-Wno-cpp -Werror`: `qemu-armv8a:knsh`, `rv-virt:knsh64`, `sabre-6quad:netknsh`, `qemu-armv7a:knsh`. `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
