Swatantra-66 opened a new pull request, #22348: URL: https://github.com/apache/nuttx/pull/22348
## Summary Addresses Issue #20414 In drivers/pipes/Kconfig, CONFIG_DEV_PIPE_NPOLLWAITERS currently defaults to 4 across all targets, which was added in commit 56f292fcfa for multi-threaded desktop middleware (DBus). Each pipe, FIFO, and local domain socket allocates an array of poll descriptors sized by CONFIG_DEV_PIPE_NPOLLWAITERS (d_fds in struct pipe_dev_s and stream in struct local_conn_s). On memory-constrained targets (DEFAULT_SMALL), pipes typically have at most one reader and one writer waiting simultaneously on poll events. This change sets the default of CONFIG_DEV_PIPE_NPOLLWAITERS to 2 when DEFAULT_SMALL is enabled, while keeping the default at 4 for non-small builds (!DEFAULT_SMALL). This aligns pipe poll waiters with SERIAL_NPOLLWAITERS=2 (PR #22228), EVENT_FD_NPOLLWAITERS=2, TIMER_FD_NPOLLWAITERS=2, and SIGNAL_FD_NPOLLWAITERS=2, as well as the internal fallback in pipe_common.h. Documentation for pipe driver configuration options is also updated in Documentation/os/drivers/special/pipes.rst. ## Impact - Is new feature added? No. - User: None for standard builds (!DEFAULT_SMALL retains default 4). Small builds save dynamic memory per pipe and local stream socket. - Build: Zero defconfigs in the tree configure CONFIG_DEV_PIPE_NPOLLWAITERS, so no defconfig changes are needed. - Documentation: Documented configuration options in Documentation/os/drivers/special/pipes.rst. ## Testing ### Before and After Comparison | Configuration | Target Board | Before (master) | After (this patch) | Memory Impact | | :--- | :--- | :--- | :--- | :--- | | DEFAULT_SMALL=y (32-bit) | stm32f103-minimum:adb | DEV_PIPE_NPOLLWAITERS=4 | DEV_PIPE_NPOLLWAITERS=2 | -8 B heap / pipe, -112 B / socket | | DEFAULT_SMALL=y (64-bit) | generic 64-bit small | DEV_PIPE_NPOLLWAITERS=4 | DEV_PIPE_NPOLLWAITERS=2 | -16 B heap / pipe, -192 B / socket | | DEFAULT_SMALL=n (standard) | sam4s-xplained-pro:nsh | DEV_PIPE_NPOLLWAITERS=4 | DEV_PIPE_NPOLLWAITERS=4 | Unchanged (retains 4) | ### Verification Logs Small profile configuration (stm32f103-minimum:adb): ``` $ ./tools/configure.sh -l stm32f103-minimum:adb Loaded configuration '.config' Configuration saved to '.config' $ grep -E '(CONFIG_DEFAULT_SMALL|CONFIG_DEV_PIPE_NPOLLWAITERS)' .config CONFIG_DEFAULT_SMALL=y CONFIG_DEV_PIPE_NPOLLWAITERS=2 ``` Standard profile configuration (sam4s-xplained-pro:nsh): ``` $ ./tools/configure.sh -l sam4s-xplained-pro:nsh Loaded configuration '.config' Configuration saved to '.config' $ grep -E '(CONFIG_DEFAULT_SMALL|CONFIG_DEV_PIPE_NPOLLWAITERS)' .config # CONFIG_DEFAULT_SMALL is not set CONFIG_DEV_PIPE_NPOLLWAITERS=4 ``` Code style check: ``` $ git diff --check (clean, 0 warnings / errors) ``` -- 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]
