s390/sclp: increase sclp console line length

Kernel and console/TTY messages written to the SCLP line mode console
are wrapped at 80 characters per line by the associated SCLP driver.
This makes long lines of output difficult to read, and requires editing
of wrapped lines copied from the output device.

Neither the firmware interface used to access the SCLP console, nor the
HMC "Operating System Messages" web interface that displays these
messages require such a length limit. Also other operating systems such
as z/VM do not impose similar limits on messages they emit to the same
console device.

This patch therefore increases the limit to 320 characters per line to
make SCLP line mode console output more readable. As a result 99% of
lines written during a typical boot will not be wrapped, compared to
about 50% wrapped lines at 80 characters per line. Another positive
side-effect of this change is that the HMC console interface is able to
keep more messages in its history buffer due to fewer line-breaks being
generated.

In a worst case scenario this means that a 4k console buffer is emitted
with the last ~400 bytes empty (320 text + 78 headers). This is more
than offset by the fact that each line that is not truncated saves 78
header bytes in the buffer. As a result the actual number of emitted
buffers should be about the same as with the 80 character limit.

This patch also removes the differentiation between line lengths of
SCLP line mode output on z/VM and non-z/VM systems. While the z/VM
hypervisor adds a prefix in front of each line ('xx: ' where xx is the
number of the CPU issuing the message), adjusting Linux line lengths did
not significantly increase readability of console output, and makes even
less of a difference with longer lines.

Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Peter Oberparleiter 2021-03-02 17:28:12 +01:00 коммит произвёл Heiko Carstens
Родитель 37564ed834
Коммит 98ce70b769
2 изменённых файлов: 6 добавлений и 22 удалений

Просмотреть файл

@ -41,8 +41,8 @@ static int sclp_con_suspended;
static int sclp_con_queue_running; static int sclp_con_queue_running;
/* Output format for console messages */ /* Output format for console messages */
static unsigned short sclp_con_columns; #define SCLP_CON_COLUMNS 320
static unsigned short sclp_con_width_htab; #define SPACES_PER_TAB 8
static void static void
sclp_conbuf_callback(struct sclp_buffer *buffer, int rc) sclp_conbuf_callback(struct sclp_buffer *buffer, int rc)
@ -189,8 +189,8 @@ sclp_console_write(struct console *console, const char *message,
} }
page = sclp_con_pages.next; page = sclp_con_pages.next;
list_del((struct list_head *) page); list_del((struct list_head *) page);
sclp_conbuf = sclp_make_buffer(page, sclp_con_columns, sclp_conbuf = sclp_make_buffer(page, SCLP_CON_COLUMNS,
sclp_con_width_htab); SPACES_PER_TAB);
} }
/* try to write the string to the current output buffer */ /* try to write the string to the current output buffer */
written = sclp_write(sclp_conbuf, (const unsigned char *) written = sclp_write(sclp_conbuf, (const unsigned char *)
@ -333,17 +333,6 @@ sclp_console_init(void)
sclp_conbuf = NULL; sclp_conbuf = NULL;
timer_setup(&sclp_con_timer, sclp_console_timeout, 0); timer_setup(&sclp_con_timer, sclp_console_timeout, 0);
/* Set output format */
if (MACHINE_IS_VM)
/*
* save 4 characters for the CPU number
* written at start of each line by VM/CP
*/
sclp_con_columns = 76;
else
sclp_con_columns = 80;
sclp_con_width_htab = 8;
/* enable printk-access to this driver */ /* enable printk-access to this driver */
atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
register_reboot_notifier(&on_reboot_nb); register_reboot_notifier(&on_reboot_nb);

Просмотреть файл

@ -54,8 +54,8 @@ static unsigned short int sclp_tty_chars_count;
struct tty_driver *sclp_tty_driver; struct tty_driver *sclp_tty_driver;
static int sclp_tty_tolower; static int sclp_tty_tolower;
static int sclp_tty_columns = 80;
#define SCLP_TTY_COLUMNS 320
#define SPACES_PER_TAB 8 #define SPACES_PER_TAB 8
#define CASE_DELIMITER 0x6c /* to separate upper and lower case (% in EBCDIC) */ #define CASE_DELIMITER 0x6c /* to separate upper and lower case (% in EBCDIC) */
@ -193,7 +193,7 @@ static int sclp_tty_write_string(const unsigned char *str, int count, int may_fa
} }
page = sclp_tty_pages.next; page = sclp_tty_pages.next;
list_del((struct list_head *) page); list_del((struct list_head *) page);
sclp_ttybuf = sclp_make_buffer(page, sclp_tty_columns, sclp_ttybuf = sclp_make_buffer(page, SCLP_TTY_COLUMNS,
SPACES_PER_TAB); SPACES_PER_TAB);
} }
/* try to write the string to the current output buffer */ /* try to write the string to the current output buffer */
@ -531,11 +531,6 @@ sclp_tty_init(void)
sclp_ttybuf = NULL; sclp_ttybuf = NULL;
sclp_tty_buffer_count = 0; sclp_tty_buffer_count = 0;
if (MACHINE_IS_VM) { if (MACHINE_IS_VM) {
/*
* save 4 characters for the CPU number
* written at start of each line by VM/CP
*/
sclp_tty_columns = 76;
/* case input lines to lowercase */ /* case input lines to lowercase */
sclp_tty_tolower = 1; sclp_tty_tolower = 1;
} }