All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] console/serial: adjust default TX buffer size
@ 2022-06-30  8:23 Roger Pau Monne
  2022-06-30  8:23 ` [PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig Roger Pau Monne
  2022-06-30  8:23 ` [PATCH v2 2/2] console/serial: bump buffer from 16K to 32K Roger Pau Monne
  0 siblings, 2 replies; 4+ messages in thread
From: Roger Pau Monne @ 2022-06-30  8:23 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini, Wei Liu

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/59fe1b28-b173-e497-5b8a-5e0bb6d946b6@suse.com/

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(-)

-- 
2.36.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig
  2022-06-30  8:23 [PATCH v2 0/2] console/serial: adjust default TX buffer size Roger Pau Monne
@ 2022-06-30  8:23 ` Roger Pau Monne
  2022-06-30  8:52   ` Jan Beulich
  2022-06-30  8:23 ` [PATCH v2 2/2] console/serial: bump buffer from 16K to 32K Roger Pau Monne
  1 sibling, 1 reply; 4+ messages in thread
From: Roger Pau Monne @ 2022-06-30  8:23 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini, Wei Liu

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

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
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(-)

diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index e5f7b1d8eb..dec58bc993 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -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).
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index 5ecba0af33..f6c944bd30 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -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))
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] console/serial: bump buffer from 16K to 32K
  2022-06-30  8:23 [PATCH v2 0/2] console/serial: adjust default TX buffer size Roger Pau Monne
  2022-06-30  8:23 ` [PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig Roger Pau Monne
@ 2022-06-30  8:23 ` Roger Pau Monne
  1 sibling, 0 replies; 4+ messages in thread
From: Roger Pau Monne @ 2022-06-30  8:23 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini, Wei Liu

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.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/char/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index dec58bc993..294b3509c7 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -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).
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig
  2022-06-30  8:23 ` [PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig Roger Pau Monne
@ 2022-06-30  8:52   ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2022-06-30  8:52 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini,
	Wei Liu, xen-devel

On 30.06.2022 10:23, Roger Pau Monne wrote:
> Take the opportunity to convert the variable to read-only after init.
> 
> No functional change intended.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-30  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30  8:23 [PATCH v2 0/2] console/serial: adjust default TX buffer size Roger Pau Monne
2022-06-30  8:23 ` [PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig Roger Pau Monne
2022-06-30  8:52   ` Jan Beulich
2022-06-30  8:23 ` [PATCH v2 2/2] console/serial: bump buffer from 16K to 32K Roger Pau Monne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.