On 5/5/20 3:53 PM, Thomas Gleixner wrote:
The pagefault handler cannot use the regular idtentry_enter() because on that invokes rcu_irq_enter() the pagefault was caused in the kernel.
I am struggling to understand this part of the sentence: "because on that invokes rcu_irq_enter() the pagefault was caused in the kernel." Do you mean: "because that invokes rcu_irq_enter() if the pagefault was caused in the kernel." ? alex.
Not a problem per se, but kernel side page faults can schedule which is not possible without invoking rcu_irq_exit(). Adding rcu_irq_exit() and a matching rcu_irq_enter() into the actual pagefault handling code is possible, but not pretty either. Provide idtentry_entry/exit_cond_rcu() which calls rcu_irq_enter() only when RCU is not watching. While this is not a legit kernel #PF establishing RCU before handling it avoids RCU side effects which might affect debugability. The function is also useful for implementing lightweight scheduler IPI entry handling later. Signed-off-by: Thomas Gleixner <[email protected]> --- arch/x86/entry/common.c | 119 ++++++++++++++++++++++++++++++++++------ arch/x86/include/asm/idtentry.h | 3 + 2 files changed, 106 insertions(+), 16 deletions(-)

