Re: [PATCH V3 0/9] x86/jump_label: Bound IPIs sent when updating a static key

From: Ingo Molnar
Date: Fri Apr 19 2019 - 15:01:23 EST



* Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> wrote:

> Considering that, in this test case, we are saving the handling of 53 IPIs,
> that takes more than these 135 ns, it seems to be a meager price to be paid.
> Moreover, the test case was forcing the hit of the int3, in practice, it
> does not take that often. While the IPI takes place on all CPUs, hitting
> the int3 handler or not!
>
> For instance, in an isolated CPU with a process running in user-space
> (nohz_full use-case), the chances of hitting the int3 handler is barely zero,
> while there is no way to avoid the IPIs. By bounding the IPIs, we are improving
> this scenario a lot.
>
> Changes from v2:
> - Switch the order of patches 8 and 9 (Steven Rostedt)
> - Fallback in the case of failure in the batch mode (Steven Rostedt)
> - Fix a pointer in patch 7 (Steven Rostedt)
> - Adjust the commit log of the patch 1 (Borislav Petkov)
> - Adjust the commit log of the patch 3 (Jiri Kosina/Thomas Gleixner)
> Changes from v1:
> - Split the patch in jump-label/x86-jump-label/alternative (Jason Baron)
> - Use bserach in the int3 handler (Steven Rostedt)
> - Use a pre-allocated page to store the vector (Jason/Steven)
> - Do performance tests in the int3 handler (peterz)
>
> Daniel Bristot de Oliveira (9):
> jump_label: Add for_each_label_entry helper
> jump_label: Add the jump_label_can_update_check() helper
> x86/jump_label: Move checking code away from __jump_label_transform()
> x86/jump_label: Add __jump_label_set_jump_code() helper
> x86/alternative: Split text_poke_bp() into tree steps
> jump_label: Sort entries of the same key by the code
> x86/alternative: Batch of patch operations
> jump_label: Batch updates if arch supports it
> x86/jump_label: Batch jump label updates
>
> arch/x86/include/asm/jump_label.h | 2 +
> arch/x86/include/asm/text-patching.h | 15 +++
> arch/x86/kernel/alternative.c | 140 ++++++++++++++++++---
> arch/x86/kernel/jump_label.c | 174 ++++++++++++++++++++++-----
> include/linux/jump_label.h | 6 +
> kernel/jump_label.c | 73 +++++++++--
> 6 files changed, 359 insertions(+), 51 deletions(-)

Note that I've applied these to tip:WIP.x86/alternatives to help move it
along and help with testing, but before this can go upstream review
feedback from PeterZ needs to be addressed.

Please send the latest series (v3, v4, etc.) with full patches to make it
easy to review from scratch to everyone - I'll reshuffle the WIP branch
accordingly. These are not stable SHA1's yet.

Thanks,

Ingo