lkml.org 
[lkml]   [2020]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] latency improvement in __smp_call_single_queue
On Wed, Sep 23, 2020 at 10:00:41AM -0500, George Prekas wrote:
> If an interrupt arrives between llist_add and
> send_call_function_single_ipi in the following code snippet, then the
> remote CPU will not receive the IPI in a timely manner and subsequent
> SMP calls even from other CPUs for other functions will be delayed:
>
>     if (llist_add(node, &per_cpu(call_single_queue, cpu)))
>         send_call_function_single_ipi(cpu);
>
> Note: llist_add returns 1 if it was empty before the operation.
>
> CPU 0                           | CPU 1                     | CPU 2
> __smp_call_single_q(2,f1)       | __smp_call_single_q(2,f2) |
>   llist_add returns 1           |                           |
>   interrupted                   |   llist_add returns 0     |
>       ...                       |   branch not taken        |
>       ...                       |                           |
>   resumed                       |                           |
>   send_call_function_single_ipi |                           |
>                                 |                           | f1
>                                 |                           | f2
>
> The call from CPU 1 for function f2 will be delayed because CPU 0 was
> interrupted.

Do you happen to have any actual numbers and a use-case where this was
relevant?

\
 
 \ /
  Last update: 2020-09-24 10:43    [W:0.045 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site