Skip to contentSkip to conversation

VIRQ_CON_RING

DISCUSSION Jan Beulich 2 participants 4 messages Nov 12, 2009

lore
Share & tools
lore
#0 lore raw

Is there any real user for this vIRQ? I'm asking because, while debugging a problem that required to add some printk()s that could temporarily issue at a high rate, I ran into the situation that this extra output prevented guest/dom0 boot from making any progress. As I then realized this was due to the tasklet_schedule() called from inside the console handling code, which resulted in subsequent hypercall_preempt_check() to force exit (after creating a continuation) from the respective hypercall handler immediately.

While I realize that for compatibility reasons (even in the case of there not being a current user) it may not be possible to drop this vIRQ altogether, I wonder whether it would be possible to avoid scheduling the tasklet when the vIRQ has no handler and/or is already pending.

Jan

#1 lore raw
Quoted 1 line · Jan Beulich

Is there any real user for this vIRQ?

xenconsoled when started with --log=hv|all

Quoted 4 lines

While I realize that for compatibility reasons (even in the case of there not being a current user) it may not be possible to drop this vIRQ altogether, I wonder whether it would be possible to avoid scheduling the tasklet when the vIRQ has no handler and/or is already pending.

So this is due to you adding a really noisy printk in the middle of a hypercall? I don't think you should expect goodness to result from that. Seems to me the issue is as much the extreme load you put on printk as it is printk's overhead.

-- Keir

#2 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 12.11.09 15:51 >>>

Quoted 4 lines · Jan Beulich

While I realize that for compatibility reasons (even in the case of there not being a current user) it may not be possible to drop this vIRQ altogether, I wonder whether it would be possible to avoid scheduling the tasklet when the vIRQ has no handler and/or is already pending.

So this is due to you adding a really noisy printk in the middle of a hypercall? I don't think you should expect goodness to result from that.

No, it wasn't really meant to be that noisy (e.g., it was printing only as long as a guest didn't have a page fault handler registered, and now that I relocated the printing [without changing their amount] I know that after an initial burst this printed just about a dozen lines).

Quoted 2 lines

Seems to me the issue is as much the extreme load you put on printk as it is printk's overhead.

I don't think so: Since __putstr() calls tasklet_schedule() directly and (basically) unconditionally, it is clear that after every printk() hypercall_preempt_check() will return true, and hence placing one anywhere before such a check will make sure that preemption is going to happen. Since the code path will be the same after the continuation hypercall got invoked, it is impossible to make any progress if the preemption check is placed at the beginning of a handler/loop (and even if, like in alloc_l[34]_table(), it is placed after having done at least one iteration, progress is possibly going to be unnoticeable).

Jan

#3 lore raw
Quoted 12 lines · Jan Beulich
Quoted 2 lines

Seems to me the issue is as much the extreme load you put on printk as it is printk's overhead.

I don't think so: Since __putstr() calls tasklet_schedule() directly and (basically) unconditionally, it is clear that after every printk() hypercall_preempt_check() will return true, and hence placing one anywhere before such a check will make sure that preemption is going to happen. Since the code path will be the same after the continuation hypercall got invoked, it is impossible to make any progress if the preemption check is placed at the beginning of a handler/loop (and even if, like in alloc_l[34]_table(), it is placed after having done at least one iteration, progress is possibly going to be unnoticeable).

Well there is that, but who unconditionally prints at the start of a hypercall? Only someone doing very specific and verbose debugging.

-- Keir