[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 3/4] xen: add process_pending_softirqs_norcu() for keyhandlers

On Tue, Feb 18, 2020 at 01:21:13PM +0100, Juergen Gross wrote:
> Some keyhandlers are calling process_pending_softirqs() while holding
> a rcu_read_lock(). This is wrong, as process_pending_softirqs() might
> activate rcu calls which should not happen inside a rcu_read_lock().

It might be helpful to turn the ASSERT in process_pending_softirqs
into ASSERT_NOT_IN_ATOMIC also, as it would catch such missuses

> For that purpose add process_pending_softirqs_norcu() which will not
> do any rcu activity and use this for keyhandlers.

I wonder if for keyhandlers it might be easier to just disable the
watchdog in handle_keypress and remove the softirq processing from the

At the end of day we want the keyhanders to run as fast as possible in
order to get the data out, and we only care about the watchdog not
triggering? (maybe I'm missing something here)

> +void process_pending_softirqs_norcu(void)
> +{
> +    ASSERT(!in_irq() && local_irq_is_enabled());
> +    /* Do not enter scheduler as it can preempt the calling context. */
> +    __do_softirq((1ul << SCHEDULE_SOFTIRQ) | (1ul << SCHED_SLAVE_SOFTIRQ),

Don't you also need to pass RCU_SOFTIRQ to the ignore mask in order to
avoid any RCU work happening?

Thanks, Roger.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.