You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "casaroli (via GitHub)" <gi...@apache.org> on 2026/10/11 18:57:39 UTC
[PR] mm/mm_gran: Count granules in 32 bits. [nuttx]
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] mm/mm_gran: Count granules in 32 bits. [nuttx]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20600:
URL: https://github.com/apache/nuttx/pull/20600#issuecomment-6112600493
<!-- membrowse-pr-comment -->
## <img src="https://membrowse.com/membrowse-logo.svg" height="24" align="top"> MemBrowse Memory Report
*No memory changes detected for:*
- [arduino-mega2560](https://membrowse.com/public/apache/nuttx/target/arduino-mega2560/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [esp32-devkitc](https://membrowse.com/public/apache/nuttx/target/esp32-devkitc/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [hifive1-revb](https://membrowse.com/public/apache/nuttx/target/hifive1-revb/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [mirtoo](https://membrowse.com/public/apache/nuttx/target/mirtoo/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [qemu-armv8a](https://membrowse.com/public/apache/nuttx/target/qemu-armv8a/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [qemu-intel64](https://membrowse.com/public/apache/nuttx/target/qemu-intel64/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [rx65n-rsk2mb](https://membrowse.com/public/apache/nuttx/target/rx65n-rsk2mb/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [s698pm-dkit](https://membrowse.com/public/apache/nuttx/target/s698pm-dkit/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
- [stm32-nucleo-f103rb](https://membrowse.com/public/apache/nuttx/target/stm32-nucleo-f103rb/compare?head=96ba9f0bc6a050afd961ae86608fe6e76bf28e12&base=4bc1ab2fd7bede547e91c8e3a7dac3bd6eb941f7)
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] mm/mm_gran: Count granules in 32 bits. [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #20600:
URL: https://github.com/apache/nuttx/pull/20600
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org