Repository navigation
drivers/serial: reduce default SERIAL_NPOLLWAITERS for DEFAULT_SMALL - #22228
Open
Swatantra-66 wants to merge 1 commit into
Open
Swatantra-66 wants to merge 1 commit into
Swatantra-66 wants to merge 1 commit into
Conversation
Swatantra-66
requested review from
GUIDINGLI,
jerpelea and
xiaoxiang781216
as code owners
November 23, 2026 18:00
|
Swatantra-66
force-pushed
the
fix/serial-npollwaiters-default-small
branch
from
November 24, 2026 07:18
fd59245 to
747c4b3
Compare
xiaoxiang781216
previously approved these changes
Nov 24, 2026
GUIDINGLI
previously approved these changes
Nov 24, 2026
jerpelea
previously approved these changes
Nov 24, 2026
Change CONFIG_SERIAL_NPOLLWAITERS default from 4 to 2 across all configurations. Most serial applications only poll stdin for POLLIN and do not require 4 simultaneous poll waiter slots. Reducing CONFIG_SERIAL_NPOLLWAITERS from 4 to 2 eliminates two pollfd pointer entries from struct uart_dev_s, saving 8 bytes of RAM per allocated serial port on 32-bit architectures (16 bytes on 64-bit architectures), and 16 bytes total on stm32f103-minimum:nsh. Also refresh existing board defconfigs where CONFIG_SERIAL_NPOLLWAITERS=2 was explicitly set to avoid defconfig normalization warnings in CI. Assisted-by: Claude:claude-opus-4.6 Signed-off-by: Swatantra Yadav <maverickswatantra@gmail.com>
Swatantra-66
dismissed stale reviews from jerpelea, GUIDINGLI, and xiaoxiang781216
via
November 24, 2026 17:56
8ef99c5
Swatantra-66
force-pushed
the
fix/serial-npollwaiters-default-small
branch
from
November 24, 2026 17:56
747c4b3 to
8ef99c5
Compare
Swatantra-66
requested review from
acassis,
masayuki2009 and
pussuw
as code owners
November 24, 2026 17:56
Contributor
Author
|
removed redundant CONFIG_SERIAL_NPOLLWAITERS=2 from the existing board defconfigs (imx93-evk, mpfs/icicle, esp32 devkitc:wamr_wasi_debug) so defconfig normalization passes cleanly in CI without leaving uncommitted changes. |
xiaoxiang781216
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses Issue #20414 (
[HELP] Improve NuttX bloated size).Change
CONFIG_SERIAL_NPOLLWAITERSdefault from4to2across all configurations per review suggestion by (@xiaoxiang781216 )Serial ports (such as console or telemetry UARTs) rarely have more than two threads simultaneously polling or selecting on the same file descriptor.
In
include/nuttx/serial/serial.h,struct uart_dev_scarries an array of poll descriptor pointers:Reducing
CONFIG_SERIAL_NPOLLWAITERSfrom4to2eliminates two pointer entries per allocated serial device:g_usart1devin.data/.bss).Code Size Impact
Measured on
stm32f103-minimum:nsh(arm-none-eabi-gcc 10.3.1 -Os):SERIAL_NPOLLWAITERS=4)SERIAL_NPOLLWAITERS=2)Impact
CONFIG_SERIAL_NPOLLWAITERSto2.CONFIG_SERIAL_NPOLLWAITERSin their defconfig or menuconfig.Documentation/os/drivers/character/serial.rst.Testing
Build host: Linux container (
nuttx-builder) witharm-none-eabi-gcc10.3.1.Target board:
stm32f103-minimum:nsh.1. Style & Documentation Verification
nxstyle include/nuttx/serial/serial.h: PASSED (0 errors, 0 warnings).Documentation/os/drivers/character/serial.rst: documentation updated and consistent.2. Kconfig Default Verification
CONFIG_SERIAL_NPOLLWAITERSdefaults to2.3. Build & Size Comparison Logs
Before (
CONFIG_SERIAL_NPOLLWAITERS=4):After (
CONFIG_SERIAL_NPOLLWAITERS=2):