jingfei195887 opened a new pull request, #21889:
URL: https://github.com/apache/nuttx/pull/21889
## Summary
- **procfs/mempool: remove unnecessary dependencies about /proc/mempool.**
`/proc/mempool` lists every pool registered through
`mempool_procfs_register()`, which `mempool_init()` calls for any mempool
(IOB, network buffers, drivers), not only for the heap's multi-level
mempool. The procfs table entry was guarded by `CONFIG_MM_HEAP_MEMPOOL`,
and `FS_PROCFS_EXCLUDE_MEMPOOL` depended on
`MM_HEAP_MEMPOOL_THRESHOLD > 0`. With the heap mempool off,
`mempool_procfs.c` was still built, but the file did not exist. Guard the
entry with `FS_PROCFS_EXCLUDE_MEMPOOL` only, and let that option depend
on `FS_PROCFS` only.
## Impact
- New feature / API change: NO.
- Behavior: `/proc/mempool` is now present whenever procfs is enabled and
`FS_PROCFS_EXCLUDE_MEMPOOL` is not set, also without the heap mempool.
- Build: `FS_PROCFS_EXCLUDE_MEMPOOL` keeps `default DEFAULT_SMALL`, so small
configurations still leave it out. `mempool_procfs.c` was already built
in these configurations; the change adds one procfs table entry.
- Hardware, documentation, security, compatibility: NO.
## Testing
Host: Ubuntu x86_64, gcc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, master
4bf334e462.
`sim:nsh` (procfs on, `MM_HEAP_MEMPOOL_THRESHOLD` at its default -1):
Testing logs before change:
```
nsh> ls /proc
cpuinfo
fs/
memdump
meminfo
self/
tcbinfo
uptime
version
nsh> cat /proc/mempool
nsh: cat: Could not open /proc/mempool (is procfs mounted?)
```
Testing logs after change:
```
nsh> ls /proc
cpuinfo
fs/
memdump
meminfo
mempool
self/
tcbinfo
uptime
version
nsh> cat /proc/mempool
total bsize nused nfree nifree nwaiter
```
- `./tools/checkpatch.sh -g master..HEAD`: all checks pass.
- `sim:nsh` Make and CMake builds pass with no new warnings; `ostest` exits
with status 0.
- Verified on sim only.
## PR verification Self-Check
* [x] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines and Documentation (git commit
title and message, coding standard, etc).
* [ ] My PR is still work in progress (not ready for review).
* [x] My PR is ready for review and can be safely merged into a codebase.
--
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]