lkml.org 
[lkml]   [2020]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 14/18] static_call: Add static_cond_call()
From
Date
On 01/05/2020 22.29, Peter Zijlstra wrote:
> Extend the static_call infrastructure to optimize the following common
> pattern:
>
> if (func_ptr)
> func_ptr(args...)
>
> +
> #define static_call(name) __static_call(name)
> +#define static_cond_call(name) (void)__static_call(name)
>
> +
> #define static_call(name) __static_call(name)
> +#define static_cond_call(name) (void)__static_call(name)
>

> +#define static_cond_call(name) \
> + if (STATIC_CALL_KEY(name).func) \
> + ((typeof(STATIC_CALL_TRAMP(name))*)(STATIC_CALL_KEY(name).func))
> +

This addresses neither the READ_ONCE issue nor the fact that, AFAICT,
the semantics of

static_cond_call(foo)(i++)

will depend on CONFIG_HAVE_STATIC_CALL. Also, I'd have appreciated being
cc'ed on new revisions instead of stumbling on it by chance.

Rasmus

\
 
 \ /
  Last update: 2020-05-02 15:08    [W:0.538 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site