casaroli opened a new pull request, #21130:
URL: https://github.com/apache/nuttx/pull/21130

   ## Summary
   
   In the ESP32-S3 kernel build the pages of every process come from the page 
pool, and the kernel runs in the internal SRAM. The pool was only a part of the 
PSRAM (`kernel_oct`: 4 MiB at 0x350000 of 8 MiB; `kernel_n8r2`: 1.5 MiB at 
0x80000 of 2 MiB), and the rest of the PSRAM stayed mapped in the kernel after 
the boot, where nothing used it.
   
   This PR:
   
   - gives all of the PSRAM to the pool, but its first page: to the page 
allocator the physical address 0 means "no page", so the pool starts at 0x10000 
(`kernel_oct`: 127 pages of 64 KiB; `kernel_n8r2`: 31 pages);
   - takes the whole boot-time PSRAM mapping away from the kernel in 
`up_allocate_pgheap()`, not only the part of the pool; the boot prints 
(`_info()`) the bytes of the PSRAM that are not in the pool, if any;
   - updates the comments, the `ESP32S3_PGPOOL_SCRATCH` help text and the 
`kernel_oct`/`kernel_n8r2` defconfigs.
   
   The second commit updates the ESP32-S3 and esp32s3-devkit documentation.
   
   ## Impact
   
   ESP32-S3 kernel build only (`esp32s3-devkit:kernel_oct`, 
`esp32s3-devkit:kernel_n8r2`). Processes can use all of the PSRAM. The kernel 
reaches the PSRAM only through its scratch region, as it already did for the 
pool. Other ESP32-S3 configurations and other chips do not change.
   
   ## Testing
   
   ESP32-S3-DevKitC with an ESP32-S3-WROOM-2-N32R8V, 
`esp32s3-devkit:kernel_oct` with `sandbox`, `ostest` and a test program 
`pgfill` in the boot ROMFS (`pgfill N 400`: N child processes each fill 400 KiB 
of heap with their own pattern, wait for each other, then check every byte; a 
`fork()` that fails with `ENOMEM` ends the test as "pool full"):
   
   | Test | master | this PR |
   |---|---|---|
   | page pool (`free`, `Page` line) | 4194304 bytes (64 pages) | 8323072 bytes 
(127 pages) |
   | `pgfill 16 400` | pool full after 3 children; data intact | pool full 
after 9 children; data intact |
   | `sandbox` (own data; kernel memory, a peripheral register and an unmapped 
address must fault) | CONTAINED | CONTAINED |
   | `ostest` | status 0 | status 0 |
   
   Build, each OK: esp32s3-devkit:kernel_oct, esp32s3-devkit:kernel_n8r2 
(kernel), esp32s3-devkit:knsh (protected), esp32s3-devkit:nsh (flat).
   
   `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]

Reply via email to