Skip to contentSkip to conversation

console/serial: adjust default TX buffer size

PATCH In review Roger Pau Monne 2 participants 4 messages Jun 30, 2022

lore
Share & tools
lore
#0 lore raw

v2 cover console/serial: adjust default TX buffer size

Hello,

First patch moves the setting of the default TX buffer size to Kconfig, and shouldn't be controversial, second patch increases the buffer to 32K. Jan doesn't feel comfortable Acking patch 2, so someone will have to review and consider it, see:

https://lore.kernel.org/xen-devel/[email protected]/

Thanks, Roger.

Roger Pau Monne (2):
console/serial: set the default transmit buffer size in Kconfig console/serial: bump buffer from 16K to 32K

 xen/drivers/char/Kconfig  | 10 ++++++++++
 xen/drivers/char/serial.c |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
Signature · 1 line
2.36.1
#1 lore raw

PATCH v2 1/2 console/serial: set the default transmit buffer size in Kconfig

Take the opportunity to convert the variable to read-only after init.

No functional change intended.

---
Changes since v1:
- Fix help message about rounded boundary, do not round up the default value (will be done at runtime).
- Use kiB instead of KB.

---
 xen/drivers/char/Kconfig  | 10 ++++++++++
 xen/drivers/char/serial.c |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
xen/drivers/char/Kconfig +10 -0
index e5f7b1d8eb..dec58bc993 100644
@@ -74,3 +74,13 @@ config HAS_EHCI
 	help
 	  This selects the USB based EHCI debug port to be used as a UART. If
 	  you have an x86 based system with USB, say Y.
+
+config SERIAL_TX_BUFSIZE
+	int "Size of the transmit serial buffer"
+	default 16384
+	help
+	  Controls the default size of the transmit buffer (in bytes) used by
+	  the serial driver.  Note the value provided will be rounded down to
+	  the nearest power of 2.
+
+	  Default value is 16384 (16kiB).
xen/drivers/char/serial.c +1 -1
index 5ecba0af33..f6c944bd30 100644
@@ -16,7 +16,7 @@
 /* Never drop characters, even if the async transmit buffer fills. */
 /* #define SERIAL_NEVER_DROP_CHARS 1 */
 
-unsigned int __read_mostly serial_txbufsz = 16384;
+unsigned int __ro_after_init serial_txbufsz = CONFIG_SERIAL_TX_BUFSIZE;
 size_param("serial_tx_buffer", serial_txbufsz);
 
 #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1))
Signature · 1 line
2.36.1
#3 lore raw

PATCH v2 2/2 console/serial: bump buffer from 16K to 32K

In reply to Roger Pau Monne

Testing on a Kaby Lake box with 8 CPUs leads to the serial buffer being filled halfway during dom0 boot, and thus a non-trivial chunk of Linux boot messages are dropped.

Increasing the buffer to 32K does fix the issue and Linux boot messages are no longer dropped. There's no justification either on why 16K was chosen, and hence bumping to 32K in order to cope with current systems generating output faster does seem appropriate to have a better user experience with the provided defaults.

---
 xen/drivers/char/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/drivers/char/Kconfig +2 -2
index dec58bc993..294b3509c7 100644
@@ -77,10 +77,10 @@ config HAS_EHCI
 
 config SERIAL_TX_BUFSIZE
 	int "Size of the transmit serial buffer"
-	default 16384
+	default 32768
 	help
 	  Controls the default size of the transmit buffer (in bytes) used by
 	  the serial driver.  Note the value provided will be rounded down to
 	  the nearest power of 2.
 
-	  Default value is 16384 (16kiB).
+	  Default value is 32768 (32kiB).
Signature · 1 line
2.36.1