[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 1/3] xen/console: cleanup conring management
From: Denis Mukhin <dmukhin@xxxxxxxx> Add new parameter to conring_puts() to trigger conring VIRQ when needed. That cleans up the conring management because it removes VIRQ tasklet code from few places. Move conring tasklet code close to conring definitions in the console driver to enable symbols use in conring_puts(). While doing it, rename conring tasklet variables to match the code. No functional change. Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx> --- Changes since v2: - renamed notify_dom0_con_ring_ prefix to conring_ prefix for readability - renamed console_locks_busted to conring_no_notify for readability - added extra parameter to conring_puts() to trigger VIRQ_CON_RING --- xen/drivers/char/console.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index c3150fbdb7..20504060cb 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -325,7 +325,17 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused) * ******************************************************** */ -static void conring_puts(const char *str, size_t len) +static void cf_check conring_notify(void *unused) +{ + send_global_virq(VIRQ_CON_RING); +} + +static DECLARE_SOFTIRQ_TASKLET(conring_tasklet, conring_notify, NULL); + +/* NB: Do not send conring VIRQs during panic. */ +static bool conring_no_notify; + +static void conring_puts(const char *str, size_t len, bool notify) { ASSERT(rspin_is_locked(&console_lock)); @@ -334,6 +344,9 @@ static void conring_puts(const char *str, size_t len) if ( conringp - conringc > conring_size ) conringc = conringp - conring_size; + + if ( notify ) + tasklet_schedule(&conring_tasklet); } long read_console_ring(struct xen_sysctl_readconsole *op) @@ -594,13 +607,6 @@ static void cf_check serial_rx(char c) __serial_rx(c); } -static void cf_check notify_dom0_con_ring(void *unused) -{ - send_global_virq(VIRQ_CON_RING); -} -static DECLARE_SOFTIRQ_TASKLET(notify_dom0_con_ring_tasklet, - notify_dom0_con_ring, NULL); - #ifdef CONFIG_X86 static inline void xen_console_write_debug_port(const char *buf, size_t len) { @@ -648,10 +654,7 @@ static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, #endif if ( opt_console_to_ring ) - { - conring_puts(kbuf, kcount); - tasklet_schedule(¬ify_dom0_con_ring_tasklet); - } + conring_puts(kbuf, kcount, true); nrspin_unlock_irq(&console_lock); } @@ -753,8 +756,6 @@ long do_console_io( * ***************************************************** */ -static bool console_locks_busted; - static void __putstr(const char *str) { size_t len = strlen(str); @@ -774,10 +775,7 @@ static void __putstr(const char *str) } #endif - conring_puts(str, len); - - if ( !console_locks_busted ) - tasklet_schedule(¬ify_dom0_con_ring_tasklet); + conring_puts(str, len, !conring_no_notify); } static int printk_prefix_check(char *p, char **pp) @@ -1171,7 +1169,7 @@ void console_force_unlock(void) spin_debug_disable(); rspin_lock_init(&console_lock); serial_force_unlock(sercon_handle); - console_locks_busted = 1; + conring_no_notify = true; console_start_sync(); } -- 2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |