[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 24.02.20 12:25, Roger Pau Monné wrote:
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
AFAICT.

No, this would be triggering in __cpu_up() at system boot.



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
handlers.

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)

It is not that simple, I believe.

You'd need to be very careful that other functionality wouldn't suffer.
I'm e.g. not sure time_calibration won't lead to a hanging system then.


+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?

Yes, that's probably a good idea.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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